Accesses the /etc/rpc file.
Standard C Library (libc.a)
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:
Item | Description |
---|---|
r_name | Contains the name of the server for an RPC program |
r_aliases | Contains an alternate list of names for RPC programs. This list ends with a 0. |
r_number | Contains a number associated with an RPC program. |
Item | Description |
---|---|
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.
Item | Description |
---|---|
/etc/rpc | Contains information about Remote Procedure Call (RPC) programs. |