man-pages/man3/getrpcent.3

95 lines
2.1 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
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
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
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 .
.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
2004-11-03 13:51:07 +00:00
The name of the server for this rpc program.
.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.
.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
.BR getrpcent ()
2004-11-03 13:51:07 +00:00
reads the next line of the file, opening the file if necessary.
.LP
.BR setrpcent ()
opens and rewinds the file.
If the
2004-11-03 13:51:07 +00:00
.I stayopen
2008-03-19 13:16:39 +00:00
flag is non-zero,
2004-11-03 13:51:07 +00:00
the net data base will not be closed after each call to
.BR getrpcent ()
2004-11-03 13:51:07 +00:00
(either directly, or indirectly through one of
the other \*(lqgetrpc\*(rq calls).
.LP
.BR endrpcent ()
2004-11-03 13:51:07 +00:00
closes the file.
.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
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
.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)