]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent.3
time.1, _syscall.2, acct.2, getsockname.2, nanosleep.2, pciconfig_read.2, sched_get_p...
[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
c973f769 8.TH GETRPCENT 3 2008-08-19 "" "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
MK
14.B #include <netdb.h>
15
16.BI "struct rpcent *getrpcent(void);"
17
18.BI "struct rpcent *getrpcbyname(char *" name );
19
20.BI "struct rpcent *getrpcbynumber(int " number );
21
22.BI "void setrpcent(int " stayopen );
23
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.
24101960 97A NULL pointer is returned on EOF or error.
2b2581ee 98.SH FILES
8dea53c5 99.TP
2b2581ee 100.I /etc/rpc
8dea53c5 101RPC program number database.
47297adb 102.SH CONFORMING TO
2b2581ee
MK
103Not in POSIX.1-2001.
104Present on the BSDs, Solaris, and many other systems.
fea681da 105.SH BUGS
fea681da
MK
106All information
107is contained in a static area
108so it must be copied if it is
109to be saved.
47297adb 110.SH SEE ALSO
065f4a0f 111.BR getrpcent_r (3),
e37e3282
MK
112.BR rpc (5),
113.BR rpcinfo (8),
114.BR ypserv (8)