about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-03-11 17:01:34 -0400
committerRich Felker <dalias@aerifal.cx>2014-03-11 17:01:34 -0400
commitad66ae93d083ede90431bacf034f29ebd0815d73 (patch)
treef575200adf58ea9e7410d5f14515aee5719bb050
parentf6e2f7e13f0edb1bb1d94e6ad4bf44abffd048d1 (diff)
downloadmusl-ad66ae93d083ede90431bacf034f29ebd0815d73.tar.gz
musl-ad66ae93d083ede90431bacf034f29ebd0815d73.tar.xz
musl-ad66ae93d083ede90431bacf034f29ebd0815d73.zip
fix sysvipc structures on powerpc
these have been wrong for a long time and were never detected or
corrected. powerpc needs some gratuitous extra padding/reserved slots
in ipc_perm, big-endian ordering for the padding of time_t slots that
was intended by the kernel folks to allow a transition to 64-bit
time_t, and some minor gratuitous reordering of struct members.
-rw-r--r--arch/powerpc/bits/ipc.h5
-rw-r--r--arch/powerpc/bits/msg.h6
-rw-r--r--arch/powerpc/bits/sem.h16
-rw-r--r--arch/powerpc/bits/shm.h9
4 files changed, 16 insertions, 20 deletions
diff --git a/arch/powerpc/bits/ipc.h b/arch/powerpc/bits/ipc.h
index b0bcfa3f..e1bfe2f5 100644
--- a/arch/powerpc/bits/ipc.h
+++ b/arch/powerpc/bits/ipc.h
@@ -7,8 +7,9 @@ struct ipc_perm
 	gid_t cgid;
 	mode_t mode;
 	int __ipc_perm_seq;
-	long __pad1;
-	long __pad2;
+	int __pad1;
+	long long __pad2;
+	long long __pad3;
 };
 
 #define IPC_64 0x100
diff --git a/arch/powerpc/bits/msg.h b/arch/powerpc/bits/msg.h
index 3db8576b..a6b9ad5b 100644
--- a/arch/powerpc/bits/msg.h
+++ b/arch/powerpc/bits/msg.h
@@ -1,12 +1,12 @@
 struct msqid_ds
 {
 	struct ipc_perm msg_perm;
-	time_t msg_stime;
 	int __unused1;
-	time_t msg_rtime;
+	time_t msg_stime;
 	int __unused2;
-	time_t msg_ctime;
+	time_t msg_rtime;
 	int __unused3;
+	time_t msg_ctime;
 	unsigned long msg_cbytes;
 	msgqnum_t msg_qnum;
 	msglen_t msg_qbytes;
diff --git a/arch/powerpc/bits/sem.h b/arch/powerpc/bits/sem.h
index c629b81e..bc2d6d1f 100644
--- a/arch/powerpc/bits/sem.h
+++ b/arch/powerpc/bits/sem.h
@@ -1,16 +1,10 @@
 struct semid_ds {
 	struct ipc_perm sem_perm;
+	int __unused1;
 	time_t sem_otime;
-	time_t __unused1;
+	int  __unused2;
 	time_t sem_ctime;
-	time_t __unused2;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-	unsigned short sem_nsems;
-	char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
-#else
-	char __sem_nsems_pad[sizeof(time_t)-sizeof(short)];
-	unsigned short sem_nsems;
-#endif
-	time_t __unused3;
-	time_t __unused4;
+	unsigned short __sem_nsems_pad, sem_nsems;
+	long __unused3;
+	long __unused4;
 };
diff --git a/arch/powerpc/bits/shm.h b/arch/powerpc/bits/shm.h
index 547581f1..c698ef34 100644
--- a/arch/powerpc/bits/shm.h
+++ b/arch/powerpc/bits/shm.h
@@ -3,13 +3,14 @@
 struct shmid_ds
 {
 	struct ipc_perm shm_perm;
-	size_t shm_segsz;
-	time_t shm_atime;
 	int __unused1;
-	time_t shm_dtime;
+	time_t shm_atime;
 	int __unused2;
-	time_t shm_ctime;
+	time_t shm_dtime;
 	int __unused3;
+	time_t shm_ctime;
+	int __unused4;
+	size_t shm_segsz;
 	pid_t shm_cpid;
 	pid_t shm_lpid;
 	unsigned long shm_nattch;