diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 |
commit | 675d62ac876ffe4719580d45b8c9469934ccf6d7 (patch) | |
tree | e666bd4a1d816842c070e4928715d66b82655fc2 /libc/sysdeps/linux/common/seteuid.c | |
parent | fd666fca933f7241ff75d06ff36c9282fd443335 (diff) | |
download | uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.bz2 uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.xz |
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/common/seteuid.c')
-rw-r--r-- | libc/sysdeps/linux/common/seteuid.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c index f5ed35743..e5ed576ff 100644 --- a/libc/sysdeps/linux/common/seteuid.c +++ b/libc/sysdeps/linux/common/seteuid.c @@ -1,7 +1,9 @@ -#define setresuid __setresuid -#define setreuid __setreuid +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ -#define _GNU_SOURCE #include <unistd.h> #include <stdio.h> #include <errno.h> @@ -9,7 +11,14 @@ #include <sys/types.h> #include <sys/syscall.h> -int attribute_hidden __seteuid(uid_t uid) +libc_hidden_proto(seteuid) + +#if defined __NR_setresuid || defined __NR_setresuid32 +libc_hidden_proto(setresuid) +#endif +libc_hidden_proto(setreuid) + +int seteuid(uid_t uid) { int result; @@ -19,7 +28,7 @@ int attribute_hidden __seteuid(uid_t uid) return -1; } -#ifdef __NR_setresuid +#if defined __NR_setresuid || defined __NR_setresuid32 result = setresuid(-1, uid, -1); if (result == -1 && errno == ENOSYS) /* Will also set the saved user ID if euid != uid, @@ -29,4 +38,4 @@ int attribute_hidden __seteuid(uid_t uid) return result; } -strong_alias(__seteuid,seteuid) +libc_hidden_def(seteuid) |