1GETRPCENT(3) Linux Programmer's Manual GETRPCENT(3)
2
3
4
6 getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent - get RPC
7 entry
8
10 #include <netdb.h>
11
12 struct rpcent *getrpcent(void);
13
14 struct rpcent *getrpcbyname(char *name);
15
16 struct rpcent *getrpcbynumber(int number);
17
18 void setrpcent(int stayopen);
19
20 void endrpcent(void);
21
23 getrpcent(), getrpcbyname(), and getrpcbynumber() each return a pointer
24 to an object with the following structure containing the broken-out
25 fields of an entry in the RPC program number data base.
26
27 struct rpcent {
28 char *r_name; /* name of server for this RPC program */
29 char **r_aliases; /* alias list */
30 long r_number; /* RPC program number */
31 };
32
33 The members of this structure are:
34
35 r_name The name of the server for this RPC program.
36
37 r_aliases A NULL-terminated list of alternate names for the RPC
38 program.
39
40 r_number The RPC program number for this service.
41
42 getrpcent() reads the next entry from the database. A connection is
43 opened to the database if necessary.
44
45 setrpcent() function opens a connection to the database, and sets the
46 next entry to the first entry. If stayopen is non-zero, then the con‐
47 nection to the database will not be closed between calls to one of the
48 getrpc*() functions.
49
50 The endrpcent() function closes the connection to the database.
51
52 getrpcbyname() and getrpcbynumber() sequentially search from the begin‐
53 ning of the file until a matching RPC program name or program number is
54 found, or until end-of-file is encountered.
55
57 On success, getrpcent(), getrpcbyname(), and getrpcbynumber() return a
58 pointer to a statically allocated rpcent structure. A NULL pointer is
59 returned on EOF or error.
60
62 /etc/rpc
63 RPC program number database.
64
66 Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other sys‐
67 tems.
68
70 All information is contained in a static area so it must be copied if
71 it is to be saved.
72
74 getrpcent_r(3), rpc(5), rpcinfo(8), ypserv(8)
75
77 This page is part of release 3.22 of the Linux man-pages project. A
78 description of the project, and information about reporting bugs, can
79 be found at http://www.kernel.org/doc/man-pages/.
80
81
82
83 2008-08-19 GETRPCENT(3)