1getrpcent_r(3) Library Functions Manual getrpcent_r(3)
2
3
4
6 getrpcent_r, getrpcbyname_r, getrpcbynumber_r - get RPC entry (reen‐
7 trant)
8
10 Standard C library (libc, -lc)
11
13 #include <netdb.h>
14
15 int getrpcent_r(struct rpcent *result_buf, char buf[.buflen],
16 size_t buflen, struct rpcent **result);
17 int getrpcbyname_r(const char *name,
18 struct rpcent *result_buf, char buf[.buflen],
19 size_t buflen, struct rpcent **result);
20 int getrpcbynumber_r(int number,
21 struct rpcent *result_buf, char buf[.buflen],
22 size_t buflen, struct rpcent **result);
23
24 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
25
26 getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r():
27 Since glibc 2.19:
28 _DEFAULT_SOURCE
29 glibc 2.19 and earlier:
30 _BSD_SOURCE || _SVID_SOURCE
31
33 The getrpcent_r(), getrpcbyname_r(), and getrpcbynumber_r() functions
34 are the reentrant equivalents of, respectively, getrpcent(3), getrpcby‐
35 name(3), and getrpcbynumber(3). They differ in the way that the rpcent
36 structure is returned, and in the function calling signature and return
37 value. This manual page describes just the differences from the non‐
38 reentrant functions.
39
40 Instead of returning a pointer to a statically allocated rpcent struc‐
41 ture as the function result, these functions copy the structure into
42 the location pointed to by result_buf.
43
44 The buf array is used to store the string fields pointed to by the re‐
45 turned rpcent structure. (The nonreentrant functions allocate these
46 strings in static storage.) The size of this array is specified in bu‐
47 flen. If buf is too small, the call fails with the error ERANGE, and
48 the caller must try again with a larger buffer. (A buffer of length
49 1024 bytes should be sufficient for most applications.)
50
51 If the function call successfully obtains an RPC record, then *result
52 is set pointing to result_buf; otherwise, *result is set to NULL.
53
55 On success, these functions return 0. On error, they return one of the
56 positive error numbers listed in ERRORS.
57
58 On error, record not found (getrpcbyname_r(), getrpcbynumber_r()), or
59 end of input (getrpcent_r()) result is set to NULL.
60
62 ENOENT (getrpcent_r()) No more records in database.
63
64 ERANGE buf is too small. Try again with a larger buffer (and increased
65 buflen).
66
68 For an explanation of the terms used in this section, see at‐
69 tributes(7).
70
71 ┌─────────────────────────────────────┬───────────────┬────────────────┐
72 │Interface │ Attribute │ Value │
73 ├─────────────────────────────────────┼───────────────┼────────────────┤
74 │getrpcent_r(), getrpcbyname_r(), │ Thread safety │ MT-Safe locale │
75 │getrpcbynumber_r() │ │ │
76 └─────────────────────────────────────┴───────────────┴────────────────┘
77
79 Functions with similar names exist on some other systems, though typi‐
80 cally with different calling signatures.
81
83 GNU.
84
86 getrpcent(3), rpc(5)
87
88
89
90Linux man-pages 6.04 2023-03-30 getrpcent_r(3)