Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r66998:c5f2ba2568ae
Date: 2013-09-18 12:21 +0200
http://bitbucket.org/pypy/pypy/changeset/c5f2ba2568ae/

Log:    ctermid impl in rpython, no idea how to test it

diff --git a/rpython/rtyper/module/ll_os.py b/rpython/rtyper/module/ll_os.py
--- a/rpython/rtyper/module/ll_os.py
+++ b/rpython/rtyper/module/ll_os.py
@@ -1668,6 +1668,16 @@
         return extdef([int], int, llimpl=nice_llimpl,
                       export_name="ll_os.ll_os_nice")
 
+    @registering_if(os, 'ctermid')
+    def register_os_ctermid(self):
+        os_ctermid = self.llexternal('ctermid', [rffi.CCHARP], rffi.CCHARP)
+
+        def ctermid_llimpl():
+            return rffi.charp2str(os_ctermid(lltype.nullptr(rffi.CCHARP.TO)))
+
+        return extdef([], str, llimpl=ctermid_llimpl,
+                      export_name="ll_os.ll_os_ctermid")
+
 # --------------------------- os.stat & variants ---------------------------
 
     @registering(os.fstat)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to