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

Guardian Native C Library Calls (g - i) getpwuid_r(3)
NAME
getpwuid_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>]
#include <pwd.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
int getpwuid_r (
uid_t uid,
struct passwd *ret,
char *buffer,
size_t buflen,
struct passwd **result);
PARAMETERS
uid Species the user ID of the user whose user attributes are to be returned.
ret Points to a struct 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 getpwuid_r( ) function is the reentrant version of the getpwuid() function.
The getpwuid_r( ) function returns information about a user from the user authentication data-
base when the pw_uid field in the database entry matches the user ID specified by the uid param-
eter.
A user ID distinguishes a user on a Guardian system but does not distinguish an alias for that
user. Therefore, the getpwuid_r() function always returns the information for a user, not for an
alias of the user.
The getpwuid_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 parameter. The structure
contains an entry from the user database with a matching user ID. Storage referenced by the
structure is allocated from the memory provided using the buffer parameter, which is buflen char-
acters 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.
527192-018 Hewlett-Packard Company 361