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
|
2007-12-23 07:50:04 +00:00
|
|
|
.TH GETRPCENT 3 2007-12-23 "" "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
|
2004-11-03 13:51:07 +00:00
|
|
|
fields of a line in the rpc program number data base,
|
2005-11-02 13:55:25 +00:00
|
|
|
.IR /etc/rpc .
|
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 {
|
|
|
|
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
|
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
|
2004-11-03 13:51:07 +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
|
2004-11-03 13:51:07 +00:00
|
|
|
A zero 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
|
2004-11-03 13:51:07 +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 ()
|
2004-11-03 13:51:07 +00:00
|
|
|
reads the next line of the file, opening the file if necessary.
|
|
|
|
.LP
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR setrpcent ()
|
2007-04-12 22:42:49 +00:00
|
|
|
opens and rewinds the file.
|
|
|
|
If the
|
2004-11-03 13:51:07 +00:00
|
|
|
.I stayopen
|
2007-12-25 22:02:19 +00:00
|
|
|
flag is nonzero,
|
2004-11-03 13:51:07 +00:00
|
|
|
the net data base will not be closed after each call to
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR getrpcent ()
|
2004-11-03 13:51:07 +00:00
|
|
|
(either directly, or indirectly through one of
|
|
|
|
the other \*(lqgetrpc\*(rq calls).
|
|
|
|
.LP
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR endrpcent ()
|
2004-11-03 13:51:07 +00:00
|
|
|
closes the file.
|
|
|
|
.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
|
|
|
|
of the file until a matching rpc program name or
|
|
|
|
program number is found, or until end-of-file is encountered.
|
2007-05-16 17:35:34 +00:00
|
|
|
.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.
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH FILES
|
|
|
|
.I /etc/rpc
|
|
|
|
.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)
|