struct passwd *getpwnam(const char *name);
int getpwnam_r(const char *name, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result);
struct passwd *getpwuid(uid_t uid);
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result);
The correct size for the buffer
size = sysconf(_SC_GETPW_R_SIZE_MAX);
Is the name of the user to look up in the user database.
getpwnam()and getpwnam_r()fill in the passwd structure with data about the user.
Is the user ID of the user to look up in the user database.
getpwuid()and getpwuid_r()fill in the passwd structure with data about the user.
Points to a passwd structure to be filled in.
Points to a buffer where the data needed for the passwd structure members is to be placed.
Is the size of the buffer being passed.
Is a pointer that, on success, contains the address of pwd, or, on failure, contains NULL.
If an error occurs or if the requested entry is not found,
The name, pwd, buf, or result parameter is not a valid pointer.
The name parameter is not a valid user name, or the uid parameter is not a valid user ID.
Insufficient storage was supplied via buffer and bufsize to contain the data to be referenced by the resulting structure.
Unlike UNIX platforms, there are common circumstances where
For the case of accounts where no home directory has been defined, the
default behavior is for the pw_dir returned to be an
empty string. The behavior can be changed with
the _NC_SET_PWNAME_PROFILE parameter
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
_NutConf(), getgrgid(), getgrgid_r(), getgrnam(), getgrnam_r(), getlogin(), getlogin_r(), sysconf()
- struct passwd
PTC MKS Toolkit 10.3 Documentation Build 39.