]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/getrpcent_r.3
Many pages: Use correct letter case in page titles (TH)
[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.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
65382639 5.\"
4c1c5274 6.TH getrpcent_r 3 (date) "Linux man-pages (unreleased)"
65382639
MK
7.SH NAME
8getrpcent_r, getrpcbyname_r, getrpcbynumber_r \- get
9RPC entry (reentrant)
42009080
AC
10.SH LIBRARY
11Standard C library
12.RI ( libc ", " \-lc )
65382639
MK
13.SH SYNOPSIS
14.nf
15.B #include <netdb.h>
68e4db0a 16.PP
65382639
MK
17.BI "int getrpcent_r(struct rpcent *" result_buf ", char *" buf ,
18.BI " size_t " buflen ", struct rpcent **" result );
65382639
MK
19.BI "int getrpcbyname_r(const char *" name ,
20.BI " struct rpcent *" result_buf ", char *" buf ,
21.BI " size_t " buflen ", struct rpcent **" result );
65382639
MK
22.BI "int getrpcbynumber_r(int " number ,
23.BI " struct rpcent *" result_buf ", char *" buf ,
24.BI " size_t " buflen ", struct rpcent **" result );
68e4db0a 25.PP
65382639 26.fi
d39ad78f 27.RS -4
65382639
MK
28Feature Test Macro Requirements for glibc (see
29.BR feature_test_macros (7)):
d39ad78f 30.RE
68e4db0a 31.PP
65382639
MK
32.BR getrpcent_r (),
33.BR getrpcbyname_r (),
34.BR getrpcbynumber_r ():
9d2adbae 35.nf
51c612fb
MK
36 Since glibc 2.19:
37 _DEFAULT_SOURCE
38 Glibc 2.19 and earlier:
39 _BSD_SOURCE || _SVID_SOURCE
9d2adbae 40.fi
65382639
MK
41.SH DESCRIPTION
42The
43.BR getrpcent_r (),
44.BR getrpcbyname_r (),
45and
46.BR getrpcbynumber_r ()
47functions are the reentrant equivalents of, respectively,
48.BR getrpcent (3),
49.BR getrpcbyname (3),
50and
51.BR getrpcbynumber (3).
52They differ in the way that the
53.I rpcent
54structure is returned,
55and in the function calling signature and return value.
56This manual page describes just the differences from
54d75d6c 57the nonreentrant functions.
847e0d88 58.PP
65382639
MK
59Instead of returning a pointer to a statically allocated
60.I rpcent
61structure as the function result,
62these functions copy the structure into the location pointed to by
63.IR result_buf .
847e0d88 64.PP
65382639
MK
65The
66.I buf
67array is used to store the string fields pointed to by the returned
68.I rpcent
69structure.
54d75d6c 70(The nonreentrant functions allocate these strings in static storage.)
65382639
MK
71The size of this array is specified in
72.IR buflen .
73If
74.I buf
75is too small, the call fails with the error
76.BR ERANGE ,
77and the caller must try again with a larger buffer.
78(A buffer of length 1024 bytes should be sufficient for most applications.)
79.\" I can find no information on the required/recommended buffer size;
54d75d6c 80.\" the nonreentrant functions use a 1024 byte buffer -- mtk.
847e0d88 81.PP
65382639
MK
82If the function call successfully obtains an RPC record, then
83.I *result
84is set pointing to
85.IR result_buf ;
86otherwise,
87.I *result
88is set to NULL.
47297adb 89.SH RETURN VALUE
65382639 90On success, these functions return 0.
535f0df5 91On error, they return one of the positive error numbers listed in ERRORS.
847e0d88 92.PP
65382639
MK
93On error, record not found
94.RB ( getrpcbyname_r (),
95.BR getrpcbynumber_r ()),
96or end of input
97.RB ( getrpcent_r ())
98.I result
99is set to NULL.
100.SH ERRORS
101.TP
102.B ENOENT
103.RB ( getrpcent_r ())
104No more records in database.
105.TP
106.B ERANGE
107.I buf
108is too small.
109Try again with a larger buffer
110(and increased
111.IR buflen ).
0a167f31
ZL
112.SH ATTRIBUTES
113For an explanation of the terms used in this section, see
114.BR attributes (7).
74714ea8 115.ad l
c466875e 116.nh
0a167f31
ZL
117.TS
118allbox;
c466875e 119lbx lb lb
0a167f31
ZL
120l l l.
121Interface Attribute Value
122T{
123.BR getrpcent_r (),
124.BR getrpcbyname_r (),
125.BR getrpcbynumber_r ()
126T} Thread safety MT-Safe locale
127.TE
c466875e 128.hy
74714ea8 129.ad
c466875e 130.sp 1
3113c7f3 131.SH STANDARDS
65382639
MK
132These functions are GNU extensions.
133Functions with similar names exist on some other systems,
134though typically with different calling signatures.
47297adb 135.SH SEE ALSO
65382639 136.BR getrpcent (3),
65382639 137.BR rpc (5)