| 1 |
'\" t |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" %%%LICENSE_START(BSD_ONELINE_CDROM) |
| 5 |
.\" This page was taken from the 4.4BSD-Lite CDROM (BSD license) |
| 6 |
.\" %%%LICENSE_END |
| 7 |
.\" |
| 8 |
.TH getrpcent 3 2025-05-17 "Linux man-pages 6.18" |
| 9 |
.SH NAME |
| 10 |
getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent \- get |
| 11 |
RPC entry |
| 12 |
.SH LIBRARY |
| 13 |
Standard C library |
| 14 |
.RI ( libc ,\~ \-lc ) |
| 15 |
.SH SYNOPSIS |
| 16 |
.nf |
| 17 |
.B #include <netdb.h> |
| 18 |
.P |
| 19 |
.B struct rpcent *getrpcent(void); |
| 20 |
.P |
| 21 |
.BI "struct rpcent *getrpcbyname(const char *" name ); |
| 22 |
.BI "struct rpcent *getrpcbynumber(int " number ); |
| 23 |
.P |
| 24 |
.BI "void setrpcent(int " stayopen ); |
| 25 |
.B void endrpcent(void); |
| 26 |
.fi |
| 27 |
.SH DESCRIPTION |
| 28 |
The |
| 29 |
.BR getrpcent (), |
| 30 |
.BR getrpcbyname (), |
| 31 |
and |
| 32 |
.BR getrpcbynumber () |
| 33 |
functions each return a pointer to an object with the |
| 34 |
following structure containing the broken-out |
| 35 |
fields of an entry in the RPC program number data base. |
| 36 |
.P |
| 37 |
.in +4n |
| 38 |
.EX |
| 39 |
struct rpcent { |
| 40 |
char *r_name; /* name of server for this RPC program */ |
| 41 |
char **r_aliases; /* alias list */ |
| 42 |
long r_number; /* RPC program number */ |
| 43 |
}; |
| 44 |
.EE |
| 45 |
.in |
| 46 |
.P |
| 47 |
The members of this structure are: |
| 48 |
.TP |
| 49 |
.I r_name |
| 50 |
The name of the server for this RPC program. |
| 51 |
.TP |
| 52 |
.I r_aliases |
| 53 |
A NULL-terminated list of alternate names for the RPC program. |
| 54 |
.TP |
| 55 |
.I r_number |
| 56 |
The RPC program number for this service. |
| 57 |
.P |
| 58 |
The |
| 59 |
.BR getrpcent () |
| 60 |
function reads the next entry from the database. |
| 61 |
A connection is opened to the database if necessary. |
| 62 |
.P |
| 63 |
The |
| 64 |
.BR setrpcent () |
| 65 |
function opens a connection to the database, |
| 66 |
and sets the next entry to the first entry. |
| 67 |
If |
| 68 |
.I stayopen |
| 69 |
is nonzero, |
| 70 |
then the connection to the database |
| 71 |
will not be closed between calls to one of the |
| 72 |
.BR getrpc* () |
| 73 |
functions. |
| 74 |
.P |
| 75 |
The |
| 76 |
.BR endrpcent () |
| 77 |
function closes the connection to the database. |
| 78 |
.P |
| 79 |
The |
| 80 |
.BR getrpcbyname () |
| 81 |
and |
| 82 |
.BR getrpcbynumber () |
| 83 |
functions sequentially search from the beginning |
| 84 |
of the file until a matching RPC program name or |
| 85 |
program number is found, or until end-of-file is encountered. |
| 86 |
.SH RETURN VALUE |
| 87 |
On success, |
| 88 |
.BR getrpcent (), |
| 89 |
.BR getrpcbyname (), |
| 90 |
and |
| 91 |
.BR getrpcbynumber () |
| 92 |
return a pointer to a statically allocated |
| 93 |
.I rpcent |
| 94 |
structure. |
| 95 |
NULL is returned on EOF or error. |
| 96 |
.SH FILES |
| 97 |
.TP |
| 98 |
.I /etc/rpc |
| 99 |
RPC program number database. |
| 100 |
.SH ATTRIBUTES |
| 101 |
For an explanation of the terms used in this section, see |
| 102 |
.BR attributes (7). |
| 103 |
.TS |
| 104 |
allbox; |
| 105 |
lbx lb lb |
| 106 |
l l l. |
| 107 |
Interface Attribute Value |
| 108 |
T{ |
| 109 |
.na |
| 110 |
.nh |
| 111 |
.BR getrpcent (), |
| 112 |
.BR getrpcbyname (), |
| 113 |
.BR getrpcbynumber () |
| 114 |
T} Thread safety MT-Unsafe |
| 115 |
T{ |
| 116 |
.na |
| 117 |
.nh |
| 118 |
.BR setrpcent (), |
| 119 |
.BR endrpcent () |
| 120 |
T} Thread safety MT-Safe locale |
| 121 |
.TE |
| 122 |
.SH STANDARDS |
| 123 |
BSD. |
| 124 |
.SH HISTORY |
| 125 |
BSD, Solaris. |
| 126 |
.SH BUGS |
| 127 |
All information |
| 128 |
is contained in a static area |
| 129 |
so it must be copied if it is |
| 130 |
to be saved. |
| 131 |
.SH SEE ALSO |
| 132 |
.BR getrpcent_r (3), |
| 133 |
.BR rpc (5), |
| 134 |
.BR rpcinfo (8), |
| 135 |
.BR ypserv (8) |