putpwent(3C)
NAME
putpwent − write password file entry
SYNOPSIS
#include <pwd.h>
int putpwent(const struct passwd ∗p, FILE ∗f);
DESCRIPTION
putpwent() is the inverse of getpwent(), (see getpwnam(3C)). Given a pointer to a passwd structure created by getpwent() (or getpwuid() or getpwnam()), putpwent() writes a line on the stream f, which matches the format of /etc/passwd.
RETURN VALUES
putpwent() returns non-zero if an error was detected during its operation, otherwise zero.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | Unsafe |
SEE ALSO
getpwnam(3C), putspent(3C), attributes(5)
NOTES
Do not use without also using putspent() to update the shadow file.
The use of this function is discouraged.
BUGS
This routine is of limited utility, since most password files are maintained as Network Information Service (NIS) files, and cannot be updated with this routine.
SunOS 5.6 — Last change: 29 Dec 1996