2002-08-13 Jakub Jelinek <jakub@redhat.com>
authorRoland McGrath <roland@gnu.org>
Tue, 13 Aug 2002 00:22:49 +0000 (00:22 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 13 Aug 2002 00:22:49 +0000 (00:22 +0000)
* include/unistd.h (seteuid, setegid): Add libc_hidden_proto.
* sysdeps/generic/seteuid.c (seteuid): Add libc_hidden_def.
* sysdeps/generic/setegid.c (setegid): Likewise.
* sysdeps/mach/hurd/seteuid.c (seteuid): Likewise.
* sysdeps/mach/hurd/setegid.c (setegid): Likewise.
* sysdeps/unix/bsd/seteuid.c (seteuid): Likewise.
* sysdeps/unix/bsd/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/aix/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/aix/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise.
* sysdeps/unix/sysv/linux/setegid.c (setegid): Likewise.
* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise.
Remove fallback if __ASSUME_SETRESUID_SYSCALL.

14 files changed:
sysdeps/generic/setegid.c
sysdeps/generic/seteuid.c
sysdeps/mach/hurd/setegid.c
sysdeps/mach/hurd/seteuid.c
sysdeps/unix/bsd/setegid.c
sysdeps/unix/bsd/seteuid.c
sysdeps/unix/sysv/aix/setegid.c
sysdeps/unix/sysv/aix/seteuid.c
sysdeps/unix/sysv/linux/i386/setegid.c
sysdeps/unix/sysv/linux/i386/seteuid.c
sysdeps/unix/sysv/linux/setegid.c
sysdeps/unix/sysv/linux/seteuid.c
sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c
sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c

index f2f2529..5b5e2cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1994,1995,1996,1997,2002 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,7 +27,6 @@ setegid (gid)
   __set_errno (ENOSYS);
   return -1;
 }
-
-
+libc_hidden_def (setegid)
 stub_warning (setegid)
 #include <stub-tag.h>
index dbfa15b..689000f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 2002 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,7 +27,6 @@ seteuid (uid)
   __set_errno (ENOSYS);
   return -1;
 }
-
-
+libc_hidden_def (seteuid)
 stub_warning (seteuid)
 #include <stub-tag.h>
index 10a93e5..c84b8e2 100644 (file)
@@ -66,3 +66,4 @@ setegid (gid)
   __mach_port_deallocate (__mach_task_self (), newauth);
   return err;
 }
+libc_hidden_def (setegid)
index 3fd0b98..8a6effe 100644 (file)
@@ -66,3 +66,4 @@ seteuid (uid)
   __mach_port_deallocate (__mach_task_self (), newauth);
   return err;
 }
+libc_hidden_def (seteuid)
index f6213aa..cc9f939 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2002 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
@@ -32,3 +32,4 @@ setegid (gid)
 
   return __setregid (-1, gid);
 }
+libc_hidden_def (setegid)
index f46935c..056b658 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2002 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
@@ -32,3 +32,4 @@ seteuid (uid)
 
   return __setreuid (-1, uid);
 }
+libc_hidden_def (seteuid)
index 75e96e3..75123ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002 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
@@ -29,3 +29,4 @@ __setegid (gid_t gid)
   return setgidx (ID_EFFECTIVE, gid);
 }
 strong_alias (__setegid, setegid)
+libc_hidden_def (setegid)
index 17738e7..6ea7e7b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002 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
@@ -29,3 +29,4 @@ __seteuid (uid_t uid)
   return setuidx (ID_EFFECTIVE, uid);
 }
 strong_alias (__seteuid, seteuid)
+libc_hidden_def (seteuid)
index 880087c..8d7618c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 96, 97, 98, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 96, 97, 98, 2000, 2002 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
@@ -25,3 +25,4 @@ setegid (gid)
 {
   return __setregid (-1, gid);
 }
+libc_hidden_def (setegid)
index bf38072..ba0b86d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002 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
@@ -33,7 +33,11 @@ seteuid (uid_t uid)
   /* First try the syscall.  */
 #ifdef __NR_setresuid
   result = __setresuid (-1, uid, -1);
+#if __ASSUME_SETRESUID_SYSCALL > 0
+  if (0)
+#else
   if (result == -1 && errno == ENOSYS)
+#endif
     /* No system call available.  Use emulation.  This may not work
        since `setreuid' also sets the saved user ID when UID is not
        equal to the real user ID, making it impossible to switch back.  */
@@ -42,3 +46,4 @@ seteuid (uid_t uid)
 
   return result;
 }
+libc_hidden_def (seteuid)
index 6b9d34f..c4b114e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2002 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
@@ -46,6 +46,7 @@ setegid (gid_t gid)
 
   return result;
 }
+libc_hidden_def (setegid)
 #else
 # include <sysdeps/unix/bsd/setegid.c>
 #endif
index ba064ee..ab9819b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2002 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
@@ -50,6 +50,7 @@ seteuid (uid_t uid)
 
   return result;
 }
+libc_hidden_def (seteuid)
 #else
 # include <sysdeps/unix/bsd/seteuid.c>
 #endif
index 14ec137..11643f6 100644 (file)
@@ -46,6 +46,7 @@ setegid (gid_t gid)
 
   return result;
 }
+libc_hidden_def (setegid)
 #else
 # include <sysdeps/unix/bsd/setegid.c>
 #endif
index d42a70d..34638ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2002 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
@@ -50,6 +50,7 @@ seteuid (uid_t uid)
 
   return result;
 }
+libc_hidden_def (seteuid)
 #else
 # include <sysdeps/unix/bsd/seteuid.c>
 #endif