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