pwd.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __PWD_H
  2. #define __PWD_H
  3. #include <sys/types.h>
  4. #include <features.h>
  5. #include <stdio.h>
  6. /* The passwd structure. */
  7. struct passwd
  8. {
  9. char *pw_name; /* Username. */
  10. char *pw_passwd; /* Password. */
  11. uid_t pw_uid; /* User ID. */
  12. gid_t pw_gid; /* Group ID. */
  13. char *pw_gecos; /* Real name. */
  14. char *pw_dir; /* Home directory. */
  15. char *pw_shell; /* Shell program. */
  16. };
  17. extern void setpwent __P ((void));
  18. extern void endpwent __P ((void));
  19. extern struct passwd * getpwent __P ((void));
  20. extern int putpwent __P ((const struct passwd * __p, FILE * __f));
  21. extern int getpw __P ((uid_t uid, char *buf));
  22. extern struct passwd * fgetpwent __P ((FILE * file));
  23. extern struct passwd * getpwuid __P ((const uid_t));
  24. extern struct passwd * getpwnam __P ((const char *));
  25. extern int getpwent_r __P ((struct passwd *__restrict __resultbuf,
  26. char *__restrict __buffer, size_t __buflen,
  27. struct passwd **__restrict __result));
  28. extern int getpwuid_r __P ((uid_t __uid,
  29. struct passwd *__restrict __resultbuf,
  30. char *__restrict __buffer, size_t __buflen,
  31. struct passwd **__restrict __result));
  32. extern int getpwnam_r __P ((const char *__restrict __name,
  33. struct passwd *__restrict __resultbuf,
  34. char *__restrict __buffer, size_t __buflen,
  35. struct passwd **__restrict __result));
  36. extern int fgetpwent_r __P ((FILE *__restrict __stream,
  37. struct passwd *__restrict __resultbuf,
  38. char *__restrict __buffer, size_t __buflen,
  39. struct passwd **__restrict __result));
  40. #ifdef _LIBC
  41. /* This is used internally to uClibc */
  42. extern int __getpwent_r(struct passwd * passwd, char * line_buff,
  43. size_t buflen, int pwd_fd);
  44. #endif
  45. #endif /* pwd.h */