]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/getrpcent_r.3
Various pages: bring more whitespace consistency in SYNOPSIS
[thirdparty/man-pages.git] / man3 / getrpcent_r.3
1 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH GETRPCENT_R 3 2017-09-15 "GNU" "Linux Programmer's Manual"
27 .SH NAME
28 getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get
29 RPC entry (reentrant)
30 .SH SYNOPSIS
31 .nf
32 .B #include <netdb.h>
33 .PP
34 .BI "int getrpcent_r(struct rpcent *" result_buf ", char *" buf ,
35 .BI " size_t " buflen ", struct rpcent **" result );
36 .BI "int getrpcbyname_r(const char *" name ,
37 .BI " struct rpcent *" result_buf ", char *" buf ,
38 .BI " size_t " buflen ", struct rpcent **" result );
39 .BI "int getrpcbynumber_r(int " number ,
40 .BI " struct rpcent *" result_buf ", char *" buf ,
41 .BI " size_t " buflen ", struct rpcent **" result );
42 .PP
43 .fi
44 .RS -4
45 Feature Test Macro Requirements for glibc (see
46 .BR feature_test_macros (7)):
47 .ad l
48 .RE
49 .PP
50 .BR getrpcent_r (),
51 .BR getrpcbyname_r (),
52 .BR getrpcbynumber_r ():
53 Since glibc 2.19:
54 _DEFAULT_SOURCE
55 Glibc 2.19 and earlier:
56 _BSD_SOURCE || _SVID_SOURCE
57 .ad b
58 .SH DESCRIPTION
59 The
60 .BR getrpcent_r (),
61 .BR getrpcbyname_r (),
62 and
63 .BR getrpcbynumber_r ()
64 functions are the reentrant equivalents of, respectively,
65 .BR getrpcent (3),
66 .BR getrpcbyname (3),
67 and
68 .BR getrpcbynumber (3).
69 They differ in the way that the
70 .I rpcent
71 structure is returned,
72 and in the function calling signature and return value.
73 This manual page describes just the differences from
74 the nonreentrant functions.
75 .PP
76 Instead of returning a pointer to a statically allocated
77 .I rpcent
78 structure as the function result,
79 these functions copy the structure into the location pointed to by
80 .IR result_buf .
81 .PP
82 The
83 .I buf
84 array is used to store the string fields pointed to by the returned
85 .I rpcent
86 structure.
87 (The nonreentrant functions allocate these strings in static storage.)
88 The size of this array is specified in
89 .IR buflen .
90 If
91 .I buf
92 is too small, the call fails with the error
93 .BR ERANGE ,
94 and the caller must try again with a larger buffer.
95 (A buffer of length 1024 bytes should be sufficient for most applications.)
96 .\" I can find no information on the required/recommended buffer size;
97 .\" the nonreentrant functions use a 1024 byte buffer -- mtk.
98 .PP
99 If the function call successfully obtains an RPC record, then
100 .I *result
101 is set pointing to
102 .IR result_buf ;
103 otherwise,
104 .I *result
105 is set to NULL.
106 .SH RETURN VALUE
107 On success, these functions return 0.
108 On error, they return one of the positive error numbers listed in ERRORS.
109 .PP
110 On error, record not found
111 .RB ( getrpcbyname_r (),
112 .BR getrpcbynumber_r ()),
113 or end of input
114 .RB ( getrpcent_r ())
115 .I result
116 is set to NULL.
117 .SH ERRORS
118 .TP
119 .B ENOENT
120 .RB ( getrpcent_r ())
121 No more records in database.
122 .TP
123 .B ERANGE
124 .I buf
125 is too small.
126 Try again with a larger buffer
127 (and increased
128 .IR buflen ).
129 .SH ATTRIBUTES
130 For an explanation of the terms used in this section, see
131 .BR attributes (7).
132 .ad l
133 .TS
134 allbox;
135 lbw19 lb lb
136 l l l.
137 Interface Attribute Value
138 T{
139 .BR getrpcent_r (),
140 .BR getrpcbyname_r (),
141 .BR getrpcbynumber_r ()
142 T} Thread safety MT-Safe locale
143 .TE
144 .ad
145 .SH CONFORMING TO
146 These functions are GNU extensions.
147 Functions with similar names exist on some other systems,
148 though typically with different calling signatures.
149 .SH SEE ALSO
150 .BR getrpcent (3),
151 .BR rpc (5)