1getrpcent(3)               Library Functions Manual               getrpcent(3)
2
3
4

NAME

6       getrpcent, getrpcbyname, getrpcbynumber, setrpcent, endrpcent - get RPC
7       entry
8

LIBRARY

10       Standard C library (libc, -lc)
11

SYNOPSIS

13       #include <netdb.h>
14
15       struct rpcent *getrpcent(void);
16
17       struct rpcent *getrpcbyname(const char *name);
18       struct rpcent *getrpcbynumber(int number);
19
20       void setrpcent(int stayopen);
21       void endrpcent(void);
22

DESCRIPTION

24       The getrpcent(), getrpcbyname(), and  getrpcbynumber()  functions  each
25       return  a  pointer to an object with the following structure containing
26       the broken-out fields of an entry in the RPC program number data base.
27
28           struct rpcent {
29               char  *r_name;     /* name of server for this RPC program */
30               char **r_aliases;  /* alias list */
31               long   r_number;   /* RPC program number */
32           };
33
34       The members of this structure are:
35
36       r_name The name of the server for this RPC program.
37
38       r_aliases
39              A NULL-terminated list of alternate names for the RPC program.
40
41       r_number
42              The RPC program number for this service.
43
44       The getrpcent() function reads the next entry  from  the  database.   A
45       connection is opened to the database if necessary.
46
47       The  setrpcent()  function opens a connection to the database, and sets
48       the next entry to the first entry.  If stayopen is  nonzero,  then  the
49       connection  to  the database will not be closed between calls to one of
50       the getrpc*() functions.
51
52       The endrpcent() function closes the connection to the database.
53
54       The getrpcbyname() and getrpcbynumber() functions  sequentially  search
55       from  the  beginning  of  the file until a matching RPC program name or
56       program number is found, or until end-of-file is encountered.
57

RETURN VALUE

59       On success, getrpcent(), getrpcbyname(), and getrpcbynumber() return  a
60       pointer  to  a statically allocated rpcent structure.  NULL is returned
61       on EOF or error.
62

FILES

64       /etc/rpc
65              RPC program number database.
66

ATTRIBUTES

68       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
69       tributes(7).
70
71       ┌─────────────────────────────────────┬───────────────┬────────────────┐
72Interface                            Attribute     Value          
73       ├─────────────────────────────────────┼───────────────┼────────────────┤
74getrpcent(), getrpcbyname(),         │ Thread safety │ MT-Unsafe      │
75getrpcbynumber()                     │               │                │
76       ├─────────────────────────────────────┼───────────────┼────────────────┤
77setrpcent(), endrpcent()             │ Thread safety │ MT-Safe locale │
78       └─────────────────────────────────────┴───────────────┴────────────────┘
79

STANDARDS

81       BSD.
82

HISTORY

84       BSD, Solaris.
85

BUGS

87       All information is contained in a static area so it must be  copied  if
88       it is to be saved.
89

SEE ALSO

91       getrpcent_r(3), rpc(5), rpcinfo(8), ypserv(8)
92
93
94
95Linux man-pages 6.05              2023-07-20                      getrpcent(3)
Impressum