OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / man3 / putpwent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 18:43:46 1993 by Rik Faith (faith@cs.unc.edu)
28 .TH PUTPWENT 3  2007-07-26 "GNU" "Linux Programmer's Manual"
29 .SH NAME
30 putpwent \- write a password file entry
31 .SH SYNOPSIS
32 .nf
33 .B #include <stdio.h>
34 .B #include <sys/types.h>
35 .B #include <pwd.h>
36 .sp
37 .BI "int putpwent(const struct passwd *" p ", FILE *" stream );
38 .fi
39 .sp
40 .in -4n
41 Feature Test Macro Requirements for glibc (see
42 .BR feature_test_macros (7)):
43 .in
44 .sp
45 .BR putpwent ():
46 _SVID_SOURCE
47 .SH DESCRIPTION
48 The
49 .BR putpwent ()
50 function writes a password entry from the
51 structure \fIp\fP in the file associated with \fIstream\fP.
52 .PP
53 The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
54 .sp
55 .in +4n
56 .nf
57 struct passwd {
58     char    *pw_name;        /* username */
59     char    *pw_passwd;      /* user password */
60     uid_t    pw_uid;         /* user ID */
61     gid_t    pw_gid;         /* group ID */
62     char    *pw_gecos;       /* real name */
63     char    *pw_dir;         /* home directory */
64     char    *pw_shell;       /* shell program */
65 };
66 .fi
67 .in
68 .SH "RETURN VALUE"
69 The
70 .BR putpwent ()
71 function returns 0 on success, or \-1 if an error
72 occurs.
73 .SH ERRORS
74 .TP
75 .B EINVAL
76 Invalid (NULL) argument given.
77 .SH "CONFORMING TO"
78 SVr4.
79 .SH "SEE ALSO"
80 .BR endpwent (3),
81 .BR fgetpwent (3),
82 .BR getpw (3),
83 .BR getpwent (3),
84 .BR getpwnam (3),
85 .BR getpwuid (3),
86 .BR setpwent (3)