OSDN Git Service

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