OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / getnetent_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 .\"*******************************************************************
25 .\"
26 .\" This file was generated with po4a. Translate the source file.
27 .\"
28 .\"*******************************************************************
29 .TH GETNETENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
30 .SH 名前
31 getnetent_r, getnetbyname_r, getnetbyaddr_r \- get network entry (reentrant)
32 .SH 書式
33 .nf
34 \fB#include <netdb.h>\fP
35 .sp
36 \fBint getnetent_r(struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
37 \fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
38 \fB                int *\fP\fIh_errnop\fP\fB);\fP
39 .sp
40 \fBint getnetbyname_r(const char *\fP\fIname\fP\fB,\fP
41 \fB                struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
42 \fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
43 \fB                int *\fP\fIh_errnop\fP\fB);\fP
44 .sp
45 \fBint getnetbyaddr_r(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB,\fP
46 \fB                struct netent *\fP\fIresult_buf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
47 \fB                size_t \fP\fIbuflen\fP\fB, struct netent **\fP\fIresult\fP\fB,\fP
48 \fB                int *\fP\fIh_errnop\fP\fB);\fP
49 .sp
50 .fi
51 .in -4n
52 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
53 .ad l
54 .in
55 .sp
56 \fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP():
57 .RS 4
58 _BSD_SOURCE || _SVID_SOURCE
59 .RE
60 .ad b
61 .SH 説明
62 The \fBgetnetent_r\fP(), \fBgetnetbyname_r\fP(), and \fBgetnetbyaddr_r\fP()
63 functions are the reentrant equivalents of, respectively, \fBgetnetent\fP(3),
64 \fBgetnetbyname\fP(3), and \fBgetnetbynumber\fP(3).  They differ in the way that
65 the \fInetent\fP structure is returned, and in the function calling signature
66 and return value.  This manual page describes just the differences from the
67 nonreentrant functions.
68
69 Instead of returning a pointer to a statically allocated \fInetent\fP structure
70 as the function result, these functions copy the structure into the location
71 pointed to by \fIresult_buf\fP.
72
73 .\" I can find no information on the required/recommended buffer size;
74 .\" the nonreentrant functions use a 1024 byte buffer -- mtk.
75 The \fIbuf\fP array is used to store the string fields pointed to by the
76 returned \fInetent\fP structure.  (The nonreentrant functions allocate these
77 strings in static storage.)  The size of this array is specified in
78 \fIbuflen\fP.  If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP,
79 and the caller must try again with a larger buffer.  (A buffer of length
80 1024 bytes should be sufficient for most applications.)
81
82 If the function call successfully obtains a network record, then \fI*result\fP
83 is set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL.
84
85 .\" getnetent.3 doesn't document any use of h_errno, but nevertheless
86 .\" the nonreentrant functions no seem to set h_errno.
87 The buffer pointed to by \fIh_errnop\fP is used to return the value that would
88 be stored in the global variable \fIh_errno\fP by the nonreentrant versions of
89 these functions.
90 .SH 返り値
91 On success, these functions return 0.  On error, they return one of the
92 positive error numbers listed in ERRORS.
93
94 On error, record not found (\fBgetnetbyname_r\fP(), \fBgetnetbyaddr_r\fP()), or
95 end of input (\fBgetnetent_r\fP())  \fIresult\fP is set to NULL.
96 .SH エラー
97 .TP 
98 \fBENOENT\fP
99 (\fBgetnetent_r\fP())  No more records in database.
100 .TP 
101 \fBERANGE\fP
102 \fIbuf\fP is too small.  Try again with a larger buffer (and increased
103 \fIbuflen\fP).
104 .SH 準拠
105 These functions are GNU extensions.  Functions with similar names exist on
106 some other systems, though typically with different calling signatures.
107 .SH 関連項目
108 \fBgetnetent\fP(3), \fBnetworks\fP(5)