Accesses user-ID information in the user database.
Format
#include <pwd.h>
struct passwd *getpwuid (uid_t uid);
Arguments
- uid
- The ID of the user for which the attributes are to be read.
Description
This function accesses basic user attributes about a specified
user. It returns the first user entry in a database with a pw_
uid member of the passwd structure that matches the uid
argument.
The passwd structure is defined in the <pwd.h> header file as
follows:
pw_name | The user's login name. |
pw_uid | The numerical user
ID. |
pw_gid | The numerical
group ID. |
pw_dir | The home
directory of the user. |
pw_shell |
The initial program for the user. |
- Note
- All information generated by
the getpwuid function is stored in a per-thread static area and is
overwritten on subsequent calls to the function.
Return Values
x | A pointer to a valid password
structure. |
NULL | An error
occurred. errno is set to indicate the error. |
Previous Page | Next Page | Table of Contents | Index