xref: /haiku/headers/posix/pwd.h (revision b671e9bbdbd10268a042b4f4cc4317ccd03d105e)
1 #ifndef _PWD_H_
2 #define _PWD_H_
3 /*
4 ** Distributed under the terms of the OpenBeOS License.
5 */
6 
7 #include <sys/types.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 struct passwd {
14 	char	*pw_name;
15 	char	*pw_passwd;
16 	uid_t	pw_uid;
17 	gid_t	pw_gid;
18 	char	*pw_dir;
19 	char	*pw_shell;
20 	char	*pw_gecos;
21 };
22 
23 /* traverse the user password database */
24 extern struct passwd *getpwent(void);
25 extern int getpwent_r(struct passwd* pwbuf, char* buf, size_t buflen,
26 				struct passwd** pwbufp);
27 extern void setpwent(void);
28 extern void endpwent(void);
29 
30 /* search the user password database */
31 extern struct passwd *getpwnam(const char *name);
32 extern int getpwnam_r(const char *name, struct passwd *passwd, char *buffer,
33 				size_t bufferSize, struct passwd **result);
34 extern struct passwd *getpwuid(uid_t uid);
35 extern int getpwuid_r(uid_t uid, struct passwd *passwd, char *buffer,
36 				size_t bufferSize, struct passwd **result);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif	/* _PWD_H_ */
43