man pages section 3: Basic Library Functions
  Search only this book
Download this book in PDF (4217 KB)

putpwent(3C)

Name | Synopsis | Description | Return Values | Usage | Attributes | See Also

Name

    putpwent– write password file entry

Synopsis

    #include <pwd.h>
    
    int putpwent(const struct passwd *p, FILE *f);

Description

    The putpwent() function is the inverse of getpwent(). See getpwnam(3C). Given a pointer to a passwd structure created by getpwent(), getpwuid(), or getpwnam(), putpwent() writes a line on the stream f that matches the format of /etc/passwd.

Return Values

    The putpwent() function returns a non-zero value if an error was detected during its operation. Otherwise, it returns 0.

Usage

    The putpwent() function is of limited utility, since most password files are maintained as Network Information Service (NIS) files that cannot be updated with this function. For this reason, the use of this function is discouraged. If used at all, it should be used with putspent(3C) to update the shadow file.

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    MT-Level 

    Unsafe 

See Also

SunOS 5.11  Last Revised 29 Dec 1996

Name | Synopsis | Description | Return Values | Usage | Attributes | See Also