1
0

grp.h 858 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _GRP_H
  2. #define _GRP_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #define __NEED_size_t
  8. #define __NEED_gid_t
  9. #include <bits/alltypes.h>
  10. struct group
  11. {
  12. char *gr_name;
  13. char *gr_passwd;
  14. gid_t gr_gid;
  15. char **gr_mem;
  16. };
  17. struct group *getgrgid(gid_t);
  18. struct group *getgrnam(const char *);
  19. int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
  20. int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
  21. struct group *getgrent(void);
  22. void endgrent(void);
  23. void setgrent(void);
  24. #ifdef _GNU_SOURCE
  25. struct group *fgetgrent(FILE *stream);
  26. #endif
  27. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  28. int getgrouplist(const char *, gid_t, gid_t *, int *);
  29. int setgroups(size_t, const gid_t *);
  30. int initgroups(const char *, gid_t);
  31. #endif
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif