[pypy-commit] pypy arm-backend-2: (arigo, bivab) Add a comment and assert that sizeof(off_t) is long long

bivab noreply at buildbot.pypy.org
Thu Feb 16 16:56:41 CET 2012


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r52554:20a1b70bd4ff
Date: 2012-02-16 16:54 +0100
http://bitbucket.org/pypy/pypy/changeset/20a1b70bd4ff/

Log:	(arigo, bivab) Add a comment and assert that sizeof(off_t) is long
	long

diff --git a/pypy/rpython/module/ll_os.py b/pypy/rpython/module/ll_os.py
--- a/pypy/rpython/module/ll_os.py
+++ b/pypy/rpython/module/ll_os.py
@@ -180,10 +180,15 @@
                            ('tms_cutime', rffi.INT),
                            ('tms_cstime', rffi.INT)])
 
-        GID_T = platform.SimpleType('gid_t',rffi.INT)
+        GID_T = platform.SimpleType('gid_t', rffi.INT)
         #TODO right now is used only in getgroups, may need to update other
         #functions like setgid
 
+    # For now we require off_t to be the same size as LONGLONG, which is the
+    # interface required by callers of functions that thake an argument of type
+    # off_t
+    OFF_T_SIZE = platform.SizeOf('off_t')
+
     SEEK_SET = platform.DefinedConstantInteger('SEEK_SET')
     SEEK_CUR = platform.DefinedConstantInteger('SEEK_CUR')
     SEEK_END = platform.DefinedConstantInteger('SEEK_END')
@@ -197,6 +202,7 @@
 
     def __init__(self):
         self.configure(CConfig)
+	assert self.OFF_T_SIZE == rffi.sizeof(rffi.LONGLONG)
 
         if hasattr(os, 'getpgrp'):
             self.GETPGRP_HAVE_ARG = platform.checkcompiles(


More information about the pypy-commit mailing list