1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Remove pre-2.4 Linux kernel support.

This commit is contained in:
Joseph Myers
2012-05-25 19:19:30 +00:00
parent a386f1cc22
commit 21708942c9
39 changed files with 240 additions and 1426 deletions

View File

@@ -1,5 +1,4 @@
/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
Free Software Foundation, Inc.
/* Copyright (C) 1997-2012 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
@@ -27,16 +26,6 @@
#include <setxid.h>
#include <linux/posix_types.h>
#include <kernel-features.h>
#ifdef __NR_setgroups32
# 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 /* __NR_setgroups32 */
/* Set the group set for the current user to GROUPS (N of them). For
Linux we must convert the array of groups into the format that the
@@ -44,47 +33,6 @@ extern int __libc_missing_32bit_uids;
int
setgroups (size_t n, const gid_t *groups)
{
#if __ASSUME_32BITUIDS > 0
return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
#else
if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
{
__set_errno (EINVAL);
return -1;
}
else
{
size_t i;
__kernel_gid_t kernel_groups[n];
# ifdef __NR_setgroups32
if (__libc_missing_32bit_uids <= 0)
{
int result;
int saved_errno = errno;
result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
CHECK_N (groups, n));
if (result == 0 || errno != ENOSYS)
return result;
__set_errno (saved_errno);
__libc_missing_32bit_uids = 1;
}
# endif /* __NR_setgroups32 */
for (i = 0; i < n; i++)
{
kernel_groups[i] = (__ptrvalue (groups))[i];
if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i]))
{
__set_errno (EINVAL);
return -1;
}
}
return INLINE_SETXID_SYSCALL (setgroups, 2, n,
CHECK_N (kernel_groups, n));
}
#endif
}
libc_hidden_def (setgroups)