Chapter Contents

Previous

Next
getrpcbyname

getrpcbyname



Returns rpcent Structure for an RPC Program Name

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
PORTABILITY
IMPLEMENTATION
RELATED FUNCTIONS


SYNOPSIS

#include <netdb.h>

struct rpcent *getrpcbyname(const char *name);


DESCRIPTION

Given the name of an RPC program pointed to by the name argument, getrpcbyname returns a pointer to the rpcent structure defined in <netdb.h> . This structure is typically used to obtain the number for the RPC program from the r_number field. Refer to rpcent for details on the rpcent structure.

The source of the data in the rpcent structure is the protocols file, that is, a file with the same format as the /etc/rpc file on a UNIX operating system. Refer to /etc/rpc for information on the logic used to determine the location of the protocols file.


RETURN VALUE

If getrpcbyname succeeds, it returns a pointer to the rpcent structure. A null pointer indicates an error or an end-of-file.


CAUTION

The value that getrpcbyname returns points to a static structure within the library. You must copy the information from this structure before you make further getrpcbyname , getrpcbynumber , or getrpcent calls.


PORTABILITY

getrpcbyname is portable to other systems that support Sun RPC 4.0.


IMPLEMENTATION

This function is built from the Sun RPC 4.0 distribution.


RELATED FUNCTIONS

endrpcent , getrpcbynumber , getrpcent , setrpcent


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.