This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] PPC64 correct IPC headers
- From: Steven Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 20 Nov 2002 11:32:44 -0600
- Subject: [PATCH] PPC64 correct IPC headers
- Organization: IBM Linux Developement
- Reply-to: sjmunroe at vnet dot ibm dot com
The IPC headers ./bits/msq.h ./bits/sem.h and ./bits/shm.h are shared by
PPC32 and PPC64 but differ in size and alignment because the size of
time_t is different. Also the PPC64 kernel followed other 64-bit arches
and replaced the 32-bit "unused"/time_t pair with a single 64-bit
time_t. The following patch uses __WORDSIZE == 32 to retain the "unused"
fields for PPC32 but elliminate them for PPC64.
2002-11-20 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/bits/msq.h (msqid_ds)
[__WORDSIZE == 32]: Only PPC32 requires __unused1, __unused2,
and __unused3 fields.
* sysdeps/unix/sysv/linux/powerpc/bits/sem.h (semid_ds)
[__WORDSIZE == 32]: Only PPC32 requires __unused1
and __unused2 fields.
* sysdeps/unix/sysv/linux/powerpc/bits/shm.h (shmid_ds)
[__WORDSIZE == 32]: Only PPC32 requires __unused1, __unused2,
__unused3,and __unused4 fields.
--
Steven Munroe
sjmunroe@us.ibm.com
Linux on PowerPC-64 Development
GLIBC for PowerPC-64 Development
diff -rupPN libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/msq.h libc23/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
--- libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/msq.h Thu Jul 5 23:56:19 2001
+++ libc23/sysdeps/unix/sysv/linux/powerpc/bits/msq.h Tue Nov 19 13:37:26 2002
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -38,11 +38,17 @@ typedef unsigned long int msglen_t;
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t msg_stime; /* time of last msgsnd command */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t msg_rtime; /* time of last msgrcv command */
+#if __WORDSIZE == 32
unsigned int __unused3;
+#endif
__time_t msg_ctime; /* time of last change */
unsigned long __msg_cbytes; /* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
diff -rupPN libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/sem.h libc23/sysdeps/unix/sysv/linux/powerpc/bits/sem.h
--- libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/sem.h Thu Jul 5 23:56:19 2001
+++ libc23/sysdeps/unix/sysv/linux/powerpc/bits/sem.h Tue Nov 19 13:37:26 2002
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,9 +40,13 @@
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t sem_otime; /* last semop() time */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t sem_ctime; /* last time changed by semctl() */
unsigned long int sem_nsems; /* number of semaphores in set */
unsigned long __unused3;
diff -rupPN -x libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/shm.h libc23/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
--- libc23-cvstip-20021119/sysdeps/unix/sysv/linux/powerpc/bits/shm.h Fri Aug 23 17:26:25 2002
+++ libc23/sysdeps/unix/sysv/linux/powerpc/bits/shm.h Tue Nov 19 13:37:26 2002
@@ -47,13 +47,21 @@ typedef unsigned long int shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm; /* operation permission struct */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t shm_atime; /* time of last shmat() */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t shm_dtime; /* time of last shmdt() */
+#if __WORDSIZE == 32
unsigned int __unused3;
- __time_t shm_ctime; /* time of last change by shmctl() */
+#endif
+ __time_t shm_ctime; /* time of last change by shmctl() */
+#if __WORDSIZE == 32
unsigned int __unused4;
+#endif
size_t shm_segsz; /* size of segment in bytes */
__pid_t shm_cpid; /* pid of creator */
__pid_t shm_lpid; /* pid of last shmop */