Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
getpwnam_r(3) Guardian Native C Library Calls Reference Manual
NAME
getpwnam_r - Gets user attribute information from the user database (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J-series native Guardian processes that do not use Standard POSIX Threads:
$SYSTEM.ZDLLnnn.ZSECDLL
32-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/zsecdll
64-bit H-series and J-series OSS processes that do not use Standard POSIX Threads:
/G/system/zdllnnn/ysecdll
H-series and J-series OSS processes that use the Standard POSIX Threads Library:
/G/system/zdllnnn/zsptdll
(See NOTES)
SYNOPSIS
[#include <sys/types.h>] /* Optional except for POSIX.1 */
#include <pwd.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
int getpwnam_r (
const char *name,
struct passwd *ret,
char *buffer,
size_t buflen,
struct passwd **result);
PARAMETERS
name Specifies the username of the user whose user attributes are to be returned.
ret Points to a passwd structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for
returned data.
buflen Specifies the size of the buffer passed in bytes.
result Points to the struct passwd that is returned.
DESCRIPTION
The getpwnam_r( ) function is the reentrant version of the getpwnam() function.
The getpwnam_r( ) function returns information about a user from the user authentication data-
base when the pw_name field in the database entry matches the username specified by the name
parameter.
The getpwnam_r( ) function updates the passwd structure pointed to by the ret parameter and
stores a pointer to that structure at the location pointed to by the result paramter. The structure
contains an entry from the user database with a name that matches the value of the name parame-
ter. Storage referenced by the structure is allocated from the memory provided using the buffer
parameter, which is buflen characters in size. A null pointer is returned at the location pointed to
by the result parameter if an error occurs or if the requested entry is not found.
User Structure
The user passwd structure returned by the getpwnam_r() function is defined in the pwd.h
header file. The structure contains the following fields:
pw_name The user login name.
3−56 Hewlett-Packard Company 527192-018