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