xref: /titanic_44/usr/src/man/man3c/getpw.3c (revision b8afd3a780ce850ff107bb3be330465bf47f84bd)
te
Copyright 1989 AT&T Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
getpw 3C "29 Dec 1996" "SunOS 5.11" "Standard C Library Functions"
NAME
getpw - get passwd entry from UID
SYNOPSIS

#include <stdlib.h>

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

The getpw() function searches the user data base for a user id number that equals uid, copies the line of the password file in which uid was found into the array pointed to by buf, and returns 0. getpw() returns non-zero if uid cannot be found.

USAGE

This function is included only for compatibility with prior systems and should not be used; the functions described on the getpwnam(3C) manual page should be used instead.

If the /etc/passwd and the /etc/group files have a plus sign (+) for the NIS entry, then getpwent() and getgrent() will not return NULL when the end of file is reached. See getpwnam(3C).

RETURN VALUES

The getpw() function returns non-zero on error.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelSafe
SEE ALSO

getpwnam(3C), passwd(4), attributes(5)