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