[Python-modules-commits] [python-llfuse] 09/11: Work around bug in mips+mipsel libc

Nikolaus Rath nikratio-guest at moszumanska.debian.org
Mon Nov 13 12:52:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

nikratio-guest pushed a commit to branch master
in repository python-llfuse.

commit 607834e7265a65e5339f919b84390e3758ad91ac
Author: Nikolaus Rath <Nikolaus at rath.org>
Date:   Mon Nov 13 12:31:56 2017 +0000

    Work around bug in mips+mipsel libc
    
    Forwarded: no
    Patch-Name: mips_dev_t.diff
    
    On mips and mipsel, the st_dev and st_rdev members of struct stat do not
    have type dev_t. This breaks POSIX compatibility, but is difficult to fix
    (cf. https://sourceware.org/bugzilla/show_bug.cgi?id=17786).
    
    To work around the issue, we change the definition of struct stat that
    is used by Cython when we are compiling under mips. Note that this
    requires the Cython compilation to run under mips, and that the
    resulting C file will be mips specific (without the patch, the
    generated C file is suitable for any architecture).
    
    Upstream is not interested in this change for obvious reasons.
---
 Include/posix/stat.pxd | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/Include/posix/stat.pxd b/Include/posix/stat.pxd
new file mode 100644
index 0000000..45144d1
--- /dev/null
+++ b/Include/posix/stat.pxd
@@ -0,0 +1,37 @@
+from posix.types cimport (blkcnt_t, blksize_t, dev_t, gid_t, ino_t, mode_t,
+                          nlink_t, off_t, time_t, uid_t)
+
+IF UNAME_MACHINE in ('mips', 'mipsel'):
+    cdef extern from "<sys/stat.h>" nogil:
+        cdef struct struct_stat "stat":
+            unsigned st_dev
+            ino_t   st_ino
+            mode_t  st_mode
+            nlink_t st_nlink
+            uid_t   st_uid
+            gid_t   st_gid
+            unsigned st_rdev
+            off_t   st_size
+            blksize_t st_blksize
+            blkcnt_t st_blocks
+            time_t  st_atime
+            time_t  st_mtime
+            time_t  st_ctime
+            time_t  st_birthtime
+ELSE:
+    cdef extern from "<sys/stat.h>" nogil:
+        cdef struct struct_stat "stat":
+            dev_t   st_dev
+            ino_t   st_ino
+            mode_t  st_mode
+            nlink_t st_nlink
+            uid_t   st_uid
+            gid_t   st_gid
+            dev_t   st_rdev
+            off_t   st_size
+            blksize_t st_blksize
+            blkcnt_t st_blocks
+            time_t  st_atime
+            time_t  st_mtime
+            time_t  st_ctime
+            time_t  st_birthtime

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-llfuse.git



More information about the Python-modules-commits mailing list