getrpcent(3C)
Requires Optional NFS Services Software
NAME
getrpcent, getrpcbyname, getrpcbynumber − get rpc entry
SYNOPSIS
#include <netdb.h>
struct rpcent *getrpcent();
struct rpcent *getrpcbyname(char *name);
struct rpcent *getrpcbynumber(int number);
int setrpcent(int stayopen);
int endrpcent();
DESCRIPTION
getrpcent, getrpcbyname, and getrpcbynumber 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.
struct rpcent {
char *r_name; /* name of server for
this rpc program */
char **r_aliases; /* NULL terminated list
of aliases */
int r_number; /* rpc program number for
this service */
};
getrpcent reads the next line of the file, opening the file if necessary.
setrpcent opens and rewinds the file. If the stayopen flag is non-zero, the rpc database is not closed after each call to getrpcent (either directly or indirectly through one of the other getrpc calls).
endrpcent closes the file.
Both getrpcbyname and getrpcbynumber sequentially search from the beginning of the file until a matching rpc program name or program number is found, or until EOF is encountered.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character codes sets are supported.
RETURN VALUE
getrpcent , getrpcbyname , and getrpcbynumber return a null pointer (0) on EOF or when unable to access the information in /etc/rpc either directly or through a Network Information Service database.
WARNINGS
All information is contained in a static area so it must be copied if it is to be saved.
AUTHOR
getrpcent was developed by Sun Microsystems, Inc.
FILES
/etc/rpc
SEE ALSO
Hewlett-Packard Company — HP-UX Release 8.05: June 1991