]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getrpcent.3
execve.2, setfsgid.2, setfsuid.2, splice.2, fopen.3, malloc_trim.3, posix_memalign...
[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 2017-09-15 "" "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 .RS 4
49 .TP 12
50 .I r_name
51 The name of the server for this RPC program.
52 .TP
53 .I r_aliases
54 A NULL-terminated list of alternate names for the RPC program.
55 .TP
56 .I r_number
57 The RPC program number for this service.
58 .RE
59 .PP
60 The
61 .BR getrpcent ()
62 function reads the next entry from the database.
63 A connection is opened to the database if necessary.
64 .PP
65 The
66 .BR setrpcent ()
67 function opens a connection to the database,
68 and sets the next entry to the first entry.
69 If
70 .I stayopen
71 is nonzero,
72 then the connection to the database
73 will not be closed between calls to one of the
74 .BR getrpc* ()
75 functions.
76 .PP
77 The
78 .BR endrpcent ()
79 function closes the connection to the database.
80 .PP
81 The
82 .BR getrpcbyname ()
83 and
84 .BR getrpcbynumber ()
85 functions sequentially search from the beginning
86 of the file until a matching RPC program name or
87 program number is found, or until end-of-file is encountered.
88 .SH RETURN VALUE
89 On success,
90 .BR getrpcent (),
91 .BR getrpcbyname (),
92 and
93 .BR getrpcbynumber ()
94 return a pointer to a statically allocated
95 .I rpcent
96 structure.
97 NULL is returned on EOF or error.
98 .SH FILES
99 .TP
100 .I /etc/rpc
101 RPC program number database.
102 .SH ATTRIBUTES
103 For an explanation of the terms used in this section, see
104 .BR attributes (7).
105 .TS
106 allbox;
107 lbw28 lb lb
108 l l l.
109 Interface Attribute Value
110 T{
111 .BR getrpcent (),
112 .BR getrpcbyname (),
113 .br
114 .BR getrpcbynumber ()
115 T} Thread safety MT-Unsafe
116 T{
117 .BR setrpcent (),
118 .BR endrpcent ()
119 T} Thread safety MT-Safe locale
120 .TE
121 .sp 1
122 .SH CONFORMING TO
123 Not in POSIX.1.
124 Present on the BSDs, Solaris, and many other systems.
125 .SH BUGS
126 All information
127 is contained in a static area
128 so it must be copied if it is
129 to be saved.
130 .SH SEE ALSO
131 .BR getrpcent_r (3),
132 .BR rpc (5),
133 .BR rpcinfo (8),
134 .BR ypserv (8)