Standard C Library (libc.a)
#include <netdb.h>
struct rpcent *getrpcent ()
struct rpcent *getrpcbyname ( Name)
char *Name;
struct rpcent *getrpcbynumber ( Number)
int Number;
void setrpcent (StayOpen)
int StayOpen
void endrpcent
The getprcbyname and getrpcbynumber subroutines each return a pointer to an object with the rpcent structure. This structure contains the broken-out fields of a line from the /etc/rpc file. The getprcbyname and getrpcbynumber subroutines searches the rpc file sequentially from the beginning of the file until it finds a matching RPC program name or number, or until it reaches the end of the file. The getrpcent subroutine reads the next line of the file, opening the file if necessary.
The setrpcent subroutine opens and rewinds the /etc/rpc file. If the StayOpen parameter does not equal 0, the rpc file is not closed after a call to the getrpcent subroutine.
The setrpcent subroutine rewinds the rpc file. The endrpcent subroutine closes it.
The rpc file contains information about Remote Procedure Call (RPC) programs. The rpcent structure is in the /usr/include/netdb.h file and contains the following fields:
Name | Specifies the name of a server for rpc program. |
Number | Specifies the rpc program number for service. |
StayOpen | Contains a value used to indicate whether to close the rpc file. |
These subroutines return a null pointer when they encounter the end of a file or an error.
/etc/rpc | Contains information about Remote Procedure Call (RPC) programs. |
Remote Procedure Call (RPC) for Programming in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs