OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / putpwent.3
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  2013-04-19 "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 .sp
39 .BI "int putpwent(const struct passwd *" p ", FILE *" stream );
40 .fi
41 .sp
42 .in -4n
43 Feature Test Macro Requirements for glibc (see
44 .BR feature_test_macros (7)):
45 .in
46 .sp
47 .BR putpwent ():
48 _SVID_SOURCE
49 .SH DESCRIPTION
50 The
51 .BR putpwent ()
52 function writes a password entry from the
53 structure \fIp\fP in the file associated with \fIstream\fP.
54 .PP
55 The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
56 .sp
57 .in +4n
58 .nf
59 struct passwd {
60     char    *pw_name;        /* username */
61     char    *pw_passwd;      /* user password */
62     uid_t    pw_uid;         /* user ID */
63     gid_t    pw_gid;         /* group ID */
64     char    *pw_gecos;       /* real name */
65     char    *pw_dir;         /* home directory */
66     char    *pw_shell;       /* shell program */
67 };
68 .fi
69 .in
70 .SH RETURN VALUE
71 The
72 .BR putpwent ()
73 function returns 0 on success, or \-1 if an error
74 occurs.
75 In the event of an error,
76 .I errno
77 is set to indicate the cause.
78 .SH ERRORS
79 .TP
80 .B EINVAL
81 Invalid (NULL) argument given.
82 .SH CONFORMING TO
83 SVr4.
84 .SH SEE ALSO
85 .BR endpwent (3),
86 .BR fgetpwent (3),
87 .BR getpw (3),
88 .BR getpwent (3),
89 .BR getpwnam (3),
90 .BR getpwuid (3),
91 .BR setpwent (3)
92 .SH COLOPHON
93 This page is part of release 3.68 of the Linux
94 .I man-pages
95 project.
96 A description of the project,
97 information about reporting bugs,
98 and the latest version of this page,
99 can be found at
100 \%http://www.kernel.org/doc/man\-pages/.