summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/semctl.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/semctl.c
parenta386f1cc229e7de02740bef18bdd5d272d1e7537 (diff)
downloadglibc-21708942c9b115a91dc03318a5f9e14328c5a71e.tar.gz
Remove pre-2.4 Linux kernel support.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/semctl.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/semctl.c86
1 files changed, 1 insertions, 85 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/semctl.c b/sysdeps/unix/sysv/linux/i386/semctl.c
index 0c4ad89f89..5e2d948059 100644
--- a/sysdeps/unix/sysv/linux/i386/semctl.c
+++ b/sysdeps/unix/sysv/linux/i386/semctl.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,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 +25,6 @@
#include <string.h>
#include <sys/syscall.h>
-#include <kernel-features.h>
#include <shlib-compat.h>
struct __old_semid_ds
@@ -54,14 +52,6 @@ union semun
#include <bp-checks.h>
#include <bp-semctl.h> /* definition of CHECK_SEMCTL needs union semum */
-#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
-
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -103,82 +93,8 @@ __new_semctl (int semid, int semnum, int cmd, ...)
va_end (ap);
-#if __ASSUME_32BITUIDS > 0
return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-#else
- switch (cmd) {
- case SEM_STAT:
- case IPC_STAT:
- case IPC_SET:
- break;
- default:
- return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- }
-
- {
- int result;
- struct __old_semid_ds old;
- struct semid_ds *buf;
-
-#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)
- {
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
- CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
- return result;
- }
- }
-#endif
-
- buf = arg.buf;
- arg.__old_buf = &old;
- if (cmd == IPC_SET)
- {
- old.sem_perm.uid = buf->sem_perm.uid;
- old.sem_perm.gid = buf->sem_perm.gid;
- old.sem_perm.mode = buf->sem_perm.mode;
- if (old.sem_perm.uid != buf->sem_perm.uid ||
- old.sem_perm.gid != buf->sem_perm.gid)
- {
- __set_errno (EINVAL);
- return -1;
- }
- }
- result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
- CHECK_SEMCTL (&arg, semid, cmd));
- if (result != -1 && cmd != IPC_SET)
- {
- memset(buf, 0, sizeof(*buf));
- buf->sem_perm.__key = old.sem_perm.__key;
- buf->sem_perm.uid = old.sem_perm.uid;
- buf->sem_perm.gid = old.sem_perm.gid;
- buf->sem_perm.cuid = old.sem_perm.cuid;
- buf->sem_perm.cgid = old.sem_perm.cgid;
- buf->sem_perm.mode = old.sem_perm.mode;
- buf->sem_perm.__seq = old.sem_perm.__seq;
- buf->sem_otime = old.sem_otime;
- buf->sem_ctime = old.sem_ctime;
- buf->sem_nsems = old.sem_nsems;
- }
- return result;
- }
-#endif
}
versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);