getpwuid

Returns information about a local user.

Library:LibC
Classification:POSIX
Service:File and Directory I/O

Syntax

  #include <pwd.h> 
   
  struct passwd *getpwuid (
     uid_t   uid );
  

Parameters

uid

(IN) Specifies a local ID obtained from such functions as getuid, geteuid, or stat.

Return Values

If successful, returns a pointer to a passwd structure. Otherwise, returns a NULL pointer if the ID cannot be found or an error occurs. If an error occurs, errno is also set.

Decimal

Constant

Description

105

ENOCONTEXT

The calling thread has no context.

Remarks

The pointer returned by the getpwuid points to data, which might be overwritten by another call to getpwuid. In a multi-threaded, multi-processor environment, use getpwuid_r.

See Also