Revision | 28c3e6db471b00203133ca89c67f7507a9f7405d (tree) |
---|---|
Zeit | 2020-02-07 22:37:15 |
Autor | Vladimir Murzin <vladimir.murzin@arm....> |
Commiter | Waldemar Brodkorb |
common/bits: Fix ipc_perm and semid_ds definitions for 64-bit arches
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 <vladimir.murzin@arm.com>
@@ -20,6 +20,7 @@ | ||
20 | 20 | #endif |
21 | 21 | |
22 | 22 | #include <bits/types.h> |
23 | +#include <bits/wordsize.h> | |
23 | 24 | |
24 | 25 | /* Mode bits for `msgget', `semget', and `shmget'. */ |
25 | 26 | #define IPC_CREAT 01000 /* Create key if key does not exist. */ |
@@ -46,8 +47,12 @@ struct ipc_perm | ||
46 | 47 | __gid_t gid; /* Owner's group ID. */ |
47 | 48 | __uid_t cuid; /* Creator's user ID. */ |
48 | 49 | __gid_t cgid; /* Creator's group ID. */ |
50 | +#if __WORDSIZE == 64 | |
51 | + unsigned int mode; | |
52 | +#else | |
49 | 53 | unsigned short int mode; /* Read/write permission. */ |
50 | 54 | unsigned short int __pad1; |
55 | +#endif | |
51 | 56 | unsigned short int __seq; /* Sequence number. */ |
52 | 57 | unsigned short int __pad2; |
53 | 58 | unsigned long int __unused1; |
@@ -20,6 +20,7 @@ | ||
20 | 20 | #endif |
21 | 21 | |
22 | 22 | #include <sys/types.h> |
23 | +#include <bits/wordsize.h> | |
23 | 24 | |
24 | 25 | /* Flags for `semop'. */ |
25 | 26 | #define SEM_UNDO 0x1000 /* undo the operation on exit */ |
@@ -39,9 +40,13 @@ struct semid_ds | ||
39 | 40 | { |
40 | 41 | struct ipc_perm sem_perm; /* operation permission struct */ |
41 | 42 | __time_t sem_otime; /* last semop() time */ |
43 | +#if __WORDSIZE == 32 | |
42 | 44 | unsigned long int __unused1; |
45 | +#endif | |
43 | 46 | __time_t sem_ctime; /* last time changed by semctl() */ |
47 | +#if __WORDSIZE == 32 | |
44 | 48 | unsigned long int __unused2; |
49 | +#endif | |
45 | 50 | unsigned long int sem_nsems; /* number of semaphores in set */ |
46 | 51 | unsigned long int __unused3; |
47 | 52 | unsigned long int __unused4; |