]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent.3
_syscall.2, clock_getres.2, clone.2, copy_file_range.2, create_module.2, delete_modul...
[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
5722c835 8.TH GETRPCENT 3 2015-07-23 "" "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
27.LP
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.
bd191423 36.in +4n
fea681da 37.nf
62218dc0 38
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};
fea681da 44.fi
bd191423 45.in
fea681da
MK
46.LP
47The members of this structure are:
24101960
MK
48.RS 4
49.TP 12
f19a0f03 50.I r_name
8dea53c5 51The name of the server for this RPC program.
a08ea57c 52.TP
f19a0f03 53.I r_aliases
8dea53c5 54A NULL-terminated list of alternate names for the RPC program.
a08ea57c 55.TP
f19a0f03 56.I r_number
8dea53c5 57The RPC program number for this service.
24101960 58.RE
fea681da 59.LP
4a384985 60The
63aa9df0 61.BR getrpcent ()
4a384985 62function reads the next entry from the database.
8dea53c5 63A connection is opened to the database if necessary.
fea681da 64.LP
4a384985 65The
63aa9df0 66.BR setrpcent ()
8dea53c5
MK
67function opens a connection to the database,
68and sets the next entry to the first entry.
c6fa0841
MK
69If
70.I stayopen
71is nonzero,
8dea53c5
MK
72then the connection to the database
73will not be closed between calls to one of the
74.BR getrpc* ()
75functions.
fea681da 76.LP
8dea53c5 77The
e511ffb6 78.BR endrpcent ()
8dea53c5 79function closes the connection to the database.
fea681da 80.LP
4a384985 81The
63aa9df0 82.BR getrpcbyname ()
fea681da 83and
63aa9df0 84.BR getrpcbynumber ()
4a384985 85functions sequentially search from the beginning
8dea53c5 86of the file until a matching RPC program name or
fea681da 87program number is found, or until end-of-file is encountered.
8af1ba10 88.SH RETURN VALUE
065f4a0f
MK
89On success,
90.BR getrpcent (),
91.BR getrpcbyname (),
92and
93.BR getrpcbynumber ()
bb955443 94return a pointer to a statically allocated
065f4a0f
MK
95.I rpcent
96structure.
b437fdd9 97NULL is returned on EOF or error.
2b2581ee 98.SH FILES
8dea53c5 99.TP
2b2581ee 100.I /etc/rpc
8dea53c5 101RPC program number database.
b4f1e052
ZL
102.SH ATTRIBUTES
103For an explanation of the terms used in this section, see
104.BR attributes (7).
105.TS
106allbox;
ea48f0aa 107lbw28 lb lb
b4f1e052
ZL
108l l l.
109Interface Attribute Value
110T{
111.BR getrpcent (),
112.BR getrpcbyname (),
ea48f0aa 113.br
b4f1e052
ZL
114.BR getrpcbynumber ()
115T} Thread safety MT-Unsafe
116T{
117.BR setrpcent (),
118.BR endrpcent ()
119T} Thread safety MT-Safe locale
120.TE
121
47297adb 122.SH CONFORMING TO
c5cca5ce 123Not in POSIX.1.
2b2581ee 124Present on the BSDs, Solaris, and many other systems.
fea681da 125.SH BUGS
fea681da
MK
126All information
127is contained in a static area
128so it must be copied if it is
129to be saved.
47297adb 130.SH SEE ALSO
065f4a0f 131.BR getrpcent_r (3),
e37e3282
MK
132.BR rpc (5),
133.BR rpcinfo (8),
134.BR ypserv (8)