geteuid.c 679 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * geteuid() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <sys/syscall.h>
  10. #include <unistd.h>
  11. libc_hidden_proto(geteuid)
  12. #if defined(__NR_geteuid32)
  13. # undef __NR_geteuid
  14. # define __NR_geteuid __NR_geteuid32
  15. _syscall0(uid_t, geteuid)
  16. #elif defined(__NR_geteuid)
  17. # define __NR___syscall_geteuid __NR_geteuid
  18. static __inline__ _syscall0(int, __syscall_geteuid);
  19. uid_t geteuid(void)
  20. {
  21. return (__syscall_geteuid());
  22. }
  23. #else
  24. libc_hidden_proto(getuid)
  25. uid_t geteuid(void)
  26. {
  27. return (getuid());
  28. }
  29. #endif
  30. libc_hidden_def(geteuid)