pwd.h revision 1.1.2.1 1 1.1.2.1 christos /* $NetBSD: pwd.h,v 1.1.2.1 2008/11/08 21:49:34 christos Exp $ */
2 1.1.2.1 christos
3 1.1.2.1 christos #ifndef _COMPAT_PWD_H_
4 1.1.2.1 christos #define _COMPAT_PWD_H_
5 1.1.2.1 christos
6 1.1.2.1 christos #include <sys/cdefs.h>
7 1.1.2.1 christos #include <sys/featuretest.h>
8 1.1.2.1 christos #include <sys/types.h>
9 1.1.2.1 christos
10 1.1.2.1 christos struct passwd;
11 1.1.2.1 christos struct passwd50 {
12 1.1.2.1 christos __aconst char *pw_name; /* user name */
13 1.1.2.1 christos __aconst char *pw_passwd; /* encrypted password */
14 1.1.2.1 christos uid_t pw_uid; /* user uid */
15 1.1.2.1 christos gid_t pw_gid; /* user gid */
16 1.1.2.1 christos int32_t pw_change; /* password change time */
17 1.1.2.1 christos __aconst char *pw_class; /* user login class */
18 1.1.2.1 christos __aconst char *pw_gecos; /* general information */
19 1.1.2.1 christos __aconst char *pw_dir; /* home directory */
20 1.1.2.1 christos __aconst char *pw_shell; /* default shell */
21 1.1.2.1 christos int32_t pw_expire; /* account expiration */
22 1.1.2.1 christos };
23 1.1.2.1 christos
24 1.1.2.1 christos __BEGIN_DECLS
25 1.1.2.1 christos struct passwd50 *getpwuid(uid_t);
26 1.1.2.1 christos struct passwd50 *getpwnam(const char *);
27 1.1.2.1 christos #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
28 1.1.2.1 christos defined(_REENTRANT) || defined(_NETBSD_SOURCE)
29 1.1.2.1 christos int getpwnam_r(const char *, struct passwd50 *, char *, size_t,
30 1.1.2.1 christos struct passwd50 **);
31 1.1.2.1 christos int getpwuid_r(uid_t, struct passwd50 *, char *, size_t,
32 1.1.2.1 christos struct passwd50 **);
33 1.1.2.1 christos #endif
34 1.1.2.1 christos #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
35 1.1.2.1 christos struct passwd50 *getpwent(void);
36 1.1.2.1 christos #endif
37 1.1.2.1 christos #if defined(_NETBSD_SOURCE)
38 1.1.2.1 christos int pw_scan(char *, struct passwd50 *, int *);
39 1.1.2.1 christos int getpwent_r(struct passwd50 *, char *, size_t, struct passwd50 **);
40 1.1.2.1 christos #endif
41 1.1.2.1 christos #if defined(_NETBSD_SOURCE)
42 1.1.2.1 christos int pwcache_userdb(int (*)(int), void (*)(void),
43 1.1.2.1 christos struct passwd50 * (*)(const char *), struct passwd50 * (*)(uid_t));
44 1.1.2.1 christos #endif
45 1.1.2.1 christos
46 1.1.2.1 christos struct passwd *__getpwuid50(uid_t);
47 1.1.2.1 christos struct passwd *__getpwnam50(const char *);
48 1.1.2.1 christos #if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
49 1.1.2.1 christos defined(_REENTRANT) || defined(_NETBSD_SOURCE)
50 1.1.2.1 christos int __getpwnam_r50(const char *, struct passwd *, char *, size_t,
51 1.1.2.1 christos struct passwd **);
52 1.1.2.1 christos int __getpwuid_r50(uid_t, struct passwd *, char *, size_t,
53 1.1.2.1 christos struct passwd **);
54 1.1.2.1 christos #endif
55 1.1.2.1 christos #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
56 1.1.2.1 christos struct passwd *__getpwent50(void);
57 1.1.2.1 christos #endif
58 1.1.2.1 christos #if defined(_NETBSD_SOURCE)
59 1.1.2.1 christos int __pw_scan50(char *, struct passwd *, int *);
60 1.1.2.1 christos int __getpwent_r50(struct passwd *, char *, size_t, struct passwd **);
61 1.1.2.1 christos #endif
62 1.1.2.1 christos int setpassent(int);
63 1.1.2.1 christos #if defined(_NETBSD_SOURCE)
64 1.1.2.1 christos int __pwcache_userdb50(int (*)(int), void (*)(void),
65 1.1.2.1 christos struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
66 1.1.2.1 christos #endif
67 1.1.2.1 christos __END_DECLS
68 1.1.2.1 christos
69 1.1.2.1 christos #endif /* !_PWD_H_ */
70