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