]>
Commit | Line | Data |
---|---|---|
2297bf0e MK |
1 | .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
2 | .\" | |
6d1cd1d7 | 3 | .\" %%%LICENSE_START(BSD_ONELINE_CDROM) |
eaa88fd8 | 4 | .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
8ff7380d | 5 | .\" %%%LICENSE_END |
cc3832e9 | 6 | .\" |
fea681da | 7 | .\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI |
4b8c67d9 | 8 | .TH GETRPCENT 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da | 9 | .SH NAME |
68440130 MK |
10 | getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get |
11 | RPC entry | |
fea681da MK |
12 | .SH SYNOPSIS |
13 | .nf | |
4eea7467 | 14 | .B #include <netdb.h> |
dbfe9c70 | 15 | .PP |
4eea7467 | 16 | .BI "struct rpcent *getrpcent(void);" |
dbfe9c70 | 17 | .PP |
d2ff71f9 | 18 | .BI "struct rpcent *getrpcbyname(const char *" name ); |
dbfe9c70 | 19 | .PP |
4eea7467 | 20 | .BI "struct rpcent *getrpcbynumber(int " number ); |
dbfe9c70 | 21 | .PP |
4eea7467 | 22 | .BI "void setrpcent(int " stayopen ); |
dbfe9c70 | 23 | .PP |
4eea7467 | 24 | .BI "void endrpcent(void);" |
fea681da MK |
25 | .fi |
26 | .SH DESCRIPTION | |
dd3568a1 | 27 | .PP |
4a384985 | 28 | The |
63aa9df0 MK |
29 | .BR getrpcent (), |
30 | .BR getrpcbyname (), | |
fea681da | 31 | and |
63aa9df0 | 32 | .BR getrpcbynumber () |
4a384985 | 33 | functions each return a pointer to an object with the |
24101960 | 34 | following structure containing the broken-out |
8dea53c5 | 35 | fields of an entry in the RPC program number data base. |
e646a1ba | 36 | .PP |
bd191423 | 37 | .in +4n |
e646a1ba | 38 | .EX |
a08ea57c | 39 | struct rpcent { |
8dea53c5 | 40 | char *r_name; /* name of server for this RPC program */ |
a08ea57c | 41 | char **r_aliases; /* alias list */ |
8dea53c5 | 42 | long r_number; /* RPC program number */ |
fea681da | 43 | }; |
b8302363 | 44 | .EE |
bd191423 | 45 | .in |
dd3568a1 | 46 | .PP |
fea681da | 47 | The members of this structure are: |
24101960 MK |
48 | .RS 4 |
49 | .TP 12 | |
f19a0f03 | 50 | .I r_name |
8dea53c5 | 51 | The name of the server for this RPC program. |
a08ea57c | 52 | .TP |
f19a0f03 | 53 | .I r_aliases |
8dea53c5 | 54 | A NULL-terminated list of alternate names for the RPC program. |
a08ea57c | 55 | .TP |
f19a0f03 | 56 | .I r_number |
8dea53c5 | 57 | The RPC program number for this service. |
24101960 | 58 | .RE |
dd3568a1 | 59 | .PP |
4a384985 | 60 | The |
63aa9df0 | 61 | .BR getrpcent () |
4a384985 | 62 | function reads the next entry from the database. |
8dea53c5 | 63 | A connection is opened to the database if necessary. |
dd3568a1 | 64 | .PP |
4a384985 | 65 | The |
63aa9df0 | 66 | .BR setrpcent () |
8dea53c5 MK |
67 | function opens a connection to the database, |
68 | and sets the next entry to the first entry. | |
c6fa0841 MK |
69 | If |
70 | .I stayopen | |
71 | is nonzero, | |
8dea53c5 MK |
72 | then the connection to the database |
73 | will not be closed between calls to one of the | |
74 | .BR getrpc* () | |
75 | functions. | |
dd3568a1 | 76 | .PP |
8dea53c5 | 77 | The |
e511ffb6 | 78 | .BR endrpcent () |
8dea53c5 | 79 | function closes the connection to the database. |
dd3568a1 | 80 | .PP |
4a384985 | 81 | The |
63aa9df0 | 82 | .BR getrpcbyname () |
fea681da | 83 | and |
63aa9df0 | 84 | .BR getrpcbynumber () |
4a384985 | 85 | functions sequentially search from the beginning |
8dea53c5 | 86 | of the file until a matching RPC program name or |
fea681da | 87 | program number is found, or until end-of-file is encountered. |
8af1ba10 | 88 | .SH RETURN VALUE |
065f4a0f MK |
89 | On success, |
90 | .BR getrpcent (), | |
91 | .BR getrpcbyname (), | |
92 | and | |
93 | .BR getrpcbynumber () | |
bb955443 | 94 | return a pointer to a statically allocated |
065f4a0f MK |
95 | .I rpcent |
96 | structure. | |
b437fdd9 | 97 | NULL is returned on EOF or error. |
2b2581ee | 98 | .SH FILES |
8dea53c5 | 99 | .TP |
2b2581ee | 100 | .I /etc/rpc |
8dea53c5 | 101 | RPC program number database. |
b4f1e052 ZL |
102 | .SH ATTRIBUTES |
103 | For an explanation of the terms used in this section, see | |
104 | .BR attributes (7). | |
105 | .TS | |
106 | allbox; | |
ea48f0aa | 107 | lbw28 lb lb |
b4f1e052 ZL |
108 | l l l. |
109 | Interface Attribute Value | |
110 | T{ | |
111 | .BR getrpcent (), | |
112 | .BR getrpcbyname (), | |
ea48f0aa | 113 | .br |
b4f1e052 ZL |
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 | |
847e0d88 | 121 | .sp 1 |
47297adb | 122 | .SH CONFORMING TO |
c5cca5ce | 123 | Not in POSIX.1. |
2b2581ee | 124 | Present on the BSDs, Solaris, and many other systems. |
fea681da | 125 | .SH BUGS |
fea681da MK |
126 | All information |
127 | is contained in a static area | |
128 | so it must be copied if it is | |
129 | to be saved. | |
47297adb | 130 | .SH SEE ALSO |
065f4a0f | 131 | .BR getrpcent_r (3), |
e37e3282 MK |
132 | .BR rpc (5), |
133 | .BR rpcinfo (8), | |
134 | .BR ypserv (8) |