]> Git Repo - uclibc-ng.git/commitdiff
common/bits: Fix ipc_perm and semid_ds definitions for 64-bit arches
authorVladimir Murzin <[email protected]>
Thu, 6 Feb 2020 13:13:54 +0000 (13:13 +0000)
committerWaldemar Brodkorb <[email protected]>
Fri, 7 Feb 2020 13:37:15 +0000 (14:37 +0100)
It fixes:

FAIL sem got 1 expected 0
failed: incorrect sem_nsems!
semget(IPC_CREAT) = 0
semctl(k) = 0
sem_nsems = 0

for aarch64.

Signed-off-by: Vladimir Murzin <[email protected]>
libc/sysdeps/linux/common/bits/ipc.h
libc/sysdeps/linux/common/bits/sem.h

index 3bd5f1b6f18d91fe88248b2011198d9f20e5aac3..ca7f58cc73c72cc92771ee63a36228ec0bc1fce9 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 
 #include <bits/types.h>
+#include <bits/wordsize.h>
 
 /* Mode bits for `msgget', `semget', and `shmget'.  */
 #define IPC_CREAT      01000           /* Create key if key does not exist. */
@@ -46,8 +47,12 @@ struct ipc_perm
     __gid_t gid;                       /* Owner's group ID.  */
     __uid_t cuid;                      /* Creator's user ID.  */
     __gid_t cgid;                      /* Creator's group ID.  */
+#if __WORDSIZE == 64
+    unsigned  int mode;
+#else
     unsigned short int mode;           /* Read/write permission.  */
     unsigned short int __pad1;
+#endif
     unsigned short int __seq;          /* Sequence number.  */
     unsigned short int __pad2;
     unsigned long int __unused1;
index 501e0803b418fde88ed3b077cc5f4335ac49ee7d..3fb10d42f463256ada2c010fbb1d6f7f8d15035f 100644 (file)
@@ -20,6 +20,7 @@
 #endif
 
 #include <sys/types.h>
+#include <bits/wordsize.h>
 
 /* Flags for `semop'.  */
 #define SEM_UNDO       0x1000          /* undo the operation on exit */
@@ -39,9 +40,13 @@ struct semid_ds
 {
   struct ipc_perm sem_perm;            /* operation permission struct */
   __time_t sem_otime;                  /* last semop() time */
+#if __WORDSIZE == 32
   unsigned long int __unused1;
+#endif
   __time_t sem_ctime;                  /* last time changed by semctl() */
+#if __WORDSIZE == 32
   unsigned long int __unused2;
+#endif
   unsigned long int sem_nsems;         /* number of semaphores in set */
   unsigned long int __unused3;
   unsigned long int __unused4;
This page took 0.02879 seconds and 4 git commands to generate.