1GETRPCENT(3) BSD Library Functions Manual GETRPCENT(3)
2
4 getrpcent, getrpcbyname, getrpcbynumber, endrpcent, setrpcent — get RPC
5 entry
6
8 Standard C Library (libc, -lc)
9
11 #include <rpc/rpc.h>
12
13 struct rpcent *
14 getrpcent(void);
15
16 struct rpcent *
17 getrpcbyname(char *name);
18
19 struct rpcent *
20 getrpcbynumber(int number);
21
22 void
23 setrpcent(int stayopen);
24
25 void
26 endrpcent(void);
27
29 The getrpcent(), getrpcbyname(), and getrpcbynumber() functions each
30 return a pointer to an object with the following structure containing the
31 broken-out fields of a line in the rpc program number data base,
32 /etc/rpc:
33
34 struct rpcent {
35 char *r_name; /* name of server for this rpc program */
36 char **r_aliases; /* alias list */
37 long r_number; /* rpc program number */
38 };
39
40 The members of this structure are:
41
42 r_name The name of the server for this rpc program.
43
44 r_aliases A zero terminated list of alternate names for the rpc
45 program.
46
47 r_number The rpc program number for this service.
48
49 The getrpcent() function reads the next line of the file, opening the
50 file if necessary.
51
52 The setrpcent() function opens and rewinds the file. If the stayopen
53 flag is non-zero, the net data base will not be closed after each call to
54 getrpcent() (either directly, or indirectly through one of the other
55 “getrpc” calls).
56
57 The endrpcent() function closes the file.
58
59 The getrpcbyname() and getrpcbynumber() functions sequentially search
60 from the beginning of the file until a matching rpc program name or pro‐
61 gram number is found, or until end-of-file is encountered.
62
64 /etc/rpc
65
67 rpc(5), rpcinfo(8), ypserv(8)
68
70 A NULL pointer is returned on EOF or error.
71
73 All information is contained in a static area so it must be copied if it
74 is to be saved.
75
76BSD December 14, 1987 BSD