2008-01-01 07:47:27 +00:00
|
|
|
.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
|
2006-05-31 22:43:24 +00:00
|
|
|
.\"
|
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
|
2008-08-18 13:40:35 +00:00
|
|
|
.TH GETRPCENT 3 2008-08-19 "" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2007-07-08 14:47:01 +00:00
|
|
|
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
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getrpcent (),
|
|
|
|
.BR getrpcbyname (),
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-10-19 07:07:02 +00:00
|
|
|
.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
|
2008-08-13 05:17:08 +00:00
|
|
|
fields of an entry in the RPC program number data base.
|
2007-12-19 06:16:04 +00:00
|
|
|
.in +4n
|
2004-11-03 13:51:07 +00:00
|
|
|
.nf
|
2007-12-23 08:20:39 +00:00
|
|
|
|
2007-12-19 05:53:30 +00:00
|
|
|
struct rpcent {
|
2008-08-13 05:17:08 +00:00
|
|
|
char *r_name; /* name of server for this RPC program */
|
2007-12-19 05:53:30 +00:00
|
|
|
char **r_aliases; /* alias list */
|
2008-08-13 05:17:08 +00:00
|
|
|
long r_number; /* RPC program number */
|
2004-11-03 13:51:07 +00:00
|
|
|
};
|
|
|
|
.fi
|
2007-12-19 06:16:04 +00:00
|
|
|
.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
|
2008-08-13 05:17:08 +00:00
|
|
|
The name of the server for this RPC program.
|
2007-12-19 05:53:30 +00:00
|
|
|
.TP
|
2007-06-23 07:56:56 +00:00
|
|
|
.I r_aliases
|
2008-08-13 05:17:08 +00:00
|
|
|
A NULL-terminated list of alternate names for the RPC program.
|
2007-12-19 05:53:30 +00:00
|
|
|
.TP
|
2007-06-23 07:56:56 +00:00
|
|
|
.I r_number
|
2008-08-13 05:17:08 +00:00
|
|
|
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
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getrpcent ()
|
2008-08-13 05:17:08 +00:00
|
|
|
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
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR setrpcent ()
|
2008-08-13 05:17:08 +00:00
|
|
|
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
|
2008-08-13 05:17:08 +00:00
|
|
|
The
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR endrpcent ()
|
2008-08-13 05:17:08 +00:00
|
|
|
function closes the connection to the database.
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getrpcbyname ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getrpcbynumber ()
|
2004-11-03 13:51:07 +00:00
|
|
|
sequentially search from the beginning
|
2008-08-13 05:17:08 +00:00
|
|
|
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.
|
2007-05-16 17:35:34 +00:00
|
|
|
.SH RETURN VALUE
|
2008-08-18 13:39:50 +00:00
|
|
|
On success,
|
|
|
|
.BR getrpcent (),
|
|
|
|
.BR getrpcbyname (),
|
|
|
|
and
|
|
|
|
.BR getrpcbynumber ()
|
2009-01-22 19:53:07 +00:00
|
|
|
return a pointer to a statically allocated
|
2008-08-18 13:39:50 +00:00
|
|
|
.I rpcent
|
|
|
|
structure.
|
2007-12-30 06:09:59 +00:00
|
|
|
A NULL pointer is returned on EOF or error.
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH FILES
|
2008-08-13 05:17:08 +00:00
|
|
|
.TP
|
2007-05-19 04:30:20 +00:00
|
|
|
.I /etc/rpc
|
2008-08-13 05:17:08 +00:00
|
|
|
RPC program number database.
|
2007-05-19 04:30:20 +00:00
|
|
|
.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"
|
2008-08-18 13:39:50 +00:00
|
|
|
.BR getrpcent_r (3),
|
2007-05-16 18:25:50 +00:00
|
|
|
.BR rpc (5),
|
|
|
|
.BR rpcinfo (8),
|
|
|
|
.BR ypserv (8)
|