Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C 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 native Guardian processes: $SYSTEM.ZDLLnnn.ZSECDLL
H-series OSS processes: /G/system/zdllnnn/zsecdll
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 rst 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 les. In contrast, an HP NonStop server stores user and group information in struc-
tured, key-sequenced, Enscribe les. User information is accessed using a primary or alternate
key. A username or user ID can be specied 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 satises 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 #dene _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 specic error.
ERRORS
If any of the following conditions occurs, the setpwent() function sets errno to the correspond-
ing value:
[EIO] A disk process or le system input or output error occurred. Data might have
been lost during the transfer.
RELATED INFORMATION
Functions: endpwent(3), getpwent(3), getpwnam(3), getpwuid(3).
STANDARDS CONFORMANCE
The HP implementation of this function does not return the errno values [EMFILE] or
[ENFILE].
527192-005 Hewlett-Packard Company 619