1GETRPCENT_R(3)             Linux Programmer's Manual            GETRPCENT_R(3)
2
3
4

NAME

6       getrpcent_r,  getrpcbyname_r,  getrpcbynumber_r  - get RPC entry (reen‐
7       trant)
8

SYNOPSIS

10       #include <netdb.h>
11
12       int getrpcent_r(struct rpcent *result_buf, char *buf,
13                       size_t buflen, struct rpcent **result);
14       int getrpcbyname_r(const char *name,
15                       struct rpcent *result_buf, char *buf,
16                       size_t buflen, struct rpcent **result);
17       int getrpcbynumber_r(int number,
18                       struct rpcent *result_buf, char *buf,
19                       size_t buflen, struct rpcent **result);
20
21   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
22
23       getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r():
24           Since glibc 2.19:
25               _DEFAULT_SOURCE
26           Glibc 2.19 and earlier:
27               _BSD_SOURCE || _SVID_SOURCE
28

DESCRIPTION

30       The getrpcent_r(), getrpcbyname_r(), and  getrpcbynumber_r()  functions
31       are the reentrant equivalents of, respectively, getrpcent(3), getrpcby‐
32       name(3), and getrpcbynumber(3).  They differ in the way that the rpcent
33       structure is returned, and in the function calling signature and return
34       value.  This manual page describes just the differences from  the  non‐
35       reentrant functions.
36
37       Instead  of returning a pointer to a statically allocated rpcent struc‐
38       ture as the function result, these functions copy  the  structure  into
39       the location pointed to by result_buf.
40
41       The  buf array is used to store the string fields pointed to by the re‐
42       turned rpcent structure.  (The nonreentrant  functions  allocate  these
43       strings in static storage.)  The size of this array is specified in bu‐
44       flen.  If buf is too small, the call fails with the error  ERANGE,  and
45       the  caller  must  try again with a larger buffer.  (A buffer of length
46       1024 bytes should be sufficient for most applications.)
47
48       If the function call successfully obtains an RPC record,  then  *result
49       is set pointing to result_buf; otherwise, *result is set to NULL.
50

RETURN VALUE

52       On success, these functions return 0.  On error, they return one of the
53       positive error numbers listed in ERRORS.
54
55       On error, record not found (getrpcbyname_r(),  getrpcbynumber_r()),  or
56       end of input (getrpcent_r()) result is set to NULL.
57

ERRORS

59       ENOENT (getrpcent_r()) No more records in database.
60
61       ERANGE buf is too small.  Try again with a larger buffer (and increased
62              buflen).
63

ATTRIBUTES

65       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
66       tributes(7).
67
68       ┌─────────────────────────────────────┬───────────────┬────────────────┐
69Interface                            Attribute     Value          
70       ├─────────────────────────────────────┼───────────────┼────────────────┤
71getrpcent_r(), getrpcbyname_r(),     │ Thread safety │ MT-Safe locale │
72getrpcbynumber_r()                   │               │                │
73       └─────────────────────────────────────┴───────────────┴────────────────┘
74

CONFORMING TO

76       These functions are GNU extensions.  Functions with similar names exist
77       on  some  other systems, though typically with different calling signa‐
78       tures.
79

SEE ALSO

81       getrpcent(3), rpc(5)
82

COLOPHON

84       This page is part of release 5.12 of the Linux  man-pages  project.   A
85       description  of  the project, information about reporting bugs, and the
86       latest    version    of    this    page,    can     be     found     at
87       https://www.kernel.org/doc/man-pages/.
88
89
90
91GNU                               2021-03-22                    GETRPCENT_R(3)
Impressum