]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI |
2 | .TH GETRPCENT 3 1987-12-14 | |
3 | .SH NAME | |
4 | getrpcent, getrpcbyname, getrpcbynumber \- get RPC entry | |
5 | .SH SYNOPSIS | |
6 | .nf | |
7 | .ft B | |
8 | #include <netdb.h> | |
9 | .LP | |
10 | .ft B | |
11 | struct rpcent *getrpcent() | |
12 | .LP | |
13 | .ft B | |
14 | struct rpcent *getrpcbyname(name) | |
15 | char *name; | |
16 | .LP | |
17 | .ft B | |
18 | struct rpcent *getrpcbynumber(number) | |
19 | int number; | |
20 | .LP | |
21 | .ft B | |
22 | setrpcent (stayopen) | |
23 | int stayopen; | |
24 | .LP | |
25 | .ft B | |
26 | endrpcent () | |
27 | .fi | |
28 | .SH DESCRIPTION | |
29 | .LP | |
30 | .BR getrpcent() , | |
31 | .BR getrpcbyname() , | |
32 | and | |
33 | .B getrpcbynumber() | |
34 | each return a pointer to an object with the | |
35 | following structure | |
36 | containing the broken-out | |
37 | fields of a line in the rpc program number data base, | |
38 | .BR /etc/rpc . | |
39 | .RS | |
40 | .LP | |
41 | .nf | |
42 | .ft B | |
43 | struct rpcent { | |
44 | char *r_name; /* name of server for this rpc program */ | |
45 | char **r_aliases; /* alias list */ | |
46 | long r_number; /* rpc program number */ | |
47 | }; | |
48 | .ft R | |
49 | .fi | |
50 | .RE | |
51 | .LP | |
52 | The members of this structure are: | |
53 | .RS | |
54 | .PD 0 | |
55 | .TP 20 | |
56 | .B r_name | |
57 | The name of the server for this rpc program. | |
58 | .TP 20 | |
59 | .B r_aliases | |
60 | A zero terminated list of alternate names for the rpc program. | |
61 | .TP 20 | |
62 | .B r_number | |
63 | The rpc program number for this service. | |
64 | .PD | |
65 | .RE | |
66 | .LP | |
67 | .B getrpcent() | |
68 | reads the next line of the file, opening the file if necessary. | |
69 | .LP | |
6546fec2 | 70 | .B setrpcent() |
fea681da MK |
71 | opens and rewinds the file. If the |
72 | .I stayopen | |
73 | flag is non-zero, | |
74 | the net data base will not be closed after each call to | |
75 | .B getrpcent() | |
76 | (either directly, or indirectly through one of | |
77 | the other \*(lqgetrpc\*(rq calls). | |
78 | .LP | |
e511ffb6 | 79 | .BR endrpcent () |
fea681da MK |
80 | closes the file. |
81 | .LP | |
82 | .B getrpcbyname() | |
83 | and | |
84 | .B getrpcbynumber() | |
85 | sequentially search from the beginning | |
86 | of the file until a matching rpc program name or | |
87 | program number is found, or until end-of-file is encountered. | |
88 | .SH FILES | |
89 | .PD 0 | |
90 | .TP 20 | |
91 | .B /etc/rpc | |
92 | .PD | |
93 | .SH "SEE ALSO" | |
94 | .BR rpc (5), | |
95 | .BR rpcinfo (8), | |
96 | .BR ypserv (8) | |
97 | .SH DIAGNOSTICS | |
98 | .LP | |
99 | A | |
100 | .SM NULL | |
101 | pointer is returned on | |
102 | .SM EOF | |
103 | or error. | |
104 | .SH BUGS | |
105 | .LP | |
106 | All information | |
107 | is contained in a static area | |
108 | so it must be copied if it is | |
109 | to be saved. |