|
|
1.1 root 1: .TH GETPWENT 3 "19 January 1983"
2: .SH NAME
3: getpwent, getpwuid, getpwnam, setpwent, endpwent \- get password file entry
4: .SH SYNOPSIS
5: .nf
6: .B #include <pwd.h>
7: .PP
8: .B struct passwd *getpwent()
9: .PP
10: .B struct passwd *getpwuid(uid)
11: .B int uid;
12: .PP
13: .B struct passwd *getpwnam(name)
14: .B char *name;
15: .PP
16: .B int setpwent()
17: .PP
18: .B int endpwent()
19: .fi
20: .SH DESCRIPTION
21: .I Getpwent,
22: .I getpwuid
23: and
24: .I getpwnam
25: each return a pointer to an object with the
26: following structure
27: containing the broken-out
28: fields of a line in the password file.
29: .RS
30: .PP
31: .nf
32: .so /usr/include/pwd.h
33: .ft R
34: .ad
35: .fi
36: .RE
37: .PP
38: The fields
39: .I pw_quota
40: and
41: .I pw_comment
42: are unused; the others have meanings described in
43: .IR passwd (5).
44: .PP
45: .I Getpwent
46: reads the next
47: line (opening the file if necessary);
48: .I setpwent
49: rewinds the file;
50: .I endpwent
51: closes it.
52: .PP
53: .I Getpwuid
54: and
55: .I getpwnam
56: search from the beginning until a matching
57: .I uid
58: or
59: .I name
60: is found
61: (or until EOF is encountered).
62: .SH FILES
63: /etc/passwd
64: .SH "SEE ALSO"
65: getlogin(3), getgrent(3), passwd(5)
66: .SH DIAGNOSTICS
67: Null pointer
68: (0) returned on EOF or error.
69: .SH BUGS
70: All information
71: is contained in a static area
72: so it must be copied if it is
73: to be saved.
74: .br
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.