]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent_r.3
dlinfo.3: ATTRIBUTES: Note function that is thread-safe
[thirdparty/man-pages.git] / man3 / getrpcent_r.3
CommitLineData
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
28getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get
29RPC 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
47Feature 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
60The
61.BR getrpcent_r (),
62.BR getrpcbyname_r (),
63and
64.BR getrpcbynumber_r ()
65functions are the reentrant equivalents of, respectively,
66.BR getrpcent (3),
67.BR getrpcbyname (3),
68and
69.BR getrpcbynumber (3).
70They differ in the way that the
71.I rpcent
72structure is returned,
73and in the function calling signature and return value.
74This manual page describes just the differences from
54d75d6c 75the nonreentrant functions.
65382639
MK
76
77Instead of returning a pointer to a statically allocated
78.I rpcent
79structure as the function result,
80these functions copy the structure into the location pointed to by
81.IR result_buf .
82
83The
84.I buf
85array is used to store the string fields pointed to by the returned
86.I rpcent
87structure.
54d75d6c 88(The nonreentrant functions allocate these strings in static storage.)
65382639
MK
89The size of this array is specified in
90.IR buflen .
91If
92.I buf
93is too small, the call fails with the error
94.BR ERANGE ,
95and 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
100If the function call successfully obtains an RPC record, then
101.I *result
102is set pointing to
103.IR result_buf ;
104otherwise,
105.I *result
106is set to NULL.
47297adb 107.SH RETURN VALUE
65382639 108On success, these functions return 0.
535f0df5 109On error, they return one of the positive error numbers listed in ERRORS.
65382639
MK
110
111On error, record not found
112.RB ( getrpcbyname_r (),
113.BR getrpcbynumber_r ()),
114or end of input
115.RB ( getrpcent_r ())
116.I result
117is set to NULL.
118.SH ERRORS
119.TP
120.B ENOENT
121.RB ( getrpcent_r ())
122No more records in database.
123.TP
124.B ERANGE
125.I buf
126is too small.
127Try again with a larger buffer
128(and increased
129.IR buflen ).
0a167f31
ZL
130.SH ATTRIBUTES
131For an explanation of the terms used in this section, see
132.BR attributes (7).
133.TS
134allbox;
135lbw19 lb lb
136l l l.
137Interface Attribute Value
138T{
139.BR getrpcent_r (),
140.BR getrpcbyname_r (),
141.BR getrpcbynumber_r ()
142T} Thread safety MT-Safe locale
143.TE
144
47297adb 145.SH CONFORMING TO
65382639
MK
146These functions are GNU extensions.
147Functions with similar names exist on some other systems,
148though typically with different calling signatures.
47297adb 149.SH SEE ALSO
65382639 150.BR getrpcent (3),
65382639 151.BR rpc (5)