]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getrpcent.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / getrpcent.3
1 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2 .\"
3 .\" %%%LICENSE_START(BSD_ONELINE_CDROM)
4 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
5 .\" %%%LICENSE_END
6 .\"
7 .\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
8 .TH GETRPCENT 3 2020-04-11 "" "Linux Programmer's Manual"
9 .SH NAME
10 getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
11 RPC entry
12 .SH SYNOPSIS
13 .nf
14 .B #include <netdb.h>
15 .PP
16 .BI "struct rpcent *getrpcent(void);"
17 .PP
18 .BI "struct rpcent *getrpcbyname(const char *" name );
19 .PP
20 .BI "struct rpcent *getrpcbynumber(int " number );
21 .PP
22 .BI "void setrpcent(int " stayopen );
23 .PP
24 .BI "void endrpcent(void);"
25 .fi
26 .SH DESCRIPTION
27 .PP
28 The
29 .BR getrpcent (),
30 .BR getrpcbyname (),
31 and
32 .BR getrpcbynumber ()
33 functions each return a pointer to an object with the
34 following structure containing the broken-out
35 fields of an entry in the RPC program number data base.
36 .PP
37 .in +4n
38 .EX
39 struct rpcent {
40 char *r_name; /* name of server for this RPC program */
41 char **r_aliases; /* alias list */
42 long r_number; /* RPC program number */
43 };
44 .EE
45 .in
46 .PP
47 The members of this structure are:
48 .TP
49 .I r_name
50 The name of the server for this RPC program.
51 .TP
52 .I r_aliases
53 A NULL-terminated list of alternate names for the RPC program.
54 .TP
55 .I r_number
56 The RPC program number for this service.
57 .PP
58 The
59 .BR getrpcent ()
60 function reads the next entry from the database.
61 A connection is opened to the database if necessary.
62 .PP
63 The
64 .BR setrpcent ()
65 function opens a connection to the database,
66 and sets the next entry to the first entry.
67 If
68 .I stayopen
69 is nonzero,
70 then the connection to the database
71 will not be closed between calls to one of the
72 .BR getrpc* ()
73 functions.
74 .PP
75 The
76 .BR endrpcent ()
77 function closes the connection to the database.
78 .PP
79 The
80 .BR getrpcbyname ()
81 and
82 .BR getrpcbynumber ()
83 functions sequentially search from the beginning
84 of the file until a matching RPC program name or
85 program number is found, or until end-of-file is encountered.
86 .SH RETURN VALUE
87 On success,
88 .BR getrpcent (),
89 .BR getrpcbyname (),
90 and
91 .BR getrpcbynumber ()
92 return a pointer to a statically allocated
93 .I rpcent
94 structure.
95 NULL is returned on EOF or error.
96 .SH FILES
97 .TP
98 .I /etc/rpc
99 RPC program number database.
100 .SH ATTRIBUTES
101 For an explanation of the terms used in this section, see
102 .BR attributes (7).
103 .TS
104 allbox;
105 lbw28 lb lb
106 l l l.
107 Interface Attribute Value
108 T{
109 .BR getrpcent (),
110 .BR getrpcbyname (),
111 .br
112 .BR getrpcbynumber ()
113 T} Thread safety MT-Unsafe
114 T{
115 .BR setrpcent (),
116 .BR endrpcent ()
117 T} Thread safety MT-Safe locale
118 .TE
119 .sp 1
120 .SH CONFORMING TO
121 Not in POSIX.1.
122 Present on the BSDs, Solaris, and many other systems.
123 .SH BUGS
124 All information
125 is contained in a static area
126 so it must be copied if it is
127 to be saved.
128 .SH SEE ALSO
129 .BR getrpcent_r (3),
130 .BR rpc (5),
131 .BR rpcinfo (8),
132 .BR ypserv (8)