OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / getservent.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:19:11 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified Wed Oct 18 20:23:54 1995 by Martin Schulze <joey@infodrom.north.de>
29 .\" Modified Mon Apr 22 01:50:54 1996 by Martin Schulze <joey@infodrom.north.de>
30 .\" 2001-07-25 added a clause about NULL proto (Martin Michlmayr or David N. Welton)
31 .\"
32 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
33 .\" Translated Fri Mar 15 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
34 .\" Updated Thu 16 Aug 2001 by NAKANO Takeo
35 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\"
37 .TH GETSERVENT 3  2008-08-19 "GNU" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .\"O getservent, getservbyname, getservbyport, setservent, endservent \-
40 .\"O get service entry
41 .SH Ì¾Á°
42 getservent, getservbyname, getservbyport, setservent, endservent \- ¥µ¡¼¥Ó¥¹¤Î¥¨¥ó¥È¥ê¤ò¼èÆÀ¤¹¤ë
43 .\"O .SH SYNOPSIS
44 .SH ½ñ¼°
45 .nf
46 .B #include <netdb.h>
47 .sp
48 .B struct servent *getservent(void);
49 .sp
50 .BI "struct servent *getservbyname(const char *" name ", const char *" proto );
51 .sp
52 .BI "struct servent *getservbyport(int " port ", const char *" proto );
53 .sp
54 .BI "void setservent(int " stayopen );
55 .sp
56 .B void endservent(void);
57 .fi
58 .\"O .SH DESCRIPTION
59 .SH ÀâÌÀ
60 .\"O The
61 .\"O .BR getservent ()
62 .\"O function reads the next entry from the services database (see
63 .\"O .BR services (5))
64 .\"O and returns a \fIservent\fP structure containing
65 .\"O the broken-out fields from the entry.
66 .\"O A connection is opened to the database if necessary.
67 .BR getservent ()
68 ´Ø¿ô¤Ï¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹
69 .RB ( services (5)
70 »²¾È) ¤«¤é¼¡¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤ß¡¢
71 ¤½¤Î¥¨¥ó¥È¥ê¤ò \fIservent\fP ¹½Â¤ÂΤÎÍ×ÁÇÊ̤Υե£¡¼¥ë¥É¤Ë³ÊǼ¤·¡¢
72 ¤½¤Î¹½Â¤ÂΤòÊÖ¤¹¡£
73 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
74 .PP
75 .\"O The
76 .\"O .BR getservbyname ()
77 .\"O function returns a \fIservent\fP structure
78 .\"O for the entry from the database
79 .\"O that matches the service \fIname\fP using protocol \fIproto\fP.
80 .\"O If \fIproto\fP is NULL, any protocol will be matched.
81 .\"O A connection is opened to the database if necessary.
82 .BR getservbyname ()
83 ´Ø¿ô¤Ï¡¢
84 ¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î̾Á° \fIname\fP
85 ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢
86 ¤½¤Î¥¨¥ó¥È¥ê¤ò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹¡£
87 \fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤Ï¡¢Ç¤°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£
88 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
89 .PP
90 .\"O The
91 .\"O .BR getservbyport ()
92 .\"O function returns a \fIservent\fP structure
93 .\"O for the entry from the database
94 .\"O that matches the port \fIport\fP (given in network byte order)
95 .\"O using protocol \fIproto\fP.
96 .\"O If \fIproto\fP is NULL, any protocol will be matched.
97 .\"O A connection is opened to the database if necessary.
98 .BR getservbyport ()
99 ´Ø¿ô¤Ï¡¢
100 ¥×¥í¥È¥³¥ë \fIproto\fP ¤òÍѤ¤¤ë¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP
101 ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éõ¤·¡¢
102 ¤½¤Î¥¨¥ó¥È¥ê¤ÎÆâÍƤò¼ý¤á¤¿ \fIservent\fP ¹½Â¤ÂΤòÊÖ¤¹
103 (¥Ý¡¼¥ÈÈÖ¹æ \fIport\fP ¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤹ¤ë)¡£
104 \fIproto\fP ¤¬ NULL ¤Î¾ì¹ç¤ÏǤ°Õ¤Î¥×¥í¥È¥³¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£
105 ɬÍפǤ¢¤ì¤Ð¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬¥ª¡¼¥×¥ó¤µ¤ì¤ë¡£
106 .PP
107 .\"O The
108 .\"O .BR setservent ()
109 .\"O function opens a connection to the database,
110 .\"O and sets the next entry to the first entry.
111 .\"O If \fIstayopen\fP is nonzero,
112 .\"O then the connection to the database
113 .\"O will not be closed between calls to one of the
114 .\"O .BR getserv* ()
115 .\"O functions.
116 .BR setservent ()
117 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥ª¡¼¥×¥ó¤·¡¢
118 ¼¡¤ÎÆɤ߹þ¤ß¥¨¥ó¥È¥ê¤òÀèƬ¤Î¥¨¥ó¥È¥ê¤ËÀßÄꤹ¤ë¡£
119 \fIstayopen\fP ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢
120 °ì¤Ä°ì¤Ä¤Î
121 .BR getserv* ()
122 ´Ø¿ô¤Î¸Æ¤Ó½Ð¤·´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤·¤Ê¤¤¡£
123 .PP
124 .\"O The
125 .\"O .BR endservent ()
126 .\"O function closes the connection to the database.
127 .BR endservent ()
128 ´Ø¿ô¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
129 .PP
130 .\"O The \fIservent\fP structure is defined in \fI<netdb.h>\fP as follows:
131 \fIservent\fP ¹½Â¤ÂΤϠ\fI<netdb.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
132 .sp
133 .in +4n
134 .nf
135 struct servent {
136     char  *s_name;       /* official service name */
137     char **s_aliases;    /* alias list */
138     int    s_port;       /* port number */
139     char  *s_proto;      /* protocol to use */
140 }
141 .fi
142 .in
143 .PP
144 .\"O The members of the \fIservent\fP structure are:
145 \fIservent\fP ¹½Â¤ÂΤΥá¥ó¥Ð¡¼¤Ï°Ê²¼¤ÎÄ̤ꡣ
146 .RS
147 .TP 12
148 .I s_name
149 .\"O The official name of the service.
150 ¥µ¡¼¥Ó¥¹¤ÎÀµ¼°Ì¾ (official name)¡£
151 .TP
152 .I s_aliases
153 .\"O A NULL-terminated list of alternative names for the service.
154 ¥µ¡¼¥Ó¥¹¤ÎÊÌ̾¤Î¥ê¥¹¥È¡£
155 ¥ê¥¹¥È¤Ï NULL ¤Ç½ªÃ¼¤µ¤ì¤ë¡£
156 .TP
157 .I s_port
158 .\"O The port number for the service given in network byte order.
159 ¥µ¡¼¥Ó¥¹¤Î¥Ý¡¼¥ÈÈֹ档¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¤Ç»ØÄꤵ¤ì¤ë¡£
160 .TP
161 .I s_proto
162 .\"O The name of the protocol to use with this service.
163 ¤³¤Î¥µ¡¼¥Ó¥¹¤È¶¦¤ËÍѤ¤¤ë¥×¥í¥È¥³¥ë¤Î̾Á°¡£
164 .RE
165 .\"O .SH "RETURN VALUE"
166 .SH ÊÖ¤êÃÍ
167 .\"O The
168 .\"O .BR getservent (),
169 .\"O .BR getservbyname ()
170 .\"O and
171 .\"O .BR getservbyport ()
172 .\"O functions return a pointer to a
173 .\"O statically allocated \fIservent\fP structure, or a NULL pointer if an
174 .\"O error occurs or the end of the file is reached.
175 .BR getservent (),
176 .BR getservbyname (),
177 .BR getservbyport ()
178 ´Ø¿ô¤Ï¡¢
179 ÀÅŪ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿ \fIservent\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
180 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¤ê¡¢¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¤Ï NULL ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
181 .\"O .SH FILES
182 .SH ¥Õ¥¡¥¤¥ë
183 .TP
184 .I /etc/services
185 .\"O services database file
186 ¥µ¡¼¥Ó¥¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
187 .\"O .SH "CONFORMING TO"
188 .SH ½àµò
189 4.3BSD, POSIX.1-2001.
190 .\"O .SH "SEE ALSO"
191 .SH ´ØÏ¢¹àÌÜ
192 .BR getnetent (3),
193 .BR getprotoent (3),
194 .BR getservent_r (3),
195 .BR services (5)