[Previous]
[Contents]
[Next]

setpwent()

rewind to the start of the password database

Synopsis:

#include <sys/types.h>
#include <pwd.h>
int setpwent( void );

Description:

The setpwent() function rewinds to the start of the password database. It's provided for programs that make multiple lookups in the password database (using the getpwnam() and getpwuid() calls) to avoid opening and closing the password database for each access.

Returns:

0 on success, -1 if an error occurs.

Examples:

See getpwent().

Classification:

UNIX

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

cuserid(), endpwent(), errno, getgrent(), getlogin(), getpwent(), getpwnam(), getpwuid()


[Previous]
[Contents]
[Next]