geteuid.c 625 B

12345678910111213141516171819202122232425262728293031323334
  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. #if defined(__NR_geteuid32)
  12. # undef __NR_geteuid
  13. # define __NR_geteuid __NR_geteuid32
  14. _syscall0(uid_t, geteuid)
  15. #elif defined(__NR_geteuid)
  16. # define __NR___syscall_geteuid __NR_geteuid
  17. static __inline__ _syscall0(int, __syscall_geteuid)
  18. uid_t geteuid(void)
  19. {
  20. return (__syscall_geteuid());
  21. }
  22. #else
  23. uid_t geteuid(void)
  24. {
  25. return (getuid());
  26. }
  27. #endif
  28. libc_hidden_def(geteuid)