OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / getprotoent.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 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"
29 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
30 .\" Translated Fri Mar 15 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
32 .\"
33 .TH GETPROTOENT 3  2008-08-19 "GNU" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .\"O getprotoent, getprotobyname, getprotobynumber, setprotoent,
36 .\"O endprotoent \- get protocol entry
37 .SH Ì¾Á°
38 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
39 ¥×¥í¥È¥³¥ë¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
40 .\"O .SH SYNOPSIS
41 .SH ½ñ¼°
42 .nf
43 .B #include <netdb.h>
44 .sp
45 .B struct protoent *getprotoent(void);
46 .sp
47 .BI "struct protoent *getprotobyname(const char *" name );
48 .sp
49 .BI "struct protoent *getprotobynumber(int " proto );
50 .sp
51 .BI "void setprotoent(int " stayopen );
52 .sp
53 .B void endprotoent(void);
54 .fi
55 .\"O .SH DESCRIPTION
56 .SH ÀâÌÀ
57 .\"O The
58 .\"O .BR getprotoent ()
59 .\"O function reads the next entry from the protocols database (see
60 .\"O .BR protocols (5))
61 .\"O and returns a \fIprotoent\fP structure
62 .\"O containing the broken-out fields from the entry.
63 .\"O A connection is opened to the database if necessary.
64 .BR getprotoent ()
65 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹
66 .RB ( protocols (5)
67 »²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢
68 ¤½¤Î¥¨¥ó¥È¥ê¤ò \fIprotoent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢
69 ¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£
70 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
71 .PP
72 .\"O The
73 .\"O .BR getprotobyname ()
74 .\"O function returns a \fIprotoent\fP structure
75 .\"O for the entry from the database
76 .\"O that matches the protocol name \fIname\fP.
77 .\"O A connection is opened to the database if necessary.
78 .BR getprotobyname ()
79 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ë̾ \fIname\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
80 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
81 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
82 .PP
83 .\"O The
84 .\"O .BR getprotobynumber ()
85 .\"O function returns a \fIprotoent\fP structure
86 .\"O for the entry from the database
87 .\"O that matches the protocol number \fInumber\fP.
88 .\"O A connection is opened to the database if necessary.
89 .BR getprotobynumber ()
90 ´Ø¿ô¤Ï¡¢¥×¥í¥È¥³¥ëÈÖ¹æ \fInumber\fP ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò
91 ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIprotoent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
92 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
93 .PP
94 .\"O The
95 .\"O .BR setprotoent ()
96 .\"O function opens a connection to the database,
97 .\"O and sets the next entry to the first entry.
98 .\"O If \fIstayopen\fP is nonzero,
99 .\"O then the connection to the database
100 .\"O will not be closed between calls to one of the
101 .\"O .BR getproto* ()
102 .\"O functions.
103 .BR setprotoent ()
104 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢
105 ¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£
106 \fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢
107 °ì¤Ä°ì¤Ä¤Î
108 .BR getproto* ()
109 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£
110 .PP
111 .\"O The
112 .\"O .BR endprotoent ()
113 .\"O function closes the connection to the database.
114 .BR endprotoent ()
115 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
116 .PP
117 .\"O The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
118 \fIprotoent\fP ¹½Â¤ÂΤϠ\fI<netdb.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
119 .sp
120 .in +4n
121 .nf
122 struct protoent {
123     char  *p_name;       /* official protocol name */
124     char **p_aliases;    /* alias list */
125     int    p_proto;      /* protocol number */
126 }
127 .fi
128 .in
129 .PP
130 .\"O The members of the \fIprotoent\fP structure are:
131 \fIprotoent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ
132 .RS
133 .TP 12
134 .I p_name
135 .\"O The official name of the protocol.
136 ¥×¥í¥È¥³¥ë¤ÎÀµ¼°Ì¾ (official name)¡£
137 .TP
138 .I p_aliases
139 .\"O A NULL-terminated list of alternative names for the protocol.
140 ¥×¥í¥È¥³¥ë¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£
141 ¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
142 .TP
143 .I p_proto
144 .\"O The protocol number.
145 ¥×¥í¥È¥³¥ë¤ÎÈÖ¹æ
146 .RE
147 .\"O .SH "RETURN VALUE"
148 .SH ÊÖ¤êÃÍ
149 .\"O The
150 .\"O .BR getprotoent (),
151 .\"O .BR getprotobyname ()
152 .\"O and
153 .\"O .BR getprotobynumber ()
154 .\"O functions return a pointer to a
155 .\"O statically allocated \fIprotoent\fP structure, or a NULL pointer if an
156 .\"O error occurs or the end of the file is reached.
157 .BR getprotoent (),
158 .BR getprotobyname (),
159 .BR getprotobynumber ()
160 ´Ø¿ô¤Ï¡¢ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIprotoent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
161 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
162 .\"O .SH FILES
163 .SH ¥Õ¥¡¥¤¥ë
164 .PD 0
165 .TP
166 .I /etc/protocols
167 .\"O protocol database file
168 ¥×¥í¥È¥³¥ë¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
169 .PD
170 .\"O .SH "CONFORMING TO"
171 .SH ½àµò
172 4.3BSD, POSIX.1-2001.
173 .\"O .SH "SEE ALSO"
174 .SH ´ØÏ¢¹àÌÜ
175 .BR getnetent (3),
176 .BR getprotoent_r (3),
177 .BR getservent (3),
178 .BR protocols (5)