diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-11-12 01:15:06 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-11-12 01:15:06 +0000 |
commit | 85bd63313720ed5e7f10427ec5f0d2f59ee23614 (patch) | |
tree | c370d07825bc9f517c39de279a4b92650ad4c836 /sysdeps/unix/sysv/linux/i386 | |
parent | 29311370cd23623cc227a67c54ae3bdd0f7d7058 (diff) | |
download | glibc-85bd63313720ed5e7f10427ec5f0d2f59ee23614.zip glibc-85bd63313720ed5e7f10427ec5f0d2f59ee23614.tar.gz glibc-85bd63313720ed5e7f10427ec5f0d2f59ee23614.tar.bz2 |
Remove sys/syscall.h, sys/types.h, linux/posix_types.h, sysdep.h and pthread-functions.h includes. Include setxid.h. Use INLINE_SETXID_SYSCALL macro instead of INLINE_SYSCALL, kill the HAVE_PTR__NPTL_SETXID guarded snippets.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setegid.c | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/seteuid.c | 19 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setgid.c | 28 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setregid.c | 25 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setresgid.c | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setresuid.c | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setreuid.c | 25 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setuid.c | 24 |
8 files changed, 29 insertions, 163 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setegid.c b/sysdeps/unix/sysv/linux/i386/setegid.c index b8682e3..b4bf33f 100644 --- a/sysdeps/unix/sysv/linux/i386/setegid.c +++ b/sysdeps/unix/sysv/linux/i386/setegid.c @@ -18,11 +18,8 @@ #include <errno.h> #include <unistd.h> -#include <sys/types.h> - -#include <sysdep.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setresgid @@ -42,7 +39,7 @@ setegid (gid) } #if __ASSUME_32BITUIDS > 0 - result = INLINE_SYSCALL (setresgid32, 3, -1, gid, -1); + result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1); #else /* First try the syscall. */ # ifdef __NR_setresgid @@ -59,18 +56,6 @@ setegid (gid) result = __setregid (-1, gid); #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setresgid32; - cmd.id[0] = -1; - cmd.id[1] = gid; - cmd.id[2] = -1; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } libc_hidden_def (setegid) diff --git a/sysdeps/unix/sysv/linux/i386/seteuid.c b/sysdeps/unix/sysv/linux/i386/seteuid.c index 0abdac8..c139684 100644 --- a/sysdeps/unix/sysv/linux/i386/seteuid.c +++ b/sysdeps/unix/sysv/linux/i386/seteuid.c @@ -17,12 +17,9 @@ 02111-1307 USA. */ #include <errno.h> -#include <sys/types.h> #include <unistd.h> - -#include <sysdep.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setresuid @@ -41,7 +38,7 @@ seteuid (uid_t uid) } #if __ASSUME_32BITUIDS > 0 - result = INLINE_SYSCALL (setresuid32, 3, -1, uid, -1); + result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1); #else /* First try the syscall. */ # ifdef __NR_setresuid @@ -58,18 +55,6 @@ seteuid (uid_t uid) result = __setreuid (-1, uid); #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setresuid32; - cmd.id[0] = -1; - cmd.id[1] = uid; - cmd.id[2] = -1; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } libc_hidden_def (seteuid) diff --git a/sysdeps/unix/sysv/linux/i386/setgid.c b/sysdeps/unix/sysv/linux/i386/setgid.c index 17bfc3e..19b1e9f 100644 --- a/sysdeps/unix/sysv/linux/i386/setgid.c +++ b/sysdeps/unix/sysv/linux/i386/setgid.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1998, 2000, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000, 2003, 2004 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 @@ -19,15 +18,8 @@ #include <errno.h> #include <unistd.h> -#include <sys/types.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <linux/posix_types.h> - +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setgid32 @@ -44,14 +36,14 @@ __setgid (gid_t gid) int result; #if __ASSUME_32BITUIDS > 0 - result = INLINE_SYSCALL (setgid32, 1, gid); + result = INLINE_SETXID_SYSCALL (setgid32, 1, gid); #else # ifdef __NR_setgid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setgid32, 1, gid); + result = INLINE_SETXID_SYSCALL (setgid32, 1, gid); if (result == 0) goto out; @@ -70,22 +62,12 @@ __setgid (gid_t gid) return -1; } - result = INLINE_SYSCALL (setgid, 1, gid); + result = INLINE_SETXID_SYSCALL (setgid, 1, gid); # ifdef __NR_setgid32 out: # endif #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setgid32; - cmd.id[0] = gid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } #ifndef __setgid diff --git a/sysdeps/unix/sysv/linux/i386/setregid.c b/sysdeps/unix/sysv/linux/i386/setregid.c index f883497..be7870d 100644 --- a/sysdeps/unix/sysv/linux/i386/setregid.c +++ b/sysdeps/unix/sysv/linux/i386/setregid.c @@ -17,15 +17,9 @@ 02111-1307 USA. */ #include <errno.h> -#include <sys/types.h> #include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <linux/posix_types.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setregid32 @@ -42,14 +36,14 @@ __setregid (gid_t rgid, gid_t egid) int result; #if __ASSUME_32BITUIDS > 0 - result = INLINE_SYSCALL (setregid32, 2, rgid, egid); + result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid); #else # ifdef __NR_setregid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setregid32, 2, rgid, egid); + result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid); if (result == 0) goto out; @@ -67,23 +61,12 @@ __setregid (gid_t rgid, gid_t egid) return -1; } - result = INLINE_SYSCALL (setregid, 2, rgid, egid); + result = INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid); # ifdef __NR_setregid32 out: # endif #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setregid32; - cmd.id[0] = rgid; - cmd.id[1] = egid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } #ifndef __setregid diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c index 614e2c2..c8b17ee 100644 --- a/sysdeps/unix/sysv/linux/i386/setresgid.c +++ b/sysdeps/unix/sysv/linux/i386/setresgid.c @@ -18,14 +18,8 @@ #include <errno.h> #include <unistd.h> -#include <sys/types.h> - -#include <linux/posix_types.h> - -#include <sysdep.h> -#include <sys/syscall.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #if defined __NR_setresgid || defined __NR_setresgid32 @@ -44,14 +38,14 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid) int result; # if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid - result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid); + result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid); # else # ifdef __NR_setresgid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid); + result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid); if (result == 0) goto out; if (errno != ENOSYS) @@ -70,24 +64,12 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid) return -1; } - result = INLINE_SYSCALL (setresgid, 3, rgid, egid, sgid); + result = INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid); # ifdef __NR_setresgid32 out: # endif # endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setresgid32; - cmd.id[0] = rgid; - cmd.id[1] = egid; - cmd.id[2] = sgid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } libc_hidden_def (__setresgid) diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c index 4d735ca..a91896a 100644 --- a/sysdeps/unix/sysv/linux/i386/setresuid.c +++ b/sysdeps/unix/sysv/linux/i386/setresuid.c @@ -18,14 +18,8 @@ #include <errno.h> #include <unistd.h> -#include <sys/types.h> - -#include <linux/posix_types.h> - -#include <sysdep.h> -#include <sys/syscall.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #if defined __NR_setresuid || defined __NR_setresuid32 @@ -44,14 +38,14 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid) int result; # if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid - result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid); + result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid); # else # ifdef __NR_setresuid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid); + result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid); if (result == 0) goto out; if (errno != ENOSYS) @@ -70,24 +64,12 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid) return -1; } - result = INLINE_SYSCALL (setresuid, 3, ruid, euid, suid); + result = INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid); # ifdef __NR_setresuid32 out: # endif # endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setresuid32; - cmd.id[0] = ruid; - cmd.id[1] = euid; - cmd.id[2] = suid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } libc_hidden_def (__setresuid) diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c index 1e1bfcf..55dae1e 100644 --- a/sysdeps/unix/sysv/linux/i386/setreuid.c +++ b/sysdeps/unix/sysv/linux/i386/setreuid.c @@ -17,15 +17,9 @@ 02111-1307 USA. */ #include <errno.h> -#include <sys/types.h> #include <unistd.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <linux/posix_types.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setreuid32 @@ -42,14 +36,14 @@ __setreuid (uid_t ruid, uid_t euid) int result; #if __ASSUME_32BITUIDS > 0 - result = INLINE_SYSCALL (setreuid32, 2, ruid, euid); + result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid); #else # ifdef __NR_setreuid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setreuid32, 2, ruid, euid); + result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid); if (result == 0) goto out; @@ -67,23 +61,12 @@ __setreuid (uid_t ruid, uid_t euid) return -1; } - result = INLINE_SYSCALL (setreuid, 2, ruid, euid); + result = INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid); # ifdef __NR_setreuid32 out: # endif #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setreuid32; - cmd.id[0] = ruid; - cmd.id[1] = euid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } #ifndef __setreuid diff --git a/sysdeps/unix/sysv/linux/i386/setuid.c b/sysdeps/unix/sysv/linux/i386/setuid.c index 0d948fb..9ebf762 100644 --- a/sysdeps/unix/sysv/linux/i386/setuid.c +++ b/sysdeps/unix/sysv/linux/i386/setuid.c @@ -18,14 +18,8 @@ #include <errno.h> #include <unistd.h> -#include <sys/types.h> - -#include <sysdep.h> -#include <sys/syscall.h> - -#include <linux/posix_types.h> +#include <setxid.h> #include "kernel-features.h" -#include <pthread-functions.h> #ifdef __NR_setuid32 @@ -42,14 +36,14 @@ __setuid (uid_t uid) int result; #if __ASSUME_32BITUIDS > 0 && defined __NR_setuid32 - result = INLINE_SYSCALL (setuid32, 1, uid); + result = INLINE_SETXID_SYSCALL (setuid32, 1, uid); #else # ifdef __NR_setuid32 if (__libc_missing_32bit_uids <= 0) { int saved_errno = errno; - result = INLINE_SYSCALL (setuid32, 1, uid); + result = INLINE_SETXID_SYSCALL (setuid32, 1, uid); if (result == 0) goto out; if (errno != ENOSYS) @@ -67,22 +61,12 @@ __setuid (uid_t uid) return -1; } - result = INLINE_SYSCALL (setuid, 1, uid); + result = INLINE_SETXID_SYSCALL (setuid, 1, uid); # ifdef __NR_setuid32 out: # endif #endif -#if defined HAVE_PTR__NPTL_SETXID && !defined SINGLE_THREAD - if (result == 0 && __libc_pthread_functions.ptr__nptl_setxid != NULL) - { - struct xid_command cmd; - cmd.syscall_no = __NR_setuid32; - cmd.id[0] = uid; - __libc_pthread_functions.ptr__nptl_setxid (&cmd); - } -#endif - return result; } #ifndef __setuid |