• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision28c3e6db471b00203133ca89c67f7507a9f7405d (tree)
Time2020-02-07 22:37:15
AuthorVladimir Murzin <vladimir.murzin@arm....>
CommiterWaldemar Brodkorb

Log Message

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>

Change Summary

Incremental Difference

--- a/libc/sysdeps/linux/common/bits/ipc.h
+++ b/libc/sysdeps/linux/common/bits/ipc.h
@@ -20,6 +20,7 @@
2020 #endif
2121
2222 #include <bits/types.h>
23+#include <bits/wordsize.h>
2324
2425 /* Mode bits for `msgget', `semget', and `shmget'. */
2526 #define IPC_CREAT 01000 /* Create key if key does not exist. */
@@ -46,8 +47,12 @@ struct ipc_perm
4647 __gid_t gid; /* Owner's group ID. */
4748 __uid_t cuid; /* Creator's user ID. */
4849 __gid_t cgid; /* Creator's group ID. */
50+#if __WORDSIZE == 64
51+ unsigned int mode;
52+#else
4953 unsigned short int mode; /* Read/write permission. */
5054 unsigned short int __pad1;
55+#endif
5156 unsigned short int __seq; /* Sequence number. */
5257 unsigned short int __pad2;
5358 unsigned long int __unused1;
--- a/libc/sysdeps/linux/common/bits/sem.h
+++ b/libc/sysdeps/linux/common/bits/sem.h
@@ -20,6 +20,7 @@
2020 #endif
2121
2222 #include <sys/types.h>
23+#include <bits/wordsize.h>
2324
2425 /* Flags for `semop'. */
2526 #define SEM_UNDO 0x1000 /* undo the operation on exit */
@@ -39,9 +40,13 @@ struct semid_ds
3940 {
4041 struct ipc_perm sem_perm; /* operation permission struct */
4142 __time_t sem_otime; /* last semop() time */
43+#if __WORDSIZE == 32
4244 unsigned long int __unused1;
45+#endif
4346 __time_t sem_ctime; /* last time changed by semctl() */
47+#if __WORDSIZE == 32
4448 unsigned long int __unused2;
49+#endif
4550 unsigned long int sem_nsems; /* number of semaphores in set */
4651 unsigned long int __unused3;
4752 unsigned long int __unused4;