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