Author: Maciej Fijalkowski <[email protected]>
Branch: file-support-in-rpython
Changeset: r67081:81e1bab40fc3
Date: 2013-09-24 10:29 +0200
http://bitbucket.org/pypy/pypy/changeset/81e1bab40fc3/

Log:    another obscure os.xyz

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
@@ -1678,6 +1678,17 @@
         return extdef([], str, llimpl=ctermid_llimpl,
                       export_name="ll_os.ll_os_ctermid")
 
+    @registering_if(os, 'tmpnam')
+    def register_os_tmpnam(self):
+        os_tmpnam = self.llexternal('tmpnam', [rffi.CCHARP], rffi.CCHARP)
+
+        def tmpnam_llimpl(name):
+            buf = rffi.str2charp(name)
+            try:
+                return rffi.charp2str(os_tmpnam(buf))
+            finally:
+                lltype.free(buf, flavor='raw')
+
 # --------------------------- os.stat & variants ---------------------------
 
     @registering(os.fstat)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to