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