about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/setreuid.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-08 22:37:53 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-08 22:37:53 +0000
commiteae59a5681a6725d38f210acbd9ca82ba170c79c (patch)
treeeb51c3f773b4141ade7c3c71d2f8cfce33195c26 /sysdeps/unix/sysv/linux/i386/setreuid.c
parentf0da6a7d5a4fbfc2b114b1fc17f4368e4fee7f8d (diff)
downloadglibc-eae59a5681a6725d38f210acbd9ca82ba170c79c.tar.gz
glibc-eae59a5681a6725d38f210acbd9ca82ba170c79c.tar.xz
glibc-eae59a5681a6725d38f210acbd9ca82ba170c79c.zip
Update.
	* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Use setresuid32
	syscall directly if possible.  If __ASSUME_SETRESUID_SYSCALL is
	defined drop compatibility code.
	* sysdeps/unix/sysv/linux/setegid.c (setegid): Use setresgid32
	syscall directly if possible.  If __ASSUME_SETRESUID_SYSCALL is
	defined drop compatibility code.
	* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Use
	setresuid32 syscall directly if possible.
	* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Use
	setresgid32 syscall directly if possible.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/setreuid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/setreuid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setreuid.c b/sysdeps/unix/sysv/linux/i386/setreuid.c
index 04496c8404..0867170e49 100644
--- a/sysdeps/unix/sysv/linux/i386/setreuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setreuid.c
@@ -44,7 +44,7 @@ __setreuid (uid_t ruid, uid_t euid)
 #if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (setresuid32, 3, ruid, euid, -1);
 #else
-# ifdef __NR_setreuid32
+# ifdef __NR_setresuid32
   if (__libc_missing_32bit_uids <= 0)
     {
       int result;
@@ -66,7 +66,13 @@ __setreuid (uid_t ruid, uid_t euid)
       return -1;
     }
 
-  return INLINE_SYSCALL (setresuid, 3, ruid, euid, -1);
+# ifdef __NR_setresuid
+  itn result = INLINE_SYSCALL (setresuid, 3, ruid, euid, -1);
+# endif
+  if (result == -1 && errno == ENOSYS)
+    result = INLINE_SYSCALL (setreuid, 2, ruid, euid);
+
+  return result;
 #endif
 }
 weak_alias (__setreuid, setreuid)