getpwnam_r(3) getpwnam_r(3)
NAME
getpwnamr, getpwuidr - thread-safe search user database for a user
id or name
SYNOPSIS
#include <sys/types.h>
#include <pwd.h>
int getpwnamr(const char *nam, struct passwd *pwd, char *buffer,
sizet bufsize, struct passwd **result);
int getpwuidr(uidt *nam, struct passwd *pwd, char *buffer,
sizet bufsize, struct passwd **result);
DESCRIPTION
The getpwnamr() and getpwuidr() functions update the passwd struc-
ture pointed to by pwd and store a pointer to that structure at the
location pointed to by result.
The structure will contain an entry from the user database with a
matching name or uid. Storage referenced by the structure is allocated
from the memory provided with the buffer parameter, which is bufsize
characters in size.
A NULL pointer is returned at the location pointed to by result on
error or if the requested entry is not found.
RETURN VALUE
If successful, the getpwnamr() and getpwuidr() functions return
zero. Otherwise, an error number is returned to indicate the error.
ERRORS
The getpwnamr() and getpwuidr() functions may fail if:
ERANGE Insufficient storage was supplied via buffer and bufsize to
contain the data to be referenced by the resulting group
structure.
SEE ALSO
getpwnam(3C), getpwuid(3C), pwd(5), types(5).
Page 1 Reliant UNIX 5.44 Printed 11/98