Debian Codegraph @

upstream/debian-trixie/man3/getrpcent.3

raw
1 '\" t
2 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
3 .\"
4 .\" %%%LICENSE_START(BSD_ONELINE_CDROM)
5 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
6 .\" %%%LICENSE_END
7 .\"
8 .\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
9 .TH getrpcent 3 2024-05-02 "Linux man-pages 6.9.1"
10 .SH NAME
11 getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
12 RPC entry
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <netdb.h>
19 .P
20 .B struct rpcent *getrpcent(void);
21 .P
22 .BI "struct rpcent *getrpcbyname(const char *" name );
23 .BI "struct rpcent *getrpcbynumber(int " number );
24 .P
25 .BI "void setrpcent(int " stayopen );
26 .B void endrpcent(void);
27 .fi
28 .SH DESCRIPTION
29 The
30 .BR getrpcent (),
31 .BR getrpcbyname (),
32 and
33 .BR getrpcbynumber ()
34 functions each return a pointer to an object with the
35 following structure containing the broken-out
36 fields of an entry in the RPC program number data base.
37 .P
38 .in +4n
39 .EX
40 struct rpcent {
41 char *r_name; /* name of server for this RPC program */
42 char **r_aliases; /* alias list */
43 long r_number; /* RPC program number */
44 };
45 .EE
46 .in
47 .P
48 The members of this structure are:
49 .TP
50 .I r_name
51 The name of the server for this RPC program.
52 .TP
53 .I r_aliases
54 A NULL-terminated list of alternate names for the RPC program.
55 .TP
56 .I r_number
57 The RPC program number for this service.
58 .P
59 The
60 .BR getrpcent ()
61 function reads the next entry from the database.
62 A connection is opened to the database if necessary.
63 .P
64 The
65 .BR setrpcent ()
66 function opens a connection to the database,
67 and sets the next entry to the first entry.
68 If
69 .I stayopen
70 is nonzero,
71 then the connection to the database
72 will not be closed between calls to one of the
73 .BR getrpc* ()
74 functions.
75 .P
76 The
77 .BR endrpcent ()
78 function closes the connection to the database.
79 .P
80 The
81 .BR getrpcbyname ()
82 and
83 .BR getrpcbynumber ()
84 functions sequentially search from the beginning
85 of the file until a matching RPC program name or
86 program number is found, or until end-of-file is encountered.
87 .SH RETURN VALUE
88 On success,
89 .BR getrpcent (),
90 .BR getrpcbyname (),
91 and
92 .BR getrpcbynumber ()
93 return a pointer to a statically allocated
94 .I rpcent
95 structure.
96 NULL is returned on EOF or error.
97 .SH FILES
98 .TP
99 .I /etc/rpc
100 RPC program number database.
101 .SH ATTRIBUTES
102 For an explanation of the terms used in this section, see
103 .BR attributes (7).
104 .TS
105 allbox;
106 lbx lb lb
107 l l l.
108 Interface Attribute Value
109 T{
110 .na
111 .nh
112 .BR getrpcent (),
113 .BR getrpcbyname (),
114 .BR getrpcbynumber ()
115 T} Thread safety MT-Unsafe
116 T{
117 .na
118 .nh
119 .BR setrpcent (),
120 .BR endrpcent ()
121 T} Thread safety MT-Safe locale
122 .TE
123 .SH STANDARDS
124 BSD.
125 .SH HISTORY
126 BSD, Solaris.
127 .SH BUGS
128 All information
129 is contained in a static area
130 so it must be copied if it is
131 to be saved.
132 .SH SEE ALSO
133 .BR getrpcent_r (3),
134 .BR rpc (5),
135 .BR rpcinfo (8),
136 .BR ypserv (8)