]>
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 |
e8426ca2 | 8 | .TH GETRPCENT 3 2020-04-11 "" "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: |
0019177e | 48 | .TP |
f19a0f03 | 49 | .I r_name |
8dea53c5 | 50 | The name of the server for this RPC program. |
a08ea57c | 51 | .TP |
f19a0f03 | 52 | .I r_aliases |
8dea53c5 | 53 | A NULL-terminated list of alternate names for the RPC program. |
a08ea57c | 54 | .TP |
f19a0f03 | 55 | .I r_number |
8dea53c5 | 56 | The RPC program number for this service. |
dd3568a1 | 57 | .PP |
4a384985 | 58 | The |
63aa9df0 | 59 | .BR getrpcent () |
4a384985 | 60 | function reads the next entry from the database. |
8dea53c5 | 61 | A connection is opened to the database if necessary. |
dd3568a1 | 62 | .PP |
4a384985 | 63 | The |
63aa9df0 | 64 | .BR setrpcent () |
8dea53c5 MK |
65 | function opens a connection to the database, |
66 | and sets the next entry to the first entry. | |
c6fa0841 MK |
67 | If |
68 | .I stayopen | |
69 | is nonzero, | |
8dea53c5 MK |
70 | then the connection to the database |
71 | will not be closed between calls to one of the | |
72 | .BR getrpc* () | |
73 | functions. | |
dd3568a1 | 74 | .PP |
8dea53c5 | 75 | The |
e511ffb6 | 76 | .BR endrpcent () |
8dea53c5 | 77 | function closes the connection to the database. |
dd3568a1 | 78 | .PP |
4a384985 | 79 | The |
63aa9df0 | 80 | .BR getrpcbyname () |
fea681da | 81 | and |
63aa9df0 | 82 | .BR getrpcbynumber () |
4a384985 | 83 | functions sequentially search from the beginning |
8dea53c5 | 84 | of the file until a matching RPC program name or |
fea681da | 85 | program number is found, or until end-of-file is encountered. |
8af1ba10 | 86 | .SH RETURN VALUE |
065f4a0f MK |
87 | On success, |
88 | .BR getrpcent (), | |
89 | .BR getrpcbyname (), | |
90 | and | |
91 | .BR getrpcbynumber () | |
bb955443 | 92 | return a pointer to a statically allocated |
065f4a0f MK |
93 | .I rpcent |
94 | structure. | |
b437fdd9 | 95 | NULL is returned on EOF or error. |
2b2581ee | 96 | .SH FILES |
8dea53c5 | 97 | .TP |
2b2581ee | 98 | .I /etc/rpc |
8dea53c5 | 99 | RPC program number database. |
b4f1e052 ZL |
100 | .SH ATTRIBUTES |
101 | For an explanation of the terms used in this section, see | |
102 | .BR attributes (7). | |
103 | .TS | |
104 | allbox; | |
ea48f0aa | 105 | lbw28 lb lb |
b4f1e052 ZL |
106 | l l l. |
107 | Interface Attribute Value | |
108 | T{ | |
109 | .BR getrpcent (), | |
110 | .BR getrpcbyname (), | |
ea48f0aa | 111 | .br |
b4f1e052 ZL |
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 | |
847e0d88 | 119 | .sp 1 |
47297adb | 120 | .SH CONFORMING TO |
c5cca5ce | 121 | Not in POSIX.1. |
2b2581ee | 122 | Present on the BSDs, Solaris, and many other systems. |
fea681da | 123 | .SH BUGS |
fea681da MK |
124 | All information |
125 | is contained in a static area | |
126 | so it must be copied if it is | |
127 | to be saved. | |
47297adb | 128 | .SH SEE ALSO |
065f4a0f | 129 | .BR getrpcent_r (3), |
e37e3282 MK |
130 | .BR rpc (5), |
131 | .BR rpcinfo (8), | |
132 | .BR ypserv (8) |