summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/shmctl.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-05-25 19:19:30 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-05-25 19:19:30 +0000
commit21708942c9b115a91dc03318a5f9e14328c5a71e (patch)
treee0b3797820e23ab73ebdab3c34d20943e911669b /sysdeps/unix/sysv/linux/i386/shmctl.c
parenta386f1cc229e7de02740bef18bdd5d272d1e7537 (diff)
downloadglibc-21708942c9b115a91dc03318a5f9e14328c5a71e.tar.gz
glibc-21708942c9b115a91dc03318a5f9e14328c5a71e.tar.xz
glibc-21708942c9b115a91dc03318a5f9e14328c5a71e.zip
Remove pre-2.4 Linux kernel support.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/shmctl.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/shmctl.c100
1 files changed, 1 insertions, 99 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/shmctl.c b/sysdeps/unix/sysv/linux/i386/shmctl.c
index fb38ed79cd..dd2167d9a7 100644
--- a/sysdeps/unix/sysv/linux/i386/shmctl.c
+++ b/sysdeps/unix/sysv/linux/i386/shmctl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -26,7 +26,6 @@
 #include <bits/wordsize.h>
 #include <bp-checks.h>
 
-#include <kernel-features.h>
 #include <shlib-compat.h>
 
 struct __old_shmid_ds
@@ -53,14 +52,6 @@ struct __old_shminfo
   int shmall;
 };
 
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids;
-# endif
-#endif
-
 /* Provide operations to control over shared memory segments.  */
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
 int __old_shmctl (int, int, struct __old_shmid_ds *);
@@ -81,97 +72,8 @@ compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
 int
 __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
 			 shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
-#else
-  switch (cmd) {
-    case SHM_STAT:
-    case IPC_STAT:
-    case IPC_SET:
-# if __WORDSIZE != 32
-    case IPC_INFO:
-# endif
-      break;
-    default:
-      return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-			     shmid, cmd, 0, CHECK_1 (buf));
-  }
-
-  {
-    struct __old_shmid_ds old;
-    int result;
-
-# ifdef __NR_getuid32
-    if (__libc_missing_32bit_uids <= 0)
-      {
-	if (__libc_missing_32bit_uids < 0)
-	  {
-	    int save_errno = errno;
-
-	    /* Test presence of new IPC by testing for getuid32 syscall.  */
-	    result = INLINE_SYSCALL (getuid32, 0);
-	    if (result == -1 && errno == ENOSYS)
-	      __libc_missing_32bit_uids = 1;
-	    else
-	      __libc_missing_32bit_uids = 0;
-	    __set_errno(save_errno);
-	  }
-	if (__libc_missing_32bit_uids <= 0)
-	  return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-				 shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
-      }
-# endif
-
-    if (cmd == IPC_SET)
-      {
-	old.shm_perm.uid = buf->shm_perm.uid;
-	old.shm_perm.gid = buf->shm_perm.gid;
-	old.shm_perm.mode = buf->shm_perm.mode;
-	if (old.shm_perm.uid != buf->shm_perm.uid ||
-	    old.shm_perm.gid != buf->shm_perm.gid)
-	  {
-	    __set_errno (EINVAL);
-	    return -1;
-	  }
-      }
-    result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-			     shmid, cmd, 0, __ptrvalue (&old));
-    if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT))
-      {
-	memset(buf, 0, sizeof(*buf));
-	buf->shm_perm.__key = old.shm_perm.__key;
-	buf->shm_perm.uid = old.shm_perm.uid;
-	buf->shm_perm.gid = old.shm_perm.gid;
-	buf->shm_perm.cuid = old.shm_perm.cuid;
-	buf->shm_perm.cgid = old.shm_perm.cgid;
-	buf->shm_perm.mode = old.shm_perm.mode;
-	buf->shm_perm.__seq = old.shm_perm.__seq;
-	buf->shm_atime = old.shm_atime;
-	buf->shm_dtime = old.shm_dtime;
-	buf->shm_ctime = old.shm_ctime;
-	buf->shm_segsz = old.shm_segsz;
-	buf->shm_nattch = old.shm_nattch;
-	buf->shm_cpid = old.shm_cpid;
-	buf->shm_lpid = old.shm_lpid;
-      }
-# if __WORDSIZE != 32
-    else if (result != -1 && cmd == IPC_INFO)
-      {
-	struct __old_shminfo *oldi = (struct __old_shminfo *)&old;
-	struct shminfo *i = (struct shminfo *)buf;
-
-	memset(i, 0, sizeof(*i));
-	i->shmmax = oldi->shmmax;
-	i->shmmin = oldi->shmmin;
-	i->shmmni = oldi->shmmni;
-	i->shmseg = oldi->shmseg;
-	i->shmall = oldi->shmall;
-      }
-# endif
-    return result;
-  }
-#endif
 }
 
 versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2);