1 #ifndef _PWD_H 2 #define _PWD_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <features.h> 9 10 #define __NEED_size_t 11 #define __NEED_uid_t 12 #define __NEED_gid_t 13 14 #ifdef _GNU_SOURCE 15 #define __NEED_FILE 16 #endif 17 18 #include <bits/alltypes.h> 19 20 struct passwd { 21 char *pw_name; 22 char *pw_passwd; 23 uid_t pw_uid; 24 gid_t pw_gid; 25 char *pw_gecos; 26 char *pw_dir; 27 char *pw_shell; 28 }; 29 30 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 31 void setpwent (void); 32 void endpwent (void); 33 struct passwd *getpwent (void); 34 #endif 35 36 struct passwd *getpwuid (uid_t); 37 struct passwd *getpwnam (const char *); 38 int getpwuid_r (uid_t, struct passwd *, char *, size_t, struct passwd **); 39 int getpwnam_r (const char *, struct passwd *, char *, size_t, struct passwd **); 40 41 #ifdef _GNU_SOURCE 42 struct passwd *fgetpwent(FILE *); 43 int putpwent(const struct passwd *, FILE *); 44 #endif 45 46 #ifdef __cplusplus 47 } 48 #endif 49 50 #endif 51