[pypy-commit] pypy default: rposix.sync()

arigo pypy.commits at gmail.com
Tue Sep 13 13:09:46 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r87084:f099ecbce222
Date: 2016-09-13 19:05 +0200
http://bitbucket.org/pypy/pypy/changeset/f099ecbce222/

Log:	rposix.sync()

diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -461,6 +461,8 @@
                    save_err=rffi.RFFI_SAVE_ERRNO)
 c_fdatasync = external('fdatasync', [rffi.INT], rffi.INT,
                        save_err=rffi.RFFI_SAVE_ERRNO)
+if not _WIN32:
+    c_sync = external('sync', [], lltype.Void)
 
 @replace_os_function('ftruncate')
 def ftruncate(fd, length):
@@ -477,6 +479,9 @@
     validate_fd(fd)
     handle_posix_error('fdatasync', c_fdatasync(fd))
 
+def sync():
+    c_sync()
+
 #___________________________________________________________________
 
 c_chdir = external('chdir', [rffi.CCHARP], rffi.INT,
diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -604,3 +604,7 @@
     assert rposix.get_inheritable(fd1) == False
     os.close(fd1)
     os.close(fd2)
+
+def test_sync():
+    if sys.platform != 'win32':
+        rposix.sync()


More information about the pypy-commit mailing list