grp.h 949 B

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