man-pages/man3/getrpcent.3

97 lines
2.2 KiB
Groff
Raw Normal View History

2008-01-01 07:47:27 +00:00
.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
.\"
2004-11-03 13:51:07 +00:00
.\" @(#)getrpcent.3n 2.2 88/08/02 4.0 RPCSRC; from 1.11 88/03/14 SMI
.TH GETRPCENT 3 2008-08-13 "" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get
RPC entry
2004-11-03 13:51:07 +00:00
.SH SYNOPSIS
.nf
2007-12-23 07:50:04 +00:00
.B #include <netdb.h>
.BI "struct rpcent *getrpcent(void);"
.BI "struct rpcent *getrpcbyname(char *" name );
.BI "struct rpcent *getrpcbynumber(int " number );
.BI "void setrpcent(int " stayopen );
.BI "void endrpcent(void);"
2004-11-03 13:51:07 +00:00
.fi
.SH DESCRIPTION
.LP
.BR getrpcent (),
.BR getrpcbyname (),
2004-11-03 13:51:07 +00:00
and
.BR getrpcbynumber ()
2004-11-03 13:51:07 +00:00
each return a pointer to an object with the
2007-12-30 06:09:59 +00:00
following structure containing the broken-out
fields of an entry in the RPC program number data base.
.in +4n
2004-11-03 13:51:07 +00:00
.nf
2007-12-23 08:20:39 +00:00
struct rpcent {
char *r_name; /* name of server for this RPC program */
char **r_aliases; /* alias list */
long r_number; /* RPC program number */
2004-11-03 13:51:07 +00:00
};
.fi
.in
2004-11-03 13:51:07 +00:00
.LP
The members of this structure are:
2007-12-30 06:09:59 +00:00
.RS 4
.TP 12
2007-06-23 07:56:56 +00:00
.I r_name
The name of the server for this RPC program.
.TP
2007-06-23 07:56:56 +00:00
.I r_aliases
A NULL-terminated list of alternate names for the RPC program.
.TP
2007-06-23 07:56:56 +00:00
.I r_number
The RPC program number for this service.
2007-12-30 06:09:59 +00:00
.RE
2004-11-03 13:51:07 +00:00
.LP
.BR getrpcent ()
reads the next entry from the database.
A connection is opened to the database if necessary.
2004-11-03 13:51:07 +00:00
.LP
.BR setrpcent ()
function opens a connection to the database,
and sets the next entry to the first entry.
If \fIstayopen\fP is non-zero,
then the connection to the database
will not be closed between calls to one of the
.BR getrpc* ()
functions.
2004-11-03 13:51:07 +00:00
.LP
The
.BR endrpcent ()
function closes the connection to the database.
2004-11-03 13:51:07 +00:00
.LP
.BR getrpcbyname ()
2004-11-03 13:51:07 +00:00
and
.BR getrpcbynumber ()
2004-11-03 13:51:07 +00:00
sequentially search from the beginning
of the file until a matching RPC program name or
2004-11-03 13:51:07 +00:00
program number is found, or until end-of-file is encountered.
.SH RETURN VALUE
2004-11-03 13:51:07 +00:00
.LP
2007-12-30 06:09:59 +00:00
A NULL pointer is returned on EOF or error.
.SH FILES
.TP
.I /etc/rpc
RPC program number database.
.SH "CONFORMING TO"
Not in POSIX.1-2001.
Present on the BSDs, Solaris, and many other systems.
2004-11-03 13:51:07 +00:00
.SH BUGS
All information
is contained in a static area
so it must be copied if it is
to be saved.
2007-05-16 18:25:50 +00:00
.SH "SEE ALSO"
.BR rpc (5),
.BR rpcinfo (8),
.BR ypserv (8)