]>
Commit | Line | Data |
---|---|---|
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 |
13 | putpwent \- write a password file entry | |
e8826950 AC |
14 | .SH LIBRARY |
15 | Standard 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 |
28 | Feature 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 |
40 | The |
41 | .BR putpwent () | |
42 | function writes a password entry from the | |
fea681da MK |
43 | structure \fIp\fP in the file associated with \fIstream\fP. |
44 | .PP | |
45 | The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows: | |
51f5698d | 46 | .PP |
a08ea57c | 47 | .in +4n |
bdd915e2 | 48 | .EX |
fea681da | 49 | struct 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 |
61 | The |
62 | .BR putpwent () | |
cb6a894e MK |
63 | function returns 0 on success. |
64 | On failure, it returns \-1, and | |
459f2580 | 65 | .I errno |
cb6a894e | 66 | is set to indicate the error. |
fea681da MK |
67 | .SH ERRORS |
68 | .TP | |
69 | .B EINVAL | |
70 | Invalid (NULL) argument given. | |
3a29aaee ZL |
71 | .SH ATTRIBUTES |
72 | For an explanation of the terms used in this section, see | |
73 | .BR attributes (7). | |
74 | .TS | |
75 | allbox; | |
c466875e | 76 | lbx lb lb |
3a29aaee ZL |
77 | l l l. |
78 | Interface Attribute Value | |
79 | T{ | |
9e54434e BR |
80 | .na |
81 | .nh | |
3a29aaee ZL |
82 | .BR putpwent () |
83 | T} Thread safety MT-Safe locale | |
84 | .TE | |
847e0d88 | 85 | .sp 1 |
3113c7f3 | 86 | .SH STANDARDS |
4131356c AC |
87 | None. |
88 | .SH HISTORY | |
44a2c328 | 89 | SVr4. |
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) |