]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent.3
ctime.3: wfix
[thirdparty/man-pages.git] / man3 / getrpcent.3
CommitLineData
2297bf0e
MK
1.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2.\"
6d1cd1d7 3.\" %%%LICENSE_START(BSD_ONELINE_CDROM)
eaa88fd8 4.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
8ff7380d 5.\" %%%LICENSE_END
cc3832e9 6.\"
fea681da 7.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
e8426ca2 8.TH GETRPCENT 3 2020-04-11 "" "Linux Programmer's Manual"
fea681da 9.SH NAME
68440130
MK
10getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
11RPC entry
fea681da
MK
12.SH SYNOPSIS
13.nf
4eea7467 14.B #include <netdb.h>
dbfe9c70 15.PP
4eea7467 16.BI "struct rpcent *getrpcent(void);"
dbfe9c70 17.PP
d2ff71f9 18.BI "struct rpcent *getrpcbyname(const char *" name );
dbfe9c70 19.PP
4eea7467 20.BI "struct rpcent *getrpcbynumber(int " number );
dbfe9c70 21.PP
4eea7467 22.BI "void setrpcent(int " stayopen );
dbfe9c70 23.PP
4eea7467 24.BI "void endrpcent(void);"
fea681da
MK
25.fi
26.SH DESCRIPTION
dd3568a1 27.PP
4a384985 28The
63aa9df0
MK
29.BR getrpcent (),
30.BR getrpcbyname (),
fea681da 31and
63aa9df0 32.BR getrpcbynumber ()
4a384985 33functions each return a pointer to an object with the
24101960 34following structure containing the broken-out
8dea53c5 35fields of an entry in the RPC program number data base.
e646a1ba 36.PP
bd191423 37.in +4n
e646a1ba 38.EX
a08ea57c 39struct rpcent {
8dea53c5 40 char *r_name; /* name of server for this RPC program */
a08ea57c 41 char **r_aliases; /* alias list */
8dea53c5 42 long r_number; /* RPC program number */
fea681da 43};
b8302363 44.EE
bd191423 45.in
dd3568a1 46.PP
fea681da 47The members of this structure are:
0019177e 48.TP
f19a0f03 49.I r_name
8dea53c5 50The name of the server for this RPC program.
a08ea57c 51.TP
f19a0f03 52.I r_aliases
8dea53c5 53A NULL-terminated list of alternate names for the RPC program.
a08ea57c 54.TP
f19a0f03 55.I r_number
8dea53c5 56The RPC program number for this service.
dd3568a1 57.PP
4a384985 58The
63aa9df0 59.BR getrpcent ()
4a384985 60function reads the next entry from the database.
8dea53c5 61A connection is opened to the database if necessary.
dd3568a1 62.PP
4a384985 63The
63aa9df0 64.BR setrpcent ()
8dea53c5
MK
65function opens a connection to the database,
66and sets the next entry to the first entry.
c6fa0841
MK
67If
68.I stayopen
69is nonzero,
8dea53c5
MK
70then the connection to the database
71will not be closed between calls to one of the
72.BR getrpc* ()
73functions.
dd3568a1 74.PP
8dea53c5 75The
e511ffb6 76.BR endrpcent ()
8dea53c5 77function closes the connection to the database.
dd3568a1 78.PP
4a384985 79The
63aa9df0 80.BR getrpcbyname ()
fea681da 81and
63aa9df0 82.BR getrpcbynumber ()
4a384985 83functions sequentially search from the beginning
8dea53c5 84of the file until a matching RPC program name or
fea681da 85program number is found, or until end-of-file is encountered.
8af1ba10 86.SH RETURN VALUE
065f4a0f
MK
87On success,
88.BR getrpcent (),
89.BR getrpcbyname (),
90and
91.BR getrpcbynumber ()
bb955443 92return a pointer to a statically allocated
065f4a0f
MK
93.I rpcent
94structure.
b437fdd9 95NULL is returned on EOF or error.
2b2581ee 96.SH FILES
8dea53c5 97.TP
2b2581ee 98.I /etc/rpc
8dea53c5 99RPC program number database.
b4f1e052
ZL
100.SH ATTRIBUTES
101For an explanation of the terms used in this section, see
102.BR attributes (7).
103.TS
104allbox;
ea48f0aa 105lbw28 lb lb
b4f1e052
ZL
106l l l.
107Interface Attribute Value
108T{
109.BR getrpcent (),
110.BR getrpcbyname (),
ea48f0aa 111.br
b4f1e052
ZL
112.BR getrpcbynumber ()
113T} Thread safety MT-Unsafe
114T{
115.BR setrpcent (),
116.BR endrpcent ()
117T} Thread safety MT-Safe locale
118.TE
847e0d88 119.sp 1
47297adb 120.SH CONFORMING TO
c5cca5ce 121Not in POSIX.1.
2b2581ee 122Present on the BSDs, Solaris, and many other systems.
fea681da 123.SH BUGS
fea681da
MK
124All information
125is contained in a static area
126so it must be copied if it is
127to be saved.
47297adb 128.SH SEE ALSO
065f4a0f 129.BR getrpcent_r (3),
e37e3282
MK
130.BR rpc (5),
131.BR rpcinfo (8),
132.BR ypserv (8)