]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent.3
Automated addition of parentheses by add_parens_for_own_funcs.sh
[thirdparty/man-pages.git] / man3 / getrpcent.3
CommitLineData
fea681da
MK
1.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
2.TH GETRPCENT 3 1987-12-14
3.SH NAME
4getrpcent, getrpcbyname, getrpcbynumber \- get RPC entry
5.SH SYNOPSIS
6.nf
7.ft B
8#include <netdb.h>
9.LP
10.ft B
11struct rpcent *getrpcent()
12.LP
13.ft B
14struct rpcent *getrpcbyname(name)
15char *name;
16.LP
17.ft B
18struct rpcent *getrpcbynumber(number)
19int number;
20.LP
21.ft B
22setrpcent (stayopen)
23int stayopen;
24.LP
25.ft B
26endrpcent ()
27.fi
28.SH DESCRIPTION
29.LP
30.BR getrpcent() ,
31.BR getrpcbyname() ,
32and
33.B getrpcbynumber()
34each return a pointer to an object with the
35following structure
36containing the broken-out
37fields of a line in the rpc program number data base,
38.BR /etc/rpc .
39.RS
40.LP
41.nf
42.ft B
43struct rpcent {
44 char *r_name; /* name of server for this rpc program */
45 char **r_aliases; /* alias list */
46 long r_number; /* rpc program number */
47};
48.ft R
49.fi
50.RE
51.LP
52The members of this structure are:
53.RS
54.PD 0
55.TP 20
56.B r_name
57The name of the server for this rpc program.
58.TP 20
59.B r_aliases
60A zero terminated list of alternate names for the rpc program.
61.TP 20
62.B r_number
63The rpc program number for this service.
64.PD
65.RE
66.LP
67.B getrpcent()
68reads the next line of the file, opening the file if necessary.
69.LP
6546fec2 70.B setrpcent()
fea681da
MK
71opens and rewinds the file. If the
72.I stayopen
73flag is non-zero,
74the net data base will not be closed after each call to
75.B getrpcent()
76(either directly, or indirectly through one of
77the other \*(lqgetrpc\*(rq calls).
78.LP
e511ffb6 79.BR endrpcent ()
fea681da
MK
80closes the file.
81.LP
82.B getrpcbyname()
83and
84.B getrpcbynumber()
85sequentially search from the beginning
86of the file until a matching rpc program name or
87program number is found, or until end-of-file is encountered.
88.SH FILES
89.PD 0
90.TP 20
91.B /etc/rpc
92.PD
93.SH "SEE ALSO"
94.BR rpc (5),
95.BR rpcinfo (8),
96.BR ypserv (8)
97.SH DIAGNOSTICS
98.LP
99A
100.SM NULL
101pointer is returned on
102.SM EOF
103or error.
104.SH BUGS
105.LP
106All information
107is contained in a static area
108so it must be copied if it is
109to be saved.