2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified Sat Jul 24 18:43:46 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH putpwent 3 (date) "Linux man-pages (unreleased)"
13 putpwent \- write a password file entry
16 .RI ( libc ", " \-lc )
20 .B #include <sys/types.h>
23 .BI "int putpwent(const struct passwd *restrict " p \
24 ", FILE *restrict " stream );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
36 glibc 2.19 and earlier:
42 function writes a password entry from the
43 structure \fIp\fP in the file associated with \fIstream\fP.
45 The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
50 char *pw_name; /* username */
51 char *pw_passwd; /* user password */
52 uid_t pw_uid; /* user ID */
53 gid_t pw_gid; /* group ID */
54 char *pw_gecos; /* real name */
55 char *pw_dir; /* home directory */
56 char *pw_shell; /* shell program */
63 function returns 0 on success.
64 On failure, it returns \-1, and
66 is set to indicate the error.
70 Invalid (NULL) argument given.
72 For an explanation of the terms used in this section, see
80 Interface Attribute Value
83 T} Thread safety MT-Safe locale