]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / getrpcent.3
CommitLineData
eaa88fd8 1.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
cc3832e9 2.\"
fea681da 3.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
c973f769 4.TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual"
fea681da 5.SH NAME
68440130
MK
6getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
7RPC entry
fea681da
MK
8.SH SYNOPSIS
9.nf
4eea7467
MK
10.B #include <netdb.h>
11
12.BI "struct rpcent *getrpcent(void);"
13
14.BI "struct rpcent *getrpcbyname(char *" name );
15
16.BI "struct rpcent *getrpcbynumber(int " number );
17
18.BI "void setrpcent(int " stayopen );
19
20.BI "void endrpcent(void);"
fea681da
MK
21.fi
22.SH DESCRIPTION
23.LP
4a384985 24The
63aa9df0
MK
25.BR getrpcent (),
26.BR getrpcbyname (),
fea681da 27and
63aa9df0 28.BR getrpcbynumber ()
4a384985 29functions each return a pointer to an object with the
24101960 30following structure containing the broken-out
8dea53c5 31fields of an entry in the RPC program number data base.
bd191423 32.in +4n
fea681da 33.nf
62218dc0 34
a08ea57c 35struct rpcent {
8dea53c5 36 char *r_name; /* name of server for this RPC program */
a08ea57c 37 char **r_aliases; /* alias list */
8dea53c5 38 long r_number; /* RPC program number */
fea681da 39};
fea681da 40.fi
bd191423 41.in
fea681da
MK
42.LP
43The members of this structure are:
24101960
MK
44.RS 4
45.TP 12
f19a0f03 46.I r_name
8dea53c5 47The name of the server for this RPC program.
a08ea57c 48.TP
f19a0f03 49.I r_aliases
8dea53c5 50A NULL-terminated list of alternate names for the RPC program.
a08ea57c 51.TP
f19a0f03 52.I r_number
8dea53c5 53The RPC program number for this service.
24101960 54.RE
fea681da 55.LP
4a384985 56The
63aa9df0 57.BR getrpcent ()
4a384985 58function reads the next entry from the database.
8dea53c5 59A connection is opened to the database if necessary.
fea681da 60.LP
4a384985 61The
63aa9df0 62.BR setrpcent ()
8dea53c5
MK
63function opens a connection to the database,
64and sets the next entry to the first entry.
c7094399 65If \fIstayopen\fP is nonzero,
8dea53c5
MK
66then the connection to the database
67will not be closed between calls to one of the
68.BR getrpc* ()
69functions.
fea681da 70.LP
8dea53c5 71The
e511ffb6 72.BR endrpcent ()
8dea53c5 73function closes the connection to the database.
fea681da 74.LP
4a384985 75The
63aa9df0 76.BR getrpcbyname ()
fea681da 77and
63aa9df0 78.BR getrpcbynumber ()
4a384985 79functions sequentially search from the beginning
8dea53c5 80of the file until a matching RPC program name or
fea681da 81program number is found, or until end-of-file is encountered.
8af1ba10 82.SH RETURN VALUE
065f4a0f
MK
83On success,
84.BR getrpcent (),
85.BR getrpcbyname (),
86and
87.BR getrpcbynumber ()
bb955443 88return a pointer to a statically allocated
065f4a0f
MK
89.I rpcent
90structure.
24101960 91A NULL pointer is returned on EOF or error.
2b2581ee 92.SH FILES
8dea53c5 93.TP
2b2581ee 94.I /etc/rpc
8dea53c5 95RPC program number database.
47297adb 96.SH CONFORMING TO
2b2581ee
MK
97Not in POSIX.1-2001.
98Present on the BSDs, Solaris, and many other systems.
fea681da 99.SH BUGS
fea681da
MK
100All information
101is contained in a static area
102so it must be copied if it is
103to be saved.
47297adb 104.SH SEE ALSO
065f4a0f 105.BR getrpcent_r (3),
e37e3282
MK
106.BR rpc (5),
107.BR rpcinfo (8),
108.BR ypserv (8)