getservent.3 (5500fdcd4f4839f2185e704508b3f6c2a11ccba6) getservent.3 (42b47d96f0e090cab912ff40d00dba8326c7ca36)
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 15 unchanged lines hidden (view full) ---

24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 15 unchanged lines hidden (view full) ---

24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)getservent.3 8.4 (Berkeley) 5/25/95
32.\" From: @(#)getservent.3 8.3 (Berkeley) 1/12/94
33.\" $Id: getservent.3,v 1.5 1997/02/22 15:00:13 peter Exp $
33.\"
34.\"
34.Dd May 25, 1995
35.Dd July 9, 1995
35.Dt GETSERVENT 3
36.Os BSD 4.2
37.Sh NAME
38.Nm getservent ,
39.Nm getservbyport ,
40.Nm getservbyname ,
41.Nm setservent ,
42.Nm endservent
43.Nd get service entry
44.Sh SYNOPSIS
45.Fd #include <netdb.h>
46.Ft struct servent *
47.Fn getservent
48.Ft struct servent *
36.Dt GETSERVENT 3
37.Os BSD 4.2
38.Sh NAME
39.Nm getservent ,
40.Nm getservbyport ,
41.Nm getservbyname ,
42.Nm setservent ,
43.Nm endservent
44.Nd get service entry
45.Sh SYNOPSIS
46.Fd #include <netdb.h>
47.Ft struct servent *
48.Fn getservent
49.Ft struct servent *
49.Fn getservbyname "char *name" "char *proto"
50.Fn getservbyname "const char *name" "const char *proto"
50.Ft struct servent *
51.Ft struct servent *
51.Fn getservbyport "int port" proto
52.Fn getservbyport "int port" "const char *proto"
52.Ft void
53.Fn setservent "int stayopen"
54.Ft void
55.Fn endservent void
56.Sh DESCRIPTION
57The
58.Fn getservent ,
59.Fn getservbyname ,

--- 14 unchanged lines hidden (view full) ---

74};
75.Ed
76.Pp
77The members of this structure are:
78.Bl -tag -width s_aliases
79.It Fa s_name
80The official name of the service.
81.It Fa s_aliases
53.Ft void
54.Fn setservent "int stayopen"
55.Ft void
56.Fn endservent void
57.Sh DESCRIPTION
58The
59.Fn getservent ,
60.Fn getservbyname ,

--- 14 unchanged lines hidden (view full) ---

75};
76.Ed
77.Pp
78The members of this structure are:
79.Bl -tag -width s_aliases
80.It Fa s_name
81The official name of the service.
82.It Fa s_aliases
82A NULL-terminated list of alternate names for the service.
83A zero terminated list of alternate names for the service.
83.It Fa s_port
84The port number at which the service resides.
85Port numbers are returned in network byte order.
86.It Fa s_proto
87The name of the protocol to use when contacting the
88service.
89.El
90.Pp

--- 21 unchanged lines hidden (view full) ---

112The
113.Fn getservbyname
114and
115.Fn getservbyport
116functions
117sequentially search from the beginning
118of the file until a matching
119protocol name or
84.It Fa s_port
85The port number at which the service resides.
86Port numbers are returned in network byte order.
87.It Fa s_proto
88The name of the protocol to use when contacting the
89service.
90.El
91.Pp

--- 21 unchanged lines hidden (view full) ---

113The
114.Fn getservbyname
115and
116.Fn getservbyport
117functions
118sequentially search from the beginning
119of the file until a matching
120protocol name or
120port number is found,
121port number (which must be specified in
122network byte order) is found,
121or until
122.Dv EOF
123is encountered.
123or until
124.Dv EOF
125is encountered.
124If a protocol name is also supplied (non-\c
126If a protocol name is also supplied (non-
125.Dv NULL ) ,
126searches must also match the protocol.
127.ne 1i
128.Sh FILES
129.Bl -tag -width /etc/services -compact
130.It Pa /etc/services
131.El
132.Sh DIAGNOSTICS

--- 23 unchanged lines hidden ---
127.Dv NULL ) ,
128searches must also match the protocol.
129.ne 1i
130.Sh FILES
131.Bl -tag -width /etc/services -compact
132.It Pa /etc/services
133.El
134.Sh DIAGNOSTICS

--- 23 unchanged lines hidden ---