getrpcent(3C)
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 */
};
Functions
getrpcent() Read the next line of the file, opening the file if necessary.
setrpcent() Open and rewind 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() Close the file.
getrpcbyname() Sequentially search from the beginning of the file until a matching rpc program name is found, or until EOF is encountered.
getrpcbynumber() Sequentially search from the beginning of the file until a matching rpc program number is found, or until EOF is encountered.
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 9.0: August 1992