]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/putpwent.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / putpwent.3
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da
MK
5.\"
6.\" References consulted:
7.\" Linux libc source code
8.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9.\" 386BSD man pages
10.\" Modified Sat Jul 24 18:43:46 1993 by Rik Faith (faith@cs.unc.edu)
4c1c5274 11.TH putpwent 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
12.SH NAME
13putpwent \- write a password file entry
e8826950
AC
14.SH LIBRARY
15Standard C library
8fc3b2cf 16.RI ( libc ", " \-lc )
fea681da
MK
17.SH SYNOPSIS
18.nf
19.B #include <stdio.h>
20.B #include <sys/types.h>
21.B #include <pwd.h>
68e4db0a 22.PP
fbe89453
AC
23.BI "int putpwent(const struct passwd *restrict " p \
24", FILE *restrict " stream );
fea681da 25.fi
68e4db0a 26.PP
d39ad78f 27.RS -4
cc4615cc
MK
28Feature Test Macro Requirements for glibc (see
29.BR feature_test_macros (7)):
d39ad78f 30.RE
68e4db0a 31.PP
cc4615cc 32.BR putpwent ():
9d281e06 33.nf
51c612fb
MK
34 Since glibc 2.19:
35 _DEFAULT_SOURCE
75c018a1 36 glibc 2.19 and earlier:
51c612fb 37 _SVID_SOURCE
9d281e06 38.fi
fea681da 39.SH DESCRIPTION
60a90ecd
MK
40The
41.BR putpwent ()
42function writes a password entry from the
fea681da
MK
43structure \fIp\fP in the file associated with \fIstream\fP.
44.PP
45The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
51f5698d 46.PP
a08ea57c 47.in +4n
bdd915e2 48.EX
fea681da 49struct passwd {
18701562 50 char *pw_name; /* username */
b9f02710
MK
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 */
fea681da 57};
bdd915e2 58.EE
a08ea57c 59.in
47297adb 60.SH RETURN VALUE
60a90ecd
MK
61The
62.BR putpwent ()
cb6a894e
MK
63function returns 0 on success.
64On failure, it returns \-1, and
459f2580 65.I errno
cb6a894e 66is set to indicate the error.
fea681da
MK
67.SH ERRORS
68.TP
69.B EINVAL
70Invalid (NULL) argument given.
3a29aaee
ZL
71.SH ATTRIBUTES
72For an explanation of the terms used in this section, see
73.BR attributes (7).
74.TS
75allbox;
c466875e 76lbx lb lb
3a29aaee
ZL
77l l l.
78Interface Attribute Value
79T{
9e54434e
BR
80.na
81.nh
3a29aaee
ZL
82.BR putpwent ()
83T} Thread safety MT-Safe locale
84.TE
847e0d88 85.sp 1
3113c7f3 86.SH STANDARDS
4131356c
AC
87None.
88.SH HISTORY
44a2c328 89SVr4.
47297adb 90.SH SEE ALSO
fea681da
MK
91.BR endpwent (3),
92.BR fgetpwent (3),
93.BR getpw (3),
94.BR getpwent (3),
95.BR getpwnam (3),
96.BR getpwuid (3),
97.BR setpwent (3)