1 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH GETRPCENT_R 3 2021-03-22 "Linux man-pages (unreleased)"
8 getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get
12 .RI ( libc ", " \-lc )
17 .BI "int getrpcent_r(struct rpcent *" result_buf ", char *" buf ,
18 .BI " size_t " buflen ", struct rpcent **" result );
19 .BI "int getrpcbyname_r(const char *" name ,
20 .BI " struct rpcent *" result_buf ", char *" buf ,
21 .BI " size_t " buflen ", struct rpcent **" result );
22 .BI "int getrpcbynumber_r(int " number ,
23 .BI " struct rpcent *" result_buf ", char *" buf ,
24 .BI " size_t " buflen ", struct rpcent **" result );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
33 .BR getrpcbyname_r (),
34 .BR getrpcbynumber_r ():
38 Glibc 2.19 and earlier:
39 _BSD_SOURCE || _SVID_SOURCE
44 .BR getrpcbyname_r (),
46 .BR getrpcbynumber_r ()
47 functions are the reentrant equivalents of, respectively,
51 .BR getrpcbynumber (3).
52 They differ in the way that the
54 structure is returned,
55 and in the function calling signature and return value.
56 This manual page describes just the differences from
57 the nonreentrant functions.
59 Instead of returning a pointer to a statically allocated
61 structure as the function result,
62 these functions copy the structure into the location pointed to by
67 array is used to store the string fields pointed to by the returned
70 (The nonreentrant functions allocate these strings in static storage.)
71 The size of this array is specified in
75 is too small, the call fails with the error
77 and the caller must try again with a larger buffer.
78 (A buffer of length 1024 bytes should be sufficient for most applications.)
79 .\" I can find no information on the required/recommended buffer size;
80 .\" the nonreentrant functions use a 1024 byte buffer -- mtk.
82 If the function call successfully obtains an RPC record, then
90 On success, these functions return 0.
91 On error, they return one of the positive error numbers listed in ERRORS.
93 On error, record not found
94 .RB ( getrpcbyname_r (),
95 .BR getrpcbynumber_r ()),
103 .RB ( getrpcent_r ())
104 No more records in database.
109 Try again with a larger buffer
113 For an explanation of the terms used in this section, see
121 Interface Attribute Value
124 .BR getrpcbyname_r (),
125 .BR getrpcbynumber_r ()
126 T} Thread safety MT-Safe locale
132 These functions are GNU extensions.
133 Functions with similar names exist on some other systems,
134 though typically with different calling signatures.