1PUTPWENT(3) Linux Programmer's Manual PUTPWENT(3)
2
3
4
6 putpwent - write a password file entry
7
9 #include <stdio.h>
10 #include <sys/types.h>
11 #include <pwd.h>
12
13 int putpwent(const struct passwd *p, FILE *stream);
14
15 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17 putpwent(): _SVID_SOURCE
18
20 The putpwent() function writes a password entry from the structure p in
21 the file associated with stream.
22
23 The passwd structure is defined in <pwd.h> as follows:
24
25 struct passwd {
26 char *pw_name; /* username */
27 char *pw_passwd; /* user password */
28 uid_t pw_uid; /* user ID */
29 gid_t pw_gid; /* group ID */
30 char *pw_gecos; /* real name */
31 char *pw_dir; /* home directory */
32 char *pw_shell; /* shell program */
33 };
34
36 The putpwent() function returns 0 on success, or -1 if an error occurs.
37
39 EINVAL Invalid (NULL) argument given.
40
42 SVr4.
43
45 endpwent(3), fgetpwent(3), getpw(3), getpwent(3), getpwnam(3), getp‐
46 wuid(3), setpwent(3)
47
49 This page is part of release 3.22 of the Linux man-pages project. A
50 description of the project, and information about reporting bugs, can
51 be found at http://www.kernel.org/doc/man-pages/.
52
53
54
55GNU 2007-07-26 PUTPWENT(3)