[pypy-svn] r45264 - in pypy/dist/pypy/rpython: lltypesystem module

fijal at codespeak.net fijal at codespeak.net
Mon Jul 23 12:23:30 CEST 2007


Author: fijal
Date: Mon Jul 23 12:23:28 2007
New Revision: 45264

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rfficache.py
   pypy/dist/pypy/rpython/module/ll_os.py
Log:
(exarkun) setsid implementation, rpython level


Modified: pypy/dist/pypy/rpython/lltypesystem/rfficache.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rfficache.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rfficache.py	Mon Jul 23 12:23:28 2007
@@ -42,6 +42,7 @@
           'long long', 'unsigned long long', 'size_t']
 if os.name != 'nt':
     TYPES.append('mode_t')
+    TYPES.append('pid_t')
 
 def get_type_sizes(filename, compiler_exe=None):
     try:

Modified: pypy/dist/pypy/rpython/module/ll_os.py
==============================================================================
--- pypy/dist/pypy/rpython/module/ll_os.py	(original)
+++ pypy/dist/pypy/rpython/module/ll_os.py	Mon Jul 23 12:23:28 2007
@@ -109,6 +109,21 @@
 register_external(ros.utime_tuple, [str, (float, float)], s_None, "ll_os.utime_tuple",
                   llimpl=utime_tuple_lltypeimpl)
 
+# ------------------------------- os.setsid -----------------------------
+
+if hasattr(os, 'setsid'):
+    os_setsid = rffi.llexternal('setsid', [], rffi.PID_T,
+                                includes=['unistd.h'])
+
+    def setsid_lltypeimpl():
+        result = rffi.cast(lltype.Signed, os_setsid())
+        if result == -1:
+            raise OSError(rffi.c_errno, "os_setsid failed")
+        return result
+
+    register_external(os.setsid, [], int, export_name="ll_os.ll_os_setsid",
+                      llimpl=setsid_lltypeimpl)
+
 # ------------------------------- os.open -------------------------------
 
 if os.name == 'nt':



More information about the Pypy-commit mailing list