about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/i386/getuid.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-02-22 00:00:19 +0000
committerUlrich Drepper <drepper@redhat.com>2003-02-22 00:00:19 +0000
commit1c848253fce6eadd1f9227dab74b032c049226fb (patch)
tree3cf10ab8d0d3c55aab006468c9b2cc1bf6824912 /sysdeps/unix/sysv/linux/i386/getuid.c
parente814f74891ae248ee9d1a8d3caba9133c540e591 (diff)
downloadglibc-1c848253fce6eadd1f9227dab74b032c049226fb.tar.gz
glibc-1c848253fce6eadd1f9227dab74b032c049226fb.tar.xz
glibc-1c848253fce6eadd1f9227dab74b032c049226fb.zip
Update.
2003-02-21  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/getuid.c: Use INTERNAL_SYSCALL and do
	not chechk for errors (unless testing for 32bit variant).
	* sysdeps/unix/sysv/linux/i386/getgid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/geteuid.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/getegid.c: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/getuid.c')
-rw-r--r--sysdeps/unix/sysv/linux/i386/getuid.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/getuid.c b/sysdeps/unix/sysv/linux/i386/getuid.c
index 4bd81801c1..044ce5d5a0 100644
--- a/sysdeps/unix/sysv/linux/i386/getuid.c
+++ b/sysdeps/unix/sysv/linux/i386/getuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 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
@@ -34,32 +34,34 @@ extern int __syscall_getuid32 (void);
    -1 if libc does not know yet whether kernel has 32bit uids or not.
    0 if it does have them.
    1 if it does not have them.  */
-int __libc_missing_32bit_uids = -1;
+int __libc_missing_32bit_uids attribute_hidden = -1;
 # endif
 #endif /* __NR_getuid32 */
 
 uid_t
 __getuid (void)
 {
+  INTERNAL_SYSCALL_DECL (err);
 #if __ASSUME_32BITUIDS > 0
-  return INLINE_SYSCALL (getuid32, 0);
+  /* No error checking.  */
+  return INTERNAL_SYSCALL (getuid32, err, 0);
 #else
 # ifdef __NR_getuid32
   if (__libc_missing_32bit_uids <= 0)
     {
       int result;
-      int saved_errno = errno;
 
-      result = INLINE_SYSCALL (getuid32, 0);
-      if (result == 0 || errno != ENOSYS)
+      result = INTERNAL_SYSCALL (getuid32, err, 0);
+      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
+	  || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
 	return result;
 
-      __set_errno (saved_errno);
       __libc_missing_32bit_uids = 1;
     }
 # endif /* __NR_getuid32 */
 
-  return INLINE_SYSCALL (getuid, 0);
+  /* No error checking.  */
+  return INTERNAL_SYSCALL (getuid, err, 0);
 #endif
 }