getpwuid_r

Returns information about a local user.

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

Syntax

  #include <pwd.h> 
   
  int getpwuid_r (
     uid_t             uid,
     struct passwd    *pwd,
     char             *buffer,
     size_t            bufsize,
     struct passwd   **result );
  

Parameters

uid

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

pwd

(IN) Points to a passwd structure which is updated with information about the specified user.

buffer

(IN) Points to a buffer to use for referenced strings.

bufsize

(IN) Specifies the size of the buffer parameter, in bytes. Use sysconf to determine the maximum length of referenced strings.

result

(IN) Points to a NULL pointer if an error occurs or the entry cannot be found.

Return Values

If successful, returns 0. Otherwise, returns an error code:

Decimal

Constant

Description

105

ENOCONTEXT

The calling thread has no context.

Remarks

The getpwuid_r function is the preferred function for applications running in a multi-threaded, multi-processor environment.

See Also