This fixes a problem identified by Mark Salter on C6X big-endian
systems. We should not use "unsigned short int mode"; the proper type is
in theory mode_t, but here we need to use kernel_mode_t since this
structure is used for communication with the kernel, and some targets
have a 16-bit kernel_mode_t and 32-bit mode_t.

Please also compare linux-2.6/include/asm-generic/ipcbuf.h, which uses
the same definition for mode/pad1 as the one introduced by the patch.


Bernd
Index: libc/sysdeps/linux/common/bits/ipc.h
===================================================================
--- libc/sysdeps/linux/common/bits/ipc.h        (revision 320360)
+++ libc/sysdeps/linux/common/bits/ipc.h        (working copy)
@@ -47,8 +47,9 @@ struct ipc_perm
     __gid_t gid;                       /* Owner's group ID.  */
     __uid_t cuid;                      /* Creator's user ID.  */
     __gid_t cgid;                      /* Creator's group ID.  */
-    unsigned short int mode;           /* Read/write permission.  */
-    unsigned short int __pad1;
+    __kernel_mode_t mode;               /* Read/write permission.  */
+                                        /* pad if mode_t is u16: */
+    unsigned char __pad1[4 - sizeof(__kernel_mode_t)];
     unsigned short int __seq;          /* Sequence number.  */
     unsigned short int __pad2;
     unsigned long int __unused1;
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to