man-pages/man3/getrpcent.3.html
2021-03-31 01:06:50 +01:00

228 lines
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of GETRPCENT</TITLE>
</HEAD><BODY>
<H1>GETRPCENT</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent - get
RPC entry
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/netdb.h">netdb.h</A>&gt;</B>
<B>struct rpcent *getrpcent(void);</B>
<B>struct rpcent *getrpcbyname(const char *</B><I>name</I><B>);</B>
<B>struct rpcent *getrpcbynumber(int </B><I>number</I><B>);</B>
<B>void setrpcent(int </B><I>stayopen</I><B>);</B>
<B>void endrpcent(void);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
The
<B>getrpcent</B>(),
<B>getrpcbyname</B>(),
and
<B>getrpcbynumber</B>()
functions each return a pointer to an object with the
following structure containing the broken-out
fields of an entry in the RPC program number data base.
<P>
struct rpcent {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;*r_name;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;name&nbsp;of&nbsp;server&nbsp;for&nbsp;this&nbsp;RPC&nbsp;program&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;**r_aliases;&nbsp;&nbsp;/*&nbsp;alias&nbsp;list&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;long&nbsp;&nbsp;&nbsp;r_number;&nbsp;&nbsp;&nbsp;/*&nbsp;RPC&nbsp;program&nbsp;number&nbsp;*/
};
<P>
The members of this structure are:
<DL COMPACT><DT id="1"><DD>
<DL COMPACT>
<DT id="2"><I>r_name</I>
<DD>
The name of the server for this RPC program.
<DT id="3"><I>r_aliases</I>
<DD>
A NULL-terminated list of alternate names for the RPC program.
<DT id="4"><I>r_number</I>
<DD>
The RPC program number for this service.
</DL>
</DL>
<P>
The
<B>getrpcent</B>()
function reads the next entry from the database.
A connection is opened to the database if necessary.
<P>
The
<B>setrpcent</B>()
function opens a connection to the database,
and sets the next entry to the first entry.
If
<I>stayopen</I>
is nonzero,
then the connection to the database
will not be closed between calls to one of the
<B>getrpc*</B>()
functions.
<P>
The
<B>endrpcent</B>()
function closes the connection to the database.
<P>
The
<B>getrpcbyname</B>()
and
<B>getrpcbynumber</B>()
functions 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.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success,
<B>getrpcent</B>(),
<B>getrpcbyname</B>(),
and
<B>getrpcbynumber</B>()
return a pointer to a statically allocated
<I>rpcent</I>
structure.
NULL is returned on EOF or error.
<A NAME="lbAF">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="5"><I>/etc/rpc</I>
<DD>
RPC program number database.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>ATTRIBUTES</H2>
For an explanation of the terms used in this section, see
<B><A HREF="/cgi-bin/man/man2html?7+attributes">attributes</A></B>(7).
<TABLE BORDER>
<TR VALIGN=top><TD><B>Interface</B></TD><TD><B>Attribute</B></TD><TD><B>Value</B><BR></TD></TR>
<TR VALIGN=top><TD>
<B>getrpcent</B>(),
<B>getrpcbyname</B>(),
<BR>
<B>getrpcbynumber</B>()
</TD><TD>Thread safety</TD><TD>MT-Unsafe<BR></TD></TR>
<TR VALIGN=top><TD>
<B>setrpcent</B>(),
<B>endrpcent</B>()
</TD><TD>Thread safety</TD><TD>MT-Safe locale<BR></TD></TR>
</TABLE>
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
Not in POSIX.1.
Present on the BSDs, Solaris, and many other systems.
<A NAME="lbAI">&nbsp;</A>
<H2>BUGS</H2>
All information
is contained in a static area
so it must be copied if it is
to be saved.
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+getrpcent_r">getrpcent_r</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?5+rpc">rpc</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?8+rpcinfo">rpcinfo</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+ypserv">ypserv</A></B>(8)
<A NAME="lbAK">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="10"><A HREF="#lbAF">FILES</A><DD>
<DT id="11"><A HREF="#lbAG">ATTRIBUTES</A><DD>
<DT id="12"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="13"><A HREF="#lbAI">BUGS</A><DD>
<DT id="14"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="15"><A HREF="#lbAK">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:44 GMT, March 31, 2021
</BODY>
</HTML>