getresgid.c 715 B

123456789101112131415161718192021222324252627282930
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * getresgid() for uClibc
  4. *
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
  6. *
  7. * GNU Library General Public License (LGPL) version 2 or later.
  8. */
  9. #include "syscalls.h"
  10. #ifdef __NR_getresgid
  11. #define __NR___syscall_getresgid __NR_getresgid
  12. static inline _syscall3(int, __syscall_getresgid, __kernel_gid_t *, egid,
  13. __kernel_gid_t *, rgid, __kernel_gid_t *, sgid);
  14. int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid)
  15. {
  16. int result;
  17. __kernel_gid_t k_rgid, k_egid, k_sgid;
  18. result = __syscall_getresgid(&k_rgid, &k_egid, &k_sgid);
  19. if (result == 0) {
  20. *rgid = (gid_t) k_rgid;
  21. *egid = (gid_t) k_egid;
  22. *sgid = (gid_t) k_sgid;
  23. }
  24. return result;
  25. }
  26. #endif