Annotation of 43BSDTahoe/man/man3/getpwent.3, revision 1.1.1.1

1.1       root        1: .\"    @(#)getpwent.3  6.3 (Berkeley) 5/15/86
                      2: .\"
                      3: .TH GETPWENT 3  "May 15, 1986"
                      4: .AT 3
                      5: .SH NAME
                      6: getpwent, getpwuid, getpwnam, setpwent, endpwent, setpwfile \- get password file entry
                      7: .SH SYNOPSIS
                      8: .nf
                      9: .B #include <pwd.h>
                     10: .PP
                     11: .B struct passwd *getpwuid(uid)
                     12: .B int uid;
                     13: .PP
                     14: .B struct passwd *getpwnam(name)
                     15: .B char *name;
                     16: .PP
                     17: .B struct passwd *getpwent()
                     18: .PP
                     19: .B setpwent()
                     20: .PP
                     21: .B endpwent()
                     22: .PP
                     23: .B setpwfile(name)
                     24: .B char *name;
                     25: .fi
                     26: .SH DESCRIPTION
                     27: .I Getpwent,
                     28: .I getpwuid
                     29: and
                     30: .I getpwnam
                     31: each return a pointer to an object with the
                     32: following structure
                     33: containing the broken-out
                     34: fields of a line in the password file.
                     35: .RS
                     36: .PP
                     37: .nf
                     38: .so /usr/include/pwd.h
                     39: .ft R
                     40: .ad
                     41: .fi
                     42: .RE
                     43: .PP
                     44: The fields
                     45: .I pw_quota
                     46: and
                     47: .I pw_comment
                     48: are unused; the others have meanings described in
                     49: .IR passwd (5).
                     50: .PP
                     51: Searching of the password file is done using the \fIndbm\fP
                     52: database access routines.
                     53: .I Setpwent
                     54: opens the database;
                     55: .I endpwent
                     56: closes it.
                     57: .I Getpwuid
                     58: and
                     59: .I getpwnam
                     60: search the database (opening it if necessary) for a matching
                     61: .I uid
                     62: or
                     63: .IR name .
                     64: EOF is returned if there is no entry.
                     65: .PP
                     66: For programs wishing to read the entire database,
                     67: .I getpwent
                     68: reads the next
                     69: line (opening the database if necessary).
                     70: In addition to opening the database,
                     71: .I setpwent
                     72: can be used to make
                     73: .I getpwent
                     74: begin its search from the beginning of the database.
                     75: .PP
                     76: .I Setpwfile
                     77: changes the default password file to
                     78: .I name
                     79: thus allowing alternate password files to be used.
                     80: Note that it does
                     81: .I not
                     82: close the previous file.
                     83: If this is desired,
                     84: .I endpwent
                     85: should be called prior to it.
                     86: .SH FILES
                     87: /etc/passwd
                     88: .SH "SEE ALSO"
                     89: getlogin(3), getgrent(3), passwd(5)
                     90: .SH DIAGNOSTICS
                     91: The routines
                     92: .IR getpwent ,
                     93: .IR getpwuid ,
                     94: and
                     95: .IR getpwnam ,
                     96: return a null pointer (0) on EOF or error.
                     97: .SH BUGS
                     98: All information
                     99: is contained in a static area
                    100: so it must be copied if it is
                    101: to be saved.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.