getresgid.c 685 B

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