Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Single UNIX Specification, Version 2 |
both | OS/390 V2R8 |
#define _XOPEN_SOURCE 500
#include <sys/types.h>
#include <pwd.h>
int getpwuid_r(uid_t uid, struct passwd *pwd,
char *buffer, size_t bufsize, struct passwd **result);
The getpwuid_r() function updates the passwd structure pointed to by pwd and stores 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 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.
If successful, getpwuid_r() returns 0.