Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (g - i) getpwuid(3)
NAME
getpwuid - Gets user attribute information from 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 <sys/types.h> /* optional except for POSIX.1 */
#include <pwd.h>
struct passwd getpwuid(
uid_t uid);
PARAMETERS
uid Species the user ID of the user whose user attributes are to be returned.
DESCRIPTION
The getpwuid() function returns information about a user from the user authentication database
when the pw_uid eld in the database entry matches the user ID specified by the uid parameter.
A user ID distinguishes a user on a Guardian system but does not distinguish an alias for that
user. Therefore, the getpwuid() function always returns the information for a user, not for an
alias of the user.
User Structure
The user passwd structure returned by the getpwuid() function is defined in the pwd.h header
file. The structure contains the following fields:
pw_name The user login name.
pw_passwd The current user password (not returned).
pw_uid The user ID of the user.
pw_gid The group ID of the primary group of the user.
pw_age The password aging string (not returned).
pw_comment Comment string (not returned).
pw_gecos Personal information about the user (not returned).
pw_dir The home directory of the user.
pw_shell The initial program for the user.
The pw_passwd, pw_age, pw_comment, and pw_gecos fields are provided for compatibility
with some versions of UNIX, but these fields always contain null strings.
Database Structure and Access
Traditional UNIX implementations access user and group information by sequentially reading
unstructured files. In contrast, an HP NonStop server node stores user and group information in
structured, key-sequenced, Enscribe files. User information is accessed using a primary or alter-
nate 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
527192-018 Hewlett-Packard Company 359