]>
Commit | Line | Data |
---|---|---|
65382639 MK |
1 | .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
93015253 | 4 | .\" %%%LICENSE_START(VERBATIM) |
65382639 MK |
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. | |
4b72fb64 | 24 | .\" %%%LICENSE_END |
65382639 | 25 | .\" |
5722c835 | 26 | .TH GETRPCENT_R 3 2015-07-23 "GNU" "Linux Programmer's Manual" |
65382639 MK |
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 | .sp | |
34 | .BI "int getrpcent_r(struct rpcent *" result_buf ", char *" buf , | |
35 | .BI " size_t " buflen ", struct rpcent **" result ); | |
36 | .sp | |
37 | .BI "int getrpcbyname_r(const char *" name , | |
38 | .BI " struct rpcent *" result_buf ", char *" buf , | |
39 | .BI " size_t " buflen ", struct rpcent **" result ); | |
40 | .sp | |
41 | .BI "int getrpcbynumber_r(int " number , | |
42 | .BI " struct rpcent *" result_buf ", char *" buf , | |
43 | .BI " size_t " buflen ", struct rpcent **" result ); | |
44 | .sp | |
45 | .fi | |
46 | .in -4n | |
47 | Feature Test Macro Requirements for glibc (see | |
48 | .BR feature_test_macros (7)): | |
49 | .ad l | |
50 | .in | |
51 | .sp | |
52 | .BR getrpcent_r (), | |
53 | .BR getrpcbyname_r (), | |
54 | .BR getrpcbynumber_r (): | |
01dcc332 | 55 | .RS 4 |
65382639 | 56 | _BSD_SOURCE || _SVID_SOURCE |
01dcc332 | 57 | .RE |
65382639 MK |
58 | .ad b |
59 | .SH DESCRIPTION | |
60 | The | |
61 | .BR getrpcent_r (), | |
62 | .BR getrpcbyname_r (), | |
63 | and | |
64 | .BR getrpcbynumber_r () | |
65 | functions are the reentrant equivalents of, respectively, | |
66 | .BR getrpcent (3), | |
67 | .BR getrpcbyname (3), | |
68 | and | |
69 | .BR getrpcbynumber (3). | |
70 | They differ in the way that the | |
71 | .I rpcent | |
72 | structure is returned, | |
73 | and in the function calling signature and return value. | |
74 | This manual page describes just the differences from | |
54d75d6c | 75 | the nonreentrant functions. |
65382639 MK |
76 | |
77 | Instead of returning a pointer to a statically allocated | |
78 | .I rpcent | |
79 | structure as the function result, | |
80 | these functions copy the structure into the location pointed to by | |
81 | .IR result_buf . | |
82 | ||
83 | The | |
84 | .I buf | |
85 | array is used to store the string fields pointed to by the returned | |
86 | .I rpcent | |
87 | structure. | |
54d75d6c | 88 | (The nonreentrant functions allocate these strings in static storage.) |
65382639 MK |
89 | The size of this array is specified in |
90 | .IR buflen . | |
91 | If | |
92 | .I buf | |
93 | is too small, the call fails with the error | |
94 | .BR ERANGE , | |
95 | and the caller must try again with a larger buffer. | |
96 | (A buffer of length 1024 bytes should be sufficient for most applications.) | |
97 | .\" I can find no information on the required/recommended buffer size; | |
54d75d6c | 98 | .\" the nonreentrant functions use a 1024 byte buffer -- mtk. |
65382639 MK |
99 | |
100 | If the function call successfully obtains an RPC record, then | |
101 | .I *result | |
102 | is set pointing to | |
103 | .IR result_buf ; | |
104 | otherwise, | |
105 | .I *result | |
106 | is set to NULL. | |
47297adb | 107 | .SH RETURN VALUE |
65382639 | 108 | On success, these functions return 0. |
535f0df5 | 109 | On error, they return one of the positive error numbers listed in ERRORS. |
65382639 MK |
110 | |
111 | On error, record not found | |
112 | .RB ( getrpcbyname_r (), | |
113 | .BR getrpcbynumber_r ()), | |
114 | or end of input | |
115 | .RB ( getrpcent_r ()) | |
116 | .I result | |
117 | is set to NULL. | |
118 | .SH ERRORS | |
119 | .TP | |
120 | .B ENOENT | |
121 | .RB ( getrpcent_r ()) | |
122 | No more records in database. | |
123 | .TP | |
124 | .B ERANGE | |
125 | .I buf | |
126 | is too small. | |
127 | Try again with a larger buffer | |
128 | (and increased | |
129 | .IR buflen ). | |
0a167f31 ZL |
130 | .SH ATTRIBUTES |
131 | For an explanation of the terms used in this section, see | |
132 | .BR attributes (7). | |
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 | ||
47297adb | 145 | .SH CONFORMING TO |
65382639 MK |
146 | These functions are GNU extensions. |
147 | Functions with similar names exist on some other systems, | |
148 | though typically with different calling signatures. | |
47297adb | 149 | .SH SEE ALSO |
65382639 | 150 | .BR getrpcent (3), |
65382639 | 151 | .BR rpc (5) |