2
0

grp.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifdef _GNU_SOURCE
  10. #define __NEED_FILE
  11. #endif
  12. #include <bits/alltypes.h>
  13. struct group {
  14. char *gr_name;
  15. char *gr_passwd;
  16. gid_t gr_gid;
  17. char **gr_mem;
  18. };
  19. struct group *getgrgid(gid_t);
  20. struct group *getgrnam(const char *);
  21. int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
  22. int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
  23. #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  24. struct group *getgrent(void);
  25. void endgrent(void);
  26. void setgrent(void);
  27. #endif
  28. #ifdef _GNU_SOURCE
  29. struct group *fgetgrent(FILE *);
  30. int putgrent(const struct group *, FILE *);
  31. #endif
  32. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  33. int getgrouplist(const char *, gid_t, gid_t *, int *);
  34. int setgroups(size_t, const gid_t *);
  35. int initgroups(const char *, gid_t);
  36. #endif
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif