getrpcbyname(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

getrpcbyname(3c)

getrpcbyname(3C)         Standard C Library Functions         getrpcbyname(3C)

NAME
       getrpcbyname,  getrpcbyname_r, getrpcbynumber, getrpcbynumber_r, getrp‐
       cent, getrpcent_r, setrpcent, endrpcent - get RPC entry

SYNOPSIS
       #include <rpc/rpcent.h>

       struct rpcent *getrpcbyname(const char *name);


       struct rpcent *getrpcbyname_r(const char *name, struct rpcent *result,
            char *buffer, int buflen);


       struct rpcent *getrpcbynumber(const int number);


       struct rpcent *getrpcbynumber_r(const int number, struct rpcent *result,
            char *buffer, int buflen);


       struct rpcent *getrpcent(void);


       struct rpcent *getrpcent_r(struct rpcent *result, char *buffer,
            int buflen);


       void setrpcent(const int stayopen);


       void endrpcent(void);

DESCRIPTION
       These functions are used to obtain entries for  RPC  (Remote  Procedure
       Call) services. An entry may come from any of the sources for rpc spec‐
       ified in the /etc/nsswitch.conf file (see nsswitch.conf(5)).


       getrpcbyname()  searches  for an entry with the RPC service name speci‐
       fied by the parameter name.


       getrpcbynumber() searches for an entry with the RPC program number num‐
       ber.


       The functions setrpcent(), getrpcent(), and  endrpcent()  are  used  to
       enumerate RPC entries from the database.


       setrpcent()  sets  (or  resets) the enumeration to the beginning of the
       set of RPC entries. This function should be  called  before  the  first
       call to getrpcent(). Calls to getrpcbyname() and getrpcbynumber() leave
       the  enumeration  position  in  an indeterminate state. If the stayopen
       flag is non-zero, the system may keep allocated resources such as  open
       file descriptors until a subsequent call to endrpcent().


       Successive  calls  to  getrpcent()  return either successive entries or
       NULL, indicating the end of the enumeration.


       endrpcent() may be called to indicate that the caller expects to do  no
       further  RPC entry retrieval operations; the system may then deallocate
       resources it was using. It is still allowed, but  possibly  less  effi‐
       cient, for the process to call more RPC entry retrieval functions after
       calling endrpcent().

   Reentrant Interfaces
       The  functions  getrpcbyname(),  getrpcbynumber(),  and getrpcent() use
       static storage that is re-used in each call, making these routines  un‐
       safe for use in multithreaded applications.


       The  functions  getrpcbyname_r(), getrpcbynumber_r(), and getrpcent_r()
       provide reentrant interfaces for these operations.


       Each reentrant interface performs the same operation as  its  non-reen‐
       trant counterpart, named by removing the "_r" suffix. The reentrant in‐
       terfaces, however, use buffers supplied by the caller to store returned
       results, and are safe for use in both single-threaded and multithreaded
       applications.


       Each reentrant interface takes the same parameters as its non-reentrant
       counterpart,  as well as the following additional parameters. The para‐
       meter result must be a pointer to a struct rpcent  structure  allocated
       by  the  caller. On successful completion, the function returns the RPC
       entry in this structure. The parameter buffer must be a  pointer  to  a
       buffer supplied by the caller. This buffer is used as storage space for
       the  RPC entry data. All of the pointers within the returned struct rp‐
       cent  result point to data stored within this buffer (see  RETURN  VAL‐
       UES).  The  buffer must be large enough to hold all of the data associ‐
       ated with the RPC entry. The parameter buflen should give the  size  in
       bytes of the buffer indicated by buffer.


       For  enumeration in multithreaded applications, the position within the
       enumeration is a process-wide property shared by  all  threads.  setrp‐
       cent()  may  be used in a multithreaded application but resets the enu‐
       meration position for all threads. If multiple threads interleave calls
       to getrpcent_r(), the threads will enumerate disjoint  subsets  of  the
       RPC entry database.


       Like  their  non-reentrant  counterparts,  getrpcbyname_r()  and  getr‐
       pcbynumber_r() leave  the  enumeration  position  in  an  indeterminate
       state.

RETURN VALUES
       RPC  entries  are represented by the struct rpcent structure defined in
       <rpc/rpcent.h>:

         struct rpcent {
            char *r_name;       /* name of this rpc service */
            char **r_aliases;   /* zero-terminated list of alternate names */
            int r_number;       /* rpc program number */
         };



       The functions getrpcbyname(), getrpcbyname_r(),  getrpcbynumber(),  and
       getrpcbynumber_r()  each  return  a  pointer to a struct rpcent if they
       successfully locate the requested entry; otherwise they return NULL.


       The functions getrpcent() and getrpcent_r() each return a pointer to  a
       struct  rpcent  if they successfully enumerate an entry; otherwise they
       return NULL, indicating the end of the enumeration.


       The functions getrpcbyname(),  getrpcbynumber(),  and  getrpcent()  use
       static  storage,  so  returned  data must be copied before a subsequent
       call to any of these functions if the data is to be saved.


       When the pointer returned by the reentrant functions  getrpcbyname_r(),
       getrpcbynumber_r(),  and  getrpcent_r() is non-NULL, it is always equal
       to the result pointer that was supplied by the caller.

ERRORS
       The reentrant functions getrpcbyname_r(), getrpcbynumber_r() and getrp‐
       cent_r() will return NULL and set errno to ERANGE if the length of  the
       buffer  supplied by caller is not large enough to store the result. See
       Intro(2) for the proper usage and interpretation  of  errno  in  multi‐
       threaded applications.

ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ MT-LevelT{ See "Reentrant Interfaces"  in  DESCRIPTION.
       T}


SEE ALSO
       rpc(3C), nsswitch.conf(5), rpc(5), attributes(7), rpcinfo(8)

WARNINGS
       The  reentrant  interfaces  getrpcbyname_r(),  getrpcbynumber_r(),  and
       getrpcent_r() are included in this  release  on  an  uncommitted  basis
       only, and are subject to change or removal in future minor releases.

NOTES
       Use of the enumeration interfaces getrpcent() and getrpcent_r() is dis‐
       couraged;  enumeration  may  not be supported for all database sources.
       The semantics of enumeration are discussed further in nsswitch.conf(5).

Oracle Solaris 11.4               6 Oct 2022                  getrpcbyname(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3