getpwnam_r

Returns information about the specified user name.

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

Syntax

  #include <pwd.h> 
   
  int getpwnam_r (
     const char       *name,
     struct passwd    *pwd,
     char             *buffer,
     size_t            bufsize,
     struct passwd   **result );
  

Parameters

name

(IN) Points to a user name, obtained from such functions as getstat and fgetstat.

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 getpwnam_r function is the preferred function for applications running in a multi-threaded, multi-processor environment.

See Also