Changes.old: Add missing entry in 5.13 changelog
[man-pages.git] / man3 / putpwent.3
blob3b88304db6cc53aedfb93f55c1b791503351d2dd
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 18:43:46 1993 by Rik Faith (faith@cs.unc.edu)
30 .TH PUTPWENT 3  2021-03-22 "GNU" "Linux Programmer's Manual"
31 .SH NAME
32 putpwent \- write a password file entry
33 .SH SYNOPSIS
34 .nf
35 .B #include <stdio.h>
36 .B #include <sys/types.h>
37 .B #include <pwd.h>
38 .PP
39 .BI "int putpwent(const struct passwd *restrict " p \
40 ", FILE *restrict " stream );
41 .fi
42 .PP
43 .RS -4
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
46 .RE
47 .PP
48 .BR putpwent ():
49 .nf
50     Since glibc 2.19:
51         _DEFAULT_SOURCE
52     Glibc 2.19 and earlier:
53         _SVID_SOURCE
54 .fi
55 .SH DESCRIPTION
56 The
57 .BR putpwent ()
58 function writes a password entry from the
59 structure \fIp\fP in the file associated with \fIstream\fP.
60 .PP
61 The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
62 .PP
63 .in +4n
64 .EX
65 struct passwd {
66     char    *pw_name;        /* username */
67     char    *pw_passwd;      /* user password */
68     uid_t    pw_uid;         /* user ID */
69     gid_t    pw_gid;         /* group ID */
70     char    *pw_gecos;       /* real name */
71     char    *pw_dir;         /* home directory */
72     char    *pw_shell;       /* shell program */
74 .EE
75 .in
76 .SH RETURN VALUE
77 The
78 .BR putpwent ()
79 function returns 0 on success.
80 On failure, it returns \-1, and
81 .I errno
82 is set to indicate the error.
83 .SH ERRORS
84 .TP
85 .B EINVAL
86 Invalid (NULL) argument given.
87 .SH ATTRIBUTES
88 For an explanation of the terms used in this section, see
89 .BR attributes (7).
90 .ad l
91 .nh
92 .TS
93 allbox;
94 lbx lb lb
95 l l l.
96 Interface       Attribute       Value
98 .BR putpwent ()
99 T}      Thread safety   MT-Safe locale
103 .sp 1
104 .SH CONFORMING TO
105 SVr4.
106 .SH SEE ALSO
107 .BR endpwent (3),
108 .BR fgetpwent (3),
109 .BR getpw (3),
110 .BR getpwent (3),
111 .BR getpwnam (3),
112 .BR getpwuid (3),
113 .BR setpwent (3)