1 /* $NetBSD: pwd.h,v 1.2 2009/01/11 02:46:25 christos Exp $ */
7 #include <sys/featuretest.h>
12 __aconst
char *pw_name
; /* user name */
13 __aconst
char *pw_passwd
; /* encrypted password */
14 uid_t pw_uid
; /* user uid */
15 gid_t pw_gid
; /* user gid */
16 int32_t pw_change
; /* password change time */
17 __aconst
char *pw_class
; /* user login class */
18 __aconst
char *pw_gecos
; /* general information */
19 __aconst
char *pw_dir
; /* home directory */
20 __aconst
char *pw_shell
; /* default shell */
21 int32_t pw_expire
; /* account expiration */
26 passwd_to_passwd50(const struct passwd
*p
, struct passwd50
*q
)
28 q
->pw_name
= p
->pw_name
;
29 q
->pw_passwd
= p
->pw_passwd
;
30 q
->pw_uid
= p
->pw_uid
;
31 q
->pw_gid
= p
->pw_gid
;
32 q
->pw_change
= (int32_t)p
->pw_change
;
33 q
->pw_class
= p
->pw_class
;
34 q
->pw_gecos
= p
->pw_gecos
;
35 q
->pw_dir
= p
->pw_dir
;
36 q
->pw_shell
= p
->pw_shell
;
37 q
->pw_expire
= (int32_t)p
->pw_expire
;
41 passwd50_to_passwd(const struct passwd50
*p
, struct passwd
*q
)
43 q
->pw_name
= p
->pw_name
;
44 q
->pw_passwd
= p
->pw_passwd
;
45 q
->pw_uid
= p
->pw_uid
;
46 q
->pw_gid
= p
->pw_gid
;
47 q
->pw_change
= p
->pw_change
;
48 q
->pw_class
= p
->pw_class
;
49 q
->pw_gecos
= p
->pw_gecos
;
50 q
->pw_dir
= p
->pw_dir
;
51 q
->pw_shell
= p
->pw_shell
;
52 q
->pw_expire
= p
->pw_expire
;
55 struct passwd50
*getpwuid(uid_t
);
56 struct passwd50
*getpwnam(const char *);
57 #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
58 defined(_REENTRANT) || defined(_NETBSD_SOURCE)
59 int getpwnam_r(const char *, struct passwd50
*, char *, size_t,
61 int getpwuid_r(uid_t
, struct passwd50
*, char *, size_t,
64 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
65 struct passwd50
*getpwent(void);
67 #if defined(_NETBSD_SOURCE)
68 int pw_scan(char *, struct passwd50
*, int *);
69 int getpwent_r(struct passwd50
*, char *, size_t, struct passwd50
**);
71 #if defined(_NETBSD_SOURCE)
72 int pwcache_userdb(int (*)(int), void (*)(void),
73 struct passwd50
* (*)(const char *), struct passwd50
* (*)(uid_t
));
76 struct passwd
*__getpwuid50(uid_t
);
77 struct passwd
*__getpwnam50(const char *);
78 #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
79 defined(_REENTRANT) || defined(_NETBSD_SOURCE)
80 int __getpwnam_r50(const char *, struct passwd
*, char *, size_t,
82 int __getpwuid_r50(uid_t
, struct passwd
*, char *, size_t,
85 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
86 struct passwd
*__getpwent50(void);
88 #if defined(_NETBSD_SOURCE)
89 int __pw_scan50(char *, struct passwd
*, int *);
90 int __getpwent_r50(struct passwd
*, char *, size_t, struct passwd
**);
93 #if defined(_NETBSD_SOURCE)
94 int __pwcache_userdb50(int (*)(int), void (*)(void),
95 struct passwd
* (*)(const char *), struct passwd
* (*)(uid_t
));
99 #endif /* !_COMPAT_PWD_H_ */