getrpcent(3N) getrpcent(3N)
NAME
getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent
- get rpc server entry
SYNOPSIS
cc [options] file -lnsl
#include <rpc/rpc.h>
#include <rpc/rpcent.h>
#include <rpc/nettype.h>
struct rpcent *getrpcent(void);
struct rpcent *getrpcbyname(char *name);
struct rpcent *getrpcbynumber(int number);
int setrpcent(int stayopen);
int endrpcent(void);
DESCRIPTION
getrpcent, getrpcbynumber, and getrpcbyname each return a
pointer to an object with the following structure containing
the broken-out fields of a line in the rpc program number data
base, /etc/rpc. This data base is used to convert rpc program
numbers to server names.
Structure Definitions
The rpcent structure is defined in rpcent.h and has the
following members:
char *r_name; /* name of server for this rpc program */
char **r_aliases; /* alias list */
int r_number; /* rpc program number */
The members of this structure are:
r_name Official name of the server.
r_aliases A zero-terminated array of alternate names
for the server.
r_number The rpc program number.
getrpcent reads the next line of the file, opening the file if
necessary.
getrpcbyname and getrpcbynumber sequentially search from the
beginning of the file until a matching name or number is
found, or until an EOF is encountered.
setrpcent opens and rewinds the file. If the stayopen flag is
non-zero, the rpc data base will not be closed after each call
to getrpcent (either directly, or indirectly through one of
Copyright 1994 Novell, Inc. Page 1
getrpcent(3N) getrpcent(3N)
the other getrpc calls).
endrpcent closes the file.
Files
/etc/rpc
/var/yp/{domainname}/rpc.bynumber
REFERENCES
rpc(4)
RETURN VALUES
A NULL pointer is returned on an EOF or error.
NOTICES
All information is contained in a static area, so it must be
copied if it is to be saved. For multi-threaded applications,
this must be done on a per-thread basis.
The Network Information Service (NIS) will be used to obtain
RPC server entires when its installed and running. Otherwise,
entries will be read from /etc/rpc.
Copyright 1994 Novell, Inc. Page 2