grp.h 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. struct group *getgrent(void);
  24. void endgrent(void);
  25. void setgrent(void);
  26. #ifdef _GNU_SOURCE
  27. struct group *fgetgrent(FILE *stream);
  28. int putgrent(const struct group *, FILE *);
  29. #endif
  30. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  31. int getgrouplist(const char *, gid_t, gid_t *, int *);
  32. int setgroups(size_t, const gid_t *);
  33. int initgroups(const char *, gid_t);
  34. #endif
  35. #ifdef __cplusplus
  36. }
  37. #endif
  38. #endif