.TH getspent() "" "" "General Function (libc)"
.PC "Get a shadow-password record"
.B "#include <shadow.h>"
\fBstruct spwd *getspent(\|)\fR
.PP
The \*(CO system has four routines that search the file
.BR /etc/shadow ,
which contains the password of every user of the system.
.B getspent()
returns a record from this file.
If a program has already read entries from
.BR /etc/shadow ,
.B getspent()
returns the next entry; otherwise, it returns the first entry.
.PP
If an error occurs,
.B getspent()
returns NULL.
Otherwise, it returns the address of an object with the structure
.B spwd ,
which is defined in header file
.BR <shadow.h> .
For a description of this structure, see the Lexicon entry for
.BR shadow.h .
.SH "See Also"
.Xr "endspent()," endspent
.Xr "libc," libc
.Xr "setspent()," setspent
.Xr "shadow," shadow
.Xr "shadow.h" shadow.h
.SH Notes
All structures and information returned are
in static areas internal to
.BR getspent() .
Therefore, information from a previous call is overwritten by each
subsequent call.
