This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix IPC for PPC (maybe needed for mips and sparc64 too?)
- To: libc-alpha at sources dot redhat dot com
- Subject: [PATCH] Fix IPC for PPC (maybe needed for mips and sparc64 too?)
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Sun, 17 Sep 2000 22:14:49 +0200
Hi,
I finally found the reason why some X apps (namely gdm and the gtk+ tree
example) had problems on Linux/PPC, glibc was treating PPC as a 16bit
uid_t/gid_t/etc. platform, but this was never the case on PPC, we had 32bit
from the beginning. The attached patch fixes it. Mips and sparc64 may need
similar fixes.
Franz.
* sysdeps/unix/sysv/linux/kernel-features.h: Always define
__ASSUME_32BITUIDS for __powerpc__.
* sysdeps/unix/sysv/linux/powerpc/ipc_priv.h: New file.
* sysdeps/unix/sysv/linux/powerpc/Dist: Add ipc_priv.h.
? sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
Index: sysdeps/unix/sysv/linux/kernel-features.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/kernel-features.h,v
retrieving revision 1.18
diff -u -p -r1.18 kernel-features.h
--- sysdeps/unix/sysv/linux/kernel-features.h 2000/09/07 06:19:21 1.18
+++ sysdeps/unix/sysv/linux/kernel-features.h 2000/09/17 20:06:07
@@ -111,7 +111,7 @@
#endif
/* Linux 2.3.39 introduced 32bit UID/GIDs. */
-#if __LINUX_KERNEL_VERSION >= 131879
+#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__
# define __ASSUME_32BITUIDS 1
# ifdef __sparc__
# define __ASSUME_SETRESUID_SYSCALL 1
Index: sysdeps/unix/sysv/linux/powerpc/Dist
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/powerpc/Dist,v
retrieving revision 1.12
diff -u -p -r1.12 Dist
--- sysdeps/unix/sysv/linux/powerpc/Dist 2000/08/31 23:33:07 1.12
+++ sysdeps/unix/sysv/linux/powerpc/Dist 2000/09/17 20:06:09
@@ -1,5 +1,6 @@
clone.S
fe_nomask.c
+ipc_priv.h
kernel_stat.h
kernel_termios.h
oldgetrlimit64.c
--- /dev/null Tue May 5 22:32:27 1998
+++ sysdeps/unix/sysv/linux/powerpc/ipc_priv.h Sun Sep 17 16:26:07 2000
@@ -0,0 +1,54 @@
+/* Copyright (C) 1995-1999, 2000 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
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sys/ipc.h>
+
+#define __IPC_64 0x100
+
+struct __old_ipc_perm
+{
+ __key_t __key; /* Key. */
+ unsigned int uid; /* Owner's user ID. */
+ unsigned int gid; /* Owner's group ID. */
+ unsigned int cuid; /* Creator's user ID. */
+ unsigned int cgid; /* Creator's group ID. */
+ unsigned int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+};
+
+
+__BEGIN_DECLS
+
+/* The actual system call: all functions are multiplexed by this. */
+extern int __syscall_ipc (int __call, int __first, int __second,
+ int __third, void *__ptr);
+
+__END_DECLS
+
+/* The codes for the functions to use the multiplexer `__syscall_ipc'. */
+#define IPCOP_semop 1
+#define IPCOP_semget 2
+#define IPCOP_semctl 3
+#define IPCOP_msgsnd 11
+#define IPCOP_msgrcv 12
+#define IPCOP_msgget 13
+#define IPCOP_msgctl 14
+#define IPCOP_shmat 21
+#define IPCOP_shmdt 22
+#define IPCOP_shmget 23
+#define IPCOP_shmctl 24