Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (s) setpwent(3)
NAME
setpwent - Resets the sequential key to the user database
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSECSRL
G-series native OSS processes: /G/system/sysnn/zsecsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZSECDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zsecdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ysecdll |
SYNOPSIS
#include <pwd.h>
void setpwent(void);
DESCRIPTION
The setpwent( ) function ensures that the next call to the getpwent( ) function returns informa-
tion about the first user in the user authentication database. Each subsequent call to getpwent( )
returns information from the next user entry, unless an intervening call to the setpwent( ) func-
tion has reset the entry pointer to the beginning of the database.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured files. In contrast, an HP NonStop server stores user and group information in struc-
tured, key-sequenced, Enscribe files. User information is accessed using a primary or alternate
key. A username or user ID can be specified as a key.
Sequential access to user information is supported by storing the most recently used key in static
storage. The setpwent( ) function resets this key. The endpwent( ) function satisfies references
when linking user applications.
OSS user authentication database functions do not leave the database open between calls.
Authentication records for user aliases follow regular user authentication records in the database.
Use From the Guardian Environment
The setpwent( ) function can be used by a Guardian process when the process has been compiled
using the #define _XOPEN_SOURCE_EXTENDED 1 feature-test macro or an equivalent com-
piler command option.
NOTES
To check for an error resulting from a call to setpwent( ), set errno to 0 (zero) before the call.
RETURN VALUES
Upon successful completion, the setpwent( ) function returns no value. Otherwise, the function
sets errno to indicate the specific error.
ERRORS
If any of the following conditions occurs, the setpwent( ) function sets errno to the correspond-
ing value:
[EIO] A disk process or file system input or output error occurred. Data might have
been lost during the transfer.
[ENOMEM] There is insufficient user memory to complete the call.
527187-017 Hewlett-Packard Company 643