DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

getpw(S)


getpw -- get user info from UID

Syntax

cc ... -lc

int getpw (uid, buf)
int uid;
char *buf;

Description

The getpw routine searches the /etc/passwd file for a user ID number that equals the uid argument. If the user ID is found, getpw copies the line of the password file in which uid was found into the array to which the argument buf points. Upon a successful match, the getpw routine returns a value of zero. If the /etc/passwd file does not exist, cannot be opened, or if uid does not match any ID entry in the password file, getpw fails and returns a non-zero value.

This routine is included only for compatibility with prior systems and should not be used; see getpwent(S) for routines to use instead.

Return value

Upon successful completion, the getpw routine returns a value of zero. getpw returns a non-zero value on error.

Files

/etc/passwd

See also

getpwent(S), passwd(FP)

Standards conformance

The getpw routine is an extension of AT&T System V provided by the Santa Cruz Operation. .
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003