1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2014-06-08 01:30+0900\n"
10 "PO-Revision-Date: 2014-06-08 01:38+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: build/C/man3/asprintf.3:27
25 #: build/C/man3/asprintf.3:27 build/C/man3/fcloseall.3:25
26 #: build/C/man3/fmtmsg.3:13 build/C/man3/stdio_ext.3:25
32 #: build/C/man3/asprintf.3:27 build/C/man3/ctermid.3:26
33 #: build/C/man3/dprintf.3:26 build/C/man3/fclose.3:44
34 #: build/C/man3/fcloseall.3:25 build/C/man3/fflush.3:45
35 #: build/C/man3/fgetc.3:27 build/C/man3/fgetwc.3:18 build/C/man3/fmemopen.3:10
36 #: build/C/man3/fopen.3:44 build/C/man3/fputwc.3:16 build/C/man3/fread.3:45
37 #: build/C/man3/fseek.3:42 build/C/man3/getline.3:26 build/C/man3/gets.3:29
38 #: build/C/man3/getw.3:25 build/C/man3/popen.3:40 build/C/man3/printf.3:34
39 #: build/C/man3/puts.3:26 build/C/man3/remove.3:31 build/C/man3/scanf.3:52
40 #: build/C/man3/wprintf.3:16
46 #: build/C/man3/asprintf.3:27 build/C/man3/ctermid.3:26
47 #: build/C/man3/dprintf.3:26 build/C/man3/fclose.3:44
48 #: build/C/man3/fcloseall.3:25 build/C/man3/ferror.3:44
49 #: build/C/man3/fflush.3:45 build/C/man3/fgetc.3:27 build/C/man3/fgetwc.3:18
50 #: build/C/man3/flockfile.3:25 build/C/man3/fmemopen.3:10
51 #: build/C/man3/fmtmsg.3:13 build/C/man3/fopen.3:44
52 #: build/C/man3/fopencookie.3:26 build/C/man3/fpurge.3:25
53 #: build/C/man3/fputwc.3:16 build/C/man3/fread.3:45 build/C/man3/fseek.3:42
54 #: build/C/man3/fseeko.3:25 build/C/man3/getline.3:26 build/C/man3/gets.3:29
55 #: build/C/man3/getw.3:25 build/C/man2/link.2:32 build/C/man2/llseek.2:28
56 #: build/C/man2/lseek.2:47 build/C/man3/lseek64.3:25 build/C/man2/open.2:51
57 #: build/C/man2/open_by_handle_at.2:25 build/C/man3/perror.3:31
58 #: build/C/man2/pipe.2:36 build/C/man3/popen.3:40 build/C/man3/printf.3:34
59 #: build/C/man3/puts.3:26 build/C/man2/read.2:35 build/C/man2/readlink.2:44
60 #: build/C/man2/readv.2:32 build/C/man3/remove.3:31 build/C/man2/rename.2:33
61 #: build/C/man2/rmdir.2:30 build/C/man3/scanf.3:52 build/C/man3/setbuf.3:48
62 #: build/C/man3/stdin.3:13 build/C/man3/stdio.3:39 build/C/man3/stdio_ext.3:25
63 #: build/C/man2/symlink.2:33 build/C/man7/symlink.7:37
64 #: build/C/man3/tempnam.3:25 build/C/man3/tmpfile.3:31
65 #: build/C/man3/tmpnam.3:27 build/C/man2/unlink.2:33
66 #: build/C/man3/unlocked_stdio.3:25 build/C/man3/wprintf.3:16
67 #: build/C/man2/write.2:39
69 msgid "Linux Programmer's Manual"
70 msgstr "Linux Programmer's Manual"
73 #: build/C/man3/asprintf.3:28 build/C/man3/ctermid.3:27
74 #: build/C/man3/dprintf.3:27 build/C/man3/fclose.3:45
75 #: build/C/man3/fcloseall.3:26 build/C/man3/ferror.3:45
76 #: build/C/man3/fflush.3:46 build/C/man3/fgetc.3:28 build/C/man3/fgetwc.3:19
77 #: build/C/man3/flockfile.3:26 build/C/man3/fmemopen.3:11
78 #: build/C/man3/fmtmsg.3:14 build/C/man3/fopen.3:45
79 #: build/C/man3/fopencookie.3:27 build/C/man3/fpurge.3:26
80 #: build/C/man3/fputwc.3:17 build/C/man3/fread.3:46 build/C/man3/fseek.3:43
81 #: build/C/man3/fseeko.3:26 build/C/man3/getline.3:27 build/C/man3/gets.3:30
82 #: build/C/man3/getw.3:26 build/C/man2/link.2:33 build/C/man2/llseek.2:29
83 #: build/C/man2/lseek.2:48 build/C/man3/lseek64.3:26 build/C/man2/open.2:52
84 #: build/C/man2/open_by_handle_at.2:26 build/C/man3/perror.3:32
85 #: build/C/man2/pipe.2:37 build/C/man3/popen.3:41 build/C/man3/printf.3:35
86 #: build/C/man3/puts.3:27 build/C/man2/read.2:36 build/C/man2/readlink.2:45
87 #: build/C/man2/readv.2:33 build/C/man3/remove.3:32 build/C/man2/rename.2:34
88 #: build/C/man2/rmdir.2:31 build/C/man3/scanf.3:53 build/C/man3/setbuf.3:49
89 #: build/C/man3/stdin.3:14 build/C/man3/stdio.3:40 build/C/man3/stdio_ext.3:26
90 #: build/C/man2/symlink.2:34 build/C/man7/symlink.7:38
91 #: build/C/man3/tempnam.3:26 build/C/man3/tmpfile.3:32
92 #: build/C/man3/tmpnam.3:28 build/C/man2/unlink.2:34
93 #: build/C/man3/unlocked_stdio.3:26 build/C/man3/wprintf.3:17
94 #: build/C/man2/write.2:40
100 #: build/C/man3/asprintf.3:30
101 msgid "asprintf, vasprintf - print to allocated string"
102 msgstr "asprintf, vasprintf - 文字列を割り当ててそれに出力する"
105 #: build/C/man3/asprintf.3:30 build/C/man3/ctermid.3:29
106 #: build/C/man3/dprintf.3:29 build/C/man3/fclose.3:47
107 #: build/C/man3/fcloseall.3:28 build/C/man3/ferror.3:47
108 #: build/C/man3/fflush.3:48 build/C/man3/fgetc.3:30 build/C/man3/fgetwc.3:21
109 #: build/C/man3/flockfile.3:28 build/C/man3/fmemopen.3:13
110 #: build/C/man3/fmtmsg.3:16 build/C/man3/fopen.3:47
111 #: build/C/man3/fopencookie.3:29 build/C/man3/fpurge.3:28
112 #: build/C/man3/fputwc.3:19 build/C/man3/fread.3:48 build/C/man3/fseek.3:45
113 #: build/C/man3/fseeko.3:28 build/C/man3/getline.3:29 build/C/man3/gets.3:32
114 #: build/C/man3/getw.3:28 build/C/man2/link.2:35 build/C/man2/llseek.2:31
115 #: build/C/man2/lseek.2:50 build/C/man3/lseek64.3:28 build/C/man2/open.2:54
116 #: build/C/man2/open_by_handle_at.2:29 build/C/man3/perror.3:34
117 #: build/C/man2/pipe.2:39 build/C/man3/popen.3:43 build/C/man3/printf.3:38
118 #: build/C/man3/puts.3:29 build/C/man2/read.2:38 build/C/man2/readlink.2:47
119 #: build/C/man2/readv.2:35 build/C/man3/remove.3:34 build/C/man2/rename.2:36
120 #: build/C/man2/rmdir.2:33 build/C/man3/scanf.3:55 build/C/man3/setbuf.3:51
121 #: build/C/man3/stdin.3:16 build/C/man3/stdio.3:42 build/C/man3/stdio_ext.3:30
122 #: build/C/man2/symlink.2:36 build/C/man3/tempnam.3:28
123 #: build/C/man3/tmpfile.3:34 build/C/man3/tmpnam.3:30 build/C/man2/unlink.2:36
124 #: build/C/man3/unlocked_stdio.3:29 build/C/man3/wprintf.3:20
125 #: build/C/man2/write.2:42
131 #: build/C/man3/asprintf.3:32
132 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
133 msgstr "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */"
136 #: build/C/man3/asprintf.3:34 build/C/man3/dprintf.3:31
137 #: build/C/man3/fclose.3:49 build/C/man3/ferror.3:49 build/C/man3/fflush.3:50
138 #: build/C/man3/fseek.3:47 build/C/man3/perror.3:36 build/C/man3/printf.3:40
139 #: build/C/man3/remove.3:36 build/C/man3/stdio.3:44
140 #: build/C/man3/stdio_ext.3:32
141 msgid "B<#include E<lt>stdio.hE<gt>>"
142 msgstr "B<#include E<lt>stdio.hE<gt>>"
145 #: build/C/man3/asprintf.3:36
146 msgid "B<int asprintf(char **>I<strp>B<, const char *>I<fmt>B<, ...);>"
147 msgstr "B<int asprintf(char **>I<strp>B<, const char *>I<fmt>B<, ...);>"
150 #: build/C/man3/asprintf.3:38
152 "B<int vasprintf(char **>I<strp>B<, const char *>I<fmt>B<, va_list >I<ap>B<);>"
154 "B<int vasprintf(char **>I<strp>B<, const char *>I<fmt>B<, va_list >I<ap>B<);>"
157 #: build/C/man3/asprintf.3:38 build/C/man3/ctermid.3:46
158 #: build/C/man3/dprintf.3:55 build/C/man3/fclose.3:51
159 #: build/C/man3/fcloseall.3:35 build/C/man3/ferror.3:65
160 #: build/C/man3/fflush.3:52 build/C/man3/fgetc.3:44 build/C/man3/fgetwc.3:30
161 #: build/C/man3/flockfile.3:51 build/C/man3/fmemopen.3:46
162 #: build/C/man3/fmtmsg.3:26 build/C/man3/fopen.3:65
163 #: build/C/man3/fopencookie.3:37 build/C/man3/fpurge.3:42
164 #: build/C/man3/fputwc.3:28 build/C/man3/fread.3:58 build/C/man3/fseek.3:57
165 #: build/C/man3/fseeko.3:54 build/C/man3/getline.3:58 build/C/man3/gets.3:38
166 #: build/C/man3/getw.3:59 build/C/man2/link.2:66 build/C/man2/llseek.2:43
167 #: build/C/man2/lseek.2:56 build/C/man3/lseek64.3:36 build/C/man2/open.2:88
168 #: build/C/man2/open_by_handle_at.2:43 build/C/man3/perror.3:55
169 #: build/C/man2/pipe.2:51 build/C/man3/popen.3:64 build/C/man3/printf.3:76
170 #: build/C/man3/puts.3:43 build/C/man2/read.2:44 build/C/man2/readlink.2:86
171 #: build/C/man2/readv.2:58 build/C/man3/remove.3:38 build/C/man2/rename.2:72
172 #: build/C/man2/rmdir.2:37 build/C/man3/scanf.3:87 build/C/man3/setbuf.3:73
173 #: build/C/man3/stdin.3:24 build/C/man3/stdio.3:50 build/C/man3/stdio_ext.3:54
174 #: build/C/man2/symlink.2:74 build/C/man7/symlink.7:40
175 #: build/C/man3/tempnam.3:42 build/C/man3/tmpfile.3:40
176 #: build/C/man3/tmpnam.3:36 build/C/man2/unlink.2:66
177 #: build/C/man3/unlocked_stdio.3:106 build/C/man3/wprintf.3:58
178 #: build/C/man2/write.2:46
184 #: build/C/man3/asprintf.3:53
186 "The functions B<asprintf>() and B<vasprintf>() are analogs of "
187 "B<sprintf>(3) and B<vsprintf>(3), except that they allocate a string large "
188 "enough to hold the output including the terminating null byte (\\(aq"
189 "\\e0\\(aq), and return a pointer to it via the first argument. This pointer "
190 "should be passed to B<free>(3) to release the allocated storage when it is "
193 "B<asprintf>() 関数と B<vasprintf>() 関数とは、それぞれ B<sprintf>(3) 関数"
194 "と B<vsprintf>(3) 関数とに似ているが、 出力文字列を (終端のヌルバイト (\\(aq"
195 "\\e0\\(aq) も含めて) 保持するのに十分な大きさのメモリを確保し、 最初の引数に"
196 "その文字列へのポインタを返す。 このポインタは、不要になったら B<free>(3) に"
197 "渡し、割り当てられた記憶領域を解放すべきである。"
200 #: build/C/man3/asprintf.3:53 build/C/man3/ctermid.3:59
201 #: build/C/man3/fclose.3:59 build/C/man3/fcloseall.3:50
202 #: build/C/man3/fflush.3:74 build/C/man3/fgetc.3:99 build/C/man3/fgetwc.3:55
203 #: build/C/man3/flockfile.3:120 build/C/man3/fmemopen.3:176
204 #: build/C/man3/fmtmsg.3:152 build/C/man3/fopen.3:189
205 #: build/C/man3/fopencookie.3:238 build/C/man3/fpurge.3:58
206 #: build/C/man3/fputwc.3:54 build/C/man3/fread.3:83 build/C/man3/fseek.3:121
207 #: build/C/man3/fseeko.3:92 build/C/man3/getline.3:112 build/C/man3/gets.3:50
208 #: build/C/man3/getw.3:73 build/C/man2/link.2:187 build/C/man2/llseek.2:62
209 #: build/C/man2/lseek.2:179 build/C/man2/open.2:781
210 #: build/C/man2/open_by_handle_at.2:245 build/C/man2/pipe.2:129
211 #: build/C/man3/popen.3:123 build/C/man3/puts.3:84 build/C/man2/read.2:81
212 #: build/C/man2/readlink.2:153 build/C/man2/readv.2:177
213 #: build/C/man3/remove.3:60 build/C/man2/rename.2:203 build/C/man2/rmdir.2:40
214 #: build/C/man3/scanf.3:530 build/C/man3/setbuf.3:152
215 #: build/C/man2/symlink.2:140 build/C/man3/tempnam.3:94
216 #: build/C/man3/tmpfile.3:47 build/C/man3/tmpnam.3:79
217 #: build/C/man2/unlink.2:153 build/C/man3/wprintf.3:203
218 #: build/C/man2/write.2:89
224 #: build/C/man3/asprintf.3:61
226 "When successful, these functions return the number of bytes printed, just "
227 "like B<sprintf>(3). If memory allocation wasn't possible, or some other "
228 "error occurs, these functions will return -1, and the contents of I<strp> is "
231 "成功すると、これらの関数は出力されたバイト数を (B<sprintf>(3) のように) 返"
232 "す。 メモリの割り当てができなかったり、 その他エラーが生じると、 これらの関数"
233 "は -1 を返し、 I<strp> の内容は未定義となる。"
236 #: build/C/man3/asprintf.3:61 build/C/man3/ctermid.3:67
237 #: build/C/man3/dprintf.3:69 build/C/man3/fclose.3:90
238 #: build/C/man3/fcloseall.3:60 build/C/man3/ferror.3:115
239 #: build/C/man3/fflush.3:98 build/C/man3/fgetc.3:124 build/C/man3/fgetwc.3:70
240 #: build/C/man3/flockfile.3:135 build/C/man3/fmemopen.3:195
241 #: build/C/man3/fmtmsg.3:237 build/C/man3/fopen.3:246
242 #: build/C/man3/fopencookie.3:245 build/C/man3/fpurge.3:70
243 #: build/C/man3/fputwc.3:68 build/C/man3/fread.3:103 build/C/man3/fseek.3:169
244 #: build/C/man3/fseeko.3:104 build/C/man3/getline.3:139 build/C/man3/gets.3:58
245 #: build/C/man3/getw.3:80 build/C/man2/link.2:338 build/C/man2/llseek.2:81
246 #: build/C/man2/lseek.2:217 build/C/man2/open.2:1019
247 #: build/C/man2/open_by_handle_at.2:352 build/C/man3/perror.3:111
248 #: build/C/man2/pipe.2:155 build/C/man3/popen.3:172 build/C/man3/printf.3:807
249 #: build/C/man3/puts.3:103 build/C/man2/read.2:173 build/C/man2/readlink.2:216
250 #: build/C/man2/readv.2:214 build/C/man3/remove.3:75 build/C/man2/rename.2:405
251 #: build/C/man2/rmdir.2:127 build/C/man3/scanf.3:577 build/C/man3/setbuf.3:173
252 #: build/C/man3/stdin.3:113 build/C/man3/stdio.3:246
253 #: build/C/man2/symlink.2:228 build/C/man3/tempnam.3:105
254 #: build/C/man3/tmpfile.3:78 build/C/man3/tmpnam.3:96
255 #: build/C/man2/unlink.2:273 build/C/man3/unlocked_stdio.3:113
256 #: build/C/man3/wprintf.3:211 build/C/man2/write.2:185
258 msgid "CONFORMING TO"
262 #: build/C/man3/asprintf.3:67
264 "These functions are GNU extensions, not in C or POSIX. They are also "
265 "available under *BSD. The FreeBSD implementation sets I<strp> to NULL on "
268 "これらの関数は GNU の拡張であり、C や POSIX のものではない。 これらは *BSD で"
269 "も利用できる。 FreeBSD の実装では、エラーの際には I<strp> を NULL にセットす"
273 #: build/C/man3/asprintf.3:67 build/C/man3/ctermid.3:77
274 #: build/C/man3/dprintf.3:95 build/C/man3/fclose.3:102
275 #: build/C/man3/fcloseall.3:62 build/C/man3/ferror.3:126
276 #: build/C/man3/fflush.3:113 build/C/man3/fgetc.3:133 build/C/man3/fgetwc.3:87
277 #: build/C/man3/flockfile.3:143 build/C/man3/fmemopen.3:341
278 #: build/C/man3/fmtmsg.3:309 build/C/man3/fopen.3:348
279 #: build/C/man3/fopencookie.3:437 build/C/man3/fpurge.3:80
280 #: build/C/man3/fputwc.3:85 build/C/man3/fread.3:105 build/C/man3/fseek.3:171
281 #: build/C/man3/fseeko.3:110 build/C/man3/getline.3:173 build/C/man3/gets.3:90
282 #: build/C/man3/getw.3:87 build/C/man2/link.2:391 build/C/man2/llseek.2:87
283 #: build/C/man2/lseek.2:262 build/C/man3/lseek64.3:164
284 #: build/C/man2/open.2:1459 build/C/man2/open_by_handle_at.2:720
285 #: build/C/man3/perror.3:139 build/C/man2/pipe.2:228 build/C/man3/popen.3:201
286 #: build/C/man3/printf.3:1085 build/C/man3/puts.3:112 build/C/man2/read.2:226
287 #: build/C/man2/readlink.2:313 build/C/man2/readv.2:284
288 #: build/C/man3/remove.3:86 build/C/man2/rename.2:425 build/C/man2/rmdir.2:132
289 #: build/C/man3/scanf.3:738 build/C/man3/setbuf.3:209 build/C/man3/stdin.3:154
290 #: build/C/man3/stdio.3:250 build/C/man3/stdio_ext.3:151
291 #: build/C/man2/symlink.2:247 build/C/man7/symlink.7:512
292 #: build/C/man3/tempnam.3:168 build/C/man3/tmpfile.3:97
293 #: build/C/man3/tmpnam.3:172 build/C/man2/unlink.2:284
294 #: build/C/man3/unlocked_stdio.3:136 build/C/man3/wprintf.3:251
295 #: build/C/man2/write.2:250
301 #: build/C/man3/asprintf.3:71
302 msgid "B<free>(3), B<malloc>(3), B<printf>(3)"
303 msgstr "B<free>(3), B<malloc>(3), B<printf>(3)"
306 #: build/C/man3/asprintf.3:71 build/C/man3/ctermid.3:79
307 #: build/C/man3/dprintf.3:97 build/C/man3/fclose.3:108
308 #: build/C/man3/fcloseall.3:68 build/C/man3/ferror.3:131
309 #: build/C/man3/fflush.3:121 build/C/man3/fgetc.3:150 build/C/man3/fgetwc.3:92
310 #: build/C/man3/flockfile.3:145 build/C/man3/fmemopen.3:344
311 #: build/C/man3/fmtmsg.3:312 build/C/man3/fopen.3:354
312 #: build/C/man3/fopencookie.3:442 build/C/man3/fpurge.3:85
313 #: build/C/man3/fputwc.3:89 build/C/man3/fread.3:111 build/C/man3/fseek.3:174
314 #: build/C/man3/fseeko.3:112 build/C/man3/getline.3:179
315 #: build/C/man3/gets.3:108 build/C/man3/getw.3:93 build/C/man2/link.2:400
316 #: build/C/man2/llseek.2:90 build/C/man2/lseek.2:269
317 #: build/C/man3/lseek64.3:167 build/C/man2/open.2:1481
318 #: build/C/man2/open_by_handle_at.2:736 build/C/man3/perror.3:144
319 #: build/C/man2/pipe.2:235 build/C/man3/popen.3:211 build/C/man3/printf.3:1094
320 #: build/C/man3/puts.3:124 build/C/man2/read.2:239 build/C/man2/readlink.2:320
321 #: build/C/man2/readv.2:288 build/C/man3/remove.3:97 build/C/man2/rename.2:433
322 #: build/C/man2/rmdir.2:141 build/C/man3/scanf.3:745 build/C/man3/setbuf.3:217
323 #: build/C/man3/stdin.3:160 build/C/man3/stdio.3:257
324 #: build/C/man3/stdio_ext.3:154 build/C/man2/symlink.2:258
325 #: build/C/man7/symlink.7:530 build/C/man3/tempnam.3:173
326 #: build/C/man3/tmpfile.3:103 build/C/man3/tmpnam.3:177
327 #: build/C/man2/unlink.2:296 build/C/man3/unlocked_stdio.3:139
328 #: build/C/man3/wprintf.3:258 build/C/man2/write.2:262
334 #: build/C/man3/asprintf.3:79 build/C/man3/ctermid.3:87
335 #: build/C/man3/dprintf.3:105 build/C/man3/fclose.3:116
336 #: build/C/man3/fcloseall.3:76 build/C/man3/ferror.3:139
337 #: build/C/man3/fflush.3:129 build/C/man3/fgetc.3:158
338 #: build/C/man3/fgetwc.3:100 build/C/man3/flockfile.3:153
339 #: build/C/man3/fmemopen.3:352 build/C/man3/fmtmsg.3:320
340 #: build/C/man3/fopen.3:362 build/C/man3/fopencookie.3:450
341 #: build/C/man3/fpurge.3:93 build/C/man3/fputwc.3:97 build/C/man3/fread.3:119
342 #: build/C/man3/fseek.3:182 build/C/man3/fseeko.3:120
343 #: build/C/man3/getline.3:187 build/C/man3/gets.3:116 build/C/man3/getw.3:101
344 #: build/C/man2/link.2:408 build/C/man2/llseek.2:98 build/C/man2/lseek.2:277
345 #: build/C/man3/lseek64.3:175 build/C/man2/open.2:1489
346 #: build/C/man2/open_by_handle_at.2:744 build/C/man3/perror.3:152
347 #: build/C/man2/pipe.2:243 build/C/man3/popen.3:219 build/C/man3/printf.3:1102
348 #: build/C/man3/puts.3:132 build/C/man2/read.2:247 build/C/man2/readlink.2:328
349 #: build/C/man2/readv.2:296 build/C/man3/remove.3:105
350 #: build/C/man2/rename.2:441 build/C/man2/rmdir.2:149 build/C/man3/scanf.3:753
351 #: build/C/man3/setbuf.3:225 build/C/man3/stdin.3:168 build/C/man3/stdio.3:265
352 #: build/C/man3/stdio_ext.3:162 build/C/man2/symlink.2:266
353 #: build/C/man7/symlink.7:538 build/C/man3/tempnam.3:181
354 #: build/C/man3/tmpfile.3:111 build/C/man3/tmpnam.3:185
355 #: build/C/man2/unlink.2:304 build/C/man3/unlocked_stdio.3:147
356 #: build/C/man3/wprintf.3:266 build/C/man2/write.2:270
358 "This page is part of release 3.68 of the Linux I<man-pages> project. A "
359 "description of the project, information about reporting bugs, and the latest "
360 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
363 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.68 の一部\n"
364 "である。プロジェクトの説明とバグ報告に関する情報は\n"
365 "http://www.kernel.org/doc/man-pages/ に書かれている。"
368 #: build/C/man3/ctermid.3:26
374 #: build/C/man3/ctermid.3:26
380 #: build/C/man3/ctermid.3:29
381 msgid "ctermid - get controlling terminal name"
382 msgstr "ctermid - 制御端末名の取得"
385 #: build/C/man3/ctermid.3:34 build/C/man3/fgetc.3:33 build/C/man3/fgetwc.3:24
386 #: build/C/man3/flockfile.3:31 build/C/man3/fmemopen.3:16
387 #: build/C/man3/fopen.3:50 build/C/man3/fputwc.3:22 build/C/man3/fread.3:51
388 #: build/C/man3/fseeko.3:31 build/C/man3/getline.3:32 build/C/man3/gets.3:35
389 #: build/C/man3/getw.3:31 build/C/man3/popen.3:46 build/C/man3/puts.3:32
390 #: build/C/man2/rename.2:39 build/C/man3/scanf.3:58 build/C/man3/setbuf.3:54
391 #: build/C/man3/stdin.3:19 build/C/man3/tempnam.3:31 build/C/man3/tmpfile.3:37
392 #: build/C/man3/tmpnam.3:33 build/C/man3/unlocked_stdio.3:32
394 msgid "B<#include E<lt>stdio.hE<gt>>\n"
395 msgstr "B<#include E<lt>stdio.hE<gt>>\n"
398 #: build/C/man3/ctermid.3:36
400 msgid "B<char *ctermid(char *>I<s>B<);>\n"
401 msgstr "B<char *ctermid(char *>I<s>B<);>\n"
404 #: build/C/man3/ctermid.3:41 build/C/man3/dprintf.3:39
405 #: build/C/man3/ferror.3:61 build/C/man3/flockfile.3:42
406 #: build/C/man3/fmemopen.3:29 build/C/man3/fopen.3:61 build/C/man3/fseeko.3:41
407 #: build/C/man3/getline.3:42 build/C/man3/getw.3:40 build/C/man2/link.2:51
408 #: build/C/man2/open.2:73 build/C/man3/perror.3:50 build/C/man3/popen.3:55
409 #: build/C/man3/printf.3:63 build/C/man2/readlink.2:64 build/C/man2/readv.2:53
410 #: build/C/man2/rename.2:56 build/C/man3/scanf.3:73 build/C/man3/setbuf.3:68
411 #: build/C/man2/symlink.2:52 build/C/man3/tempnam.3:38
412 #: build/C/man2/unlink.2:51 build/C/man3/unlocked_stdio.3:68
413 #: build/C/man3/wprintf.3:39
415 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
416 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
418 #. From <unistd.h>: _XOPEN_SOURCE
420 #: build/C/man3/ctermid.3:46
422 "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
424 "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
427 #: build/C/man3/ctermid.3:59
429 "B<ctermid>() returns a string which is the pathname for the current "
430 "controlling terminal for this process. If I<s> is NULL, a static buffer is "
431 "used, otherwise I<s> points to a buffer used to hold the terminal pathname. "
432 "The symbolic constant B<L_ctermid> is the maximum number of characters in "
433 "the returned pathname."
435 "B<ctermid>() はプロセスの現在の制御端末のパス名を返す。 I<s> が NULL の場"
436 "合、静的なバッファを用いる。それ以外の場合、 I<s> は端末パス名を保持するのに"
437 "使用されるバッファへのポインタとなる。 シンボル定数 B<L_ctermid> は返されるパ"
441 #: build/C/man3/ctermid.3:61
442 msgid "The pointer to the pathname."
446 #: build/C/man3/ctermid.3:61 build/C/man3/fcloseall.3:55
447 #: build/C/man3/ferror.3:106 build/C/man3/fflush.3:93
448 #: build/C/man3/flockfile.3:127 build/C/man3/fmtmsg.3:225
449 #: build/C/man3/lseek64.3:159 build/C/man3/remove.3:70
450 #: build/C/man3/setbuf.3:164 build/C/man3/stdio_ext.3:132
451 #: build/C/man3/tmpnam.3:86
457 #: build/C/man3/ctermid.3:62 build/C/man3/fcloseall.3:56
458 #: build/C/man3/ferror.3:107 build/C/man3/fflush.3:94
459 #: build/C/man3/flockfile.3:128 build/C/man3/fmtmsg.3:226
460 #: build/C/man3/lseek64.3:160 build/C/man3/remove.3:71
461 #: build/C/man3/setbuf.3:165 build/C/man3/stdio_ext.3:133
462 #: build/C/man3/tmpnam.3:87
464 msgid "Multithreading (see pthreads(7))"
465 msgstr "マルチスレッディング (pthreads(7) 参照)"
468 #: build/C/man3/ctermid.3:67
470 "The B<ctermid>() function is thread-safe with exceptions. It is not thread-"
471 "safe if called with a NULL parameter."
473 "B<ctermid>() 関数は例外付きでスレッドセーフである。 NULL パラメータで呼び出さ"
477 #: build/C/man3/ctermid.3:69
478 msgid "Svr4, POSIX.1-2001."
479 msgstr "SVr4, POSIX.1-2001."
482 #: build/C/man3/ctermid.3:69 build/C/man3/fmemopen.3:213
483 #: build/C/man3/fopen.3:331 build/C/man3/gets.3:72 build/C/man3/getw.3:83
484 #: build/C/man2/link.2:385 build/C/man2/open.2:1440 build/C/man3/popen.3:178
485 #: build/C/man3/printf.3:930 build/C/man3/puts.3:105 build/C/man2/read.2:187
486 #: build/C/man2/readv.2:258 build/C/man3/remove.3:83 build/C/man2/rename.2:414
487 #: build/C/man2/rmdir.2:129 build/C/man3/scanf.3:669 build/C/man3/setbuf.3:179
488 #: build/C/man3/tempnam.3:165 build/C/man3/tmpnam.3:165
489 #: build/C/man2/unlink.2:281 build/C/man2/write.2:211
495 #: build/C/man3/ctermid.3:73
497 "The path returned may not uniquely identify the controlling terminal; it "
498 "may, for example, be I</dev/tty>."
500 "返されたパスはたぶん制御端末を一意には特定できない。 たとえば I</dev/tty> の"
503 #. in glibc 2.3.x, x >= 4, the glibc headers threw an error
504 #. if ctermid() was given an argument; fixed in 2.4.
506 #: build/C/man3/ctermid.3:77
507 msgid "It is not assured that the program can open the terminal."
508 msgstr "プログラムが端末をオープンできることは保証されていない。"
511 #: build/C/man3/ctermid.3:79
512 msgid "B<ttyname>(3)"
513 msgstr "B<ttyname>(3)"
516 #: build/C/man3/dprintf.3:26
522 #: build/C/man3/dprintf.3:26
528 #: build/C/man3/dprintf.3:29
529 msgid "dprintf, vdprintf - print to a file descriptor"
530 msgstr "dprintf, vdprintf - ファイルディスクリプタに文字出力する"
533 #: build/C/man3/dprintf.3:33
534 msgid "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
535 msgstr "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
538 #: build/C/man3/dprintf.3:35
540 "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
542 "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
545 #: build/C/man3/dprintf.3:43
546 msgid "B<dprintf>(), B<vdprintf>():"
547 msgstr "B<dprintf>(), B<vdprintf>():"
550 #: build/C/man3/dprintf.3:46 build/C/man3/fmemopen.3:37
551 #: build/C/man3/getline.3:49 build/C/man2/link.2:57 build/C/man2/open.2:79
552 #: build/C/man2/readlink.2:77 build/C/man2/rename.2:62
553 #: build/C/man2/symlink.2:65 build/C/man2/unlink.2:57
555 msgid "Since glibc 2.10:"
556 msgstr "glibc 2.10 以降:"
559 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40 build/C/man2/link.2:60
560 #: build/C/man2/open.2:82 build/C/man2/readlink.2:80 build/C/man2/rename.2:65
561 #: build/C/man2/symlink.2:68 build/C/man2/unlink.2:60
562 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
563 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
566 #: build/C/man3/dprintf.3:49 build/C/man3/fmemopen.3:40
567 #: build/C/man3/getline.3:52 build/C/man2/link.2:60 build/C/man2/open.2:82
568 #: build/C/man2/readlink.2:80 build/C/man2/rename.2:65
569 #: build/C/man2/symlink.2:68 build/C/man2/unlink.2:60
571 msgid "Before glibc 2.10:"
572 msgstr "glibc 2.10 より前:"
575 #: build/C/man3/dprintf.3:52 build/C/man3/fmemopen.3:43
576 #: build/C/man3/getline.3:55 build/C/man3/unlocked_stdio.3:104
581 #: build/C/man3/dprintf.3:69
583 "The functions B<dprintf>() and B<vdprintf>() (as found in the glibc2 "
584 "library) are exact analogs of B<fprintf>(3) and B<vfprintf>(3), except that "
585 "they output to a file descriptor I<fd> instead of to a I<stdio> stream."
587 "(glibc2 ライブラリにおける) B<dprintf>() 関数と B<vdprintf>() 関数とは、そ"
588 "れぞれ B<fprintf>(3) 関数と B<vfprintf>(3) 関数とにちょうど対応するが、 こ"
589 "れらは I<stdio> ストリームではなくファイルディスクリプタ I<fd> に対して出力を"
593 #. These functions are GNU extensions, not in C or POSIX.
594 #. Clearly, the names were badly chosen.
595 #. Many systems (like MacOS) have incompatible functions called
597 #. usually some debugging version of
599 #. perhaps with a prototype like
600 #. .BI "void dprintf(int level, const char *" format ", ...);"
601 #. where the first argument is a debugging level (and output is to
607 #. is also a popular macro name for a debugging printf.
608 #. So, probably, it is better to avoid this function in programs
609 #. intended to be portable.
610 #. A better name would have been
613 #: build/C/man3/dprintf.3:95
615 "These functions are GNU extensions that are nowadays specified in "
618 "これらの関数は GNU による拡張であり、 現在では POSIX.1-2008 で規定されてい"
622 #: build/C/man3/dprintf.3:97
624 msgstr "B<printf>(3)"
627 #: build/C/man3/fclose.3:44
633 #: build/C/man3/fclose.3:44
639 #: build/C/man3/fclose.3:47
640 msgid "fclose - close a stream"
641 msgstr "fclose - ストリームを閉じる"
644 #: build/C/man3/fclose.3:51
645 msgid "B<int fclose(FILE *>I<fp>B<);>"
646 msgstr "B<int fclose(FILE *>I<fp>B<);>"
649 #: build/C/man3/fclose.3:59
651 "The B<fclose>() function flushes the stream pointed to by I<fp> (writing "
652 "any buffered output data using B<fflush>(3)) and closes the underlying file "
655 "B<fclose>() 関数は、 I<fp> が指すストリームを (バッファリングされて\n"
656 "いた全ての出力データを B<fflush>(3) を用いて書き込んで) フラッシュし、\n"
657 "対応するファイルディスクリプタをクローズする。"
660 #: build/C/man3/fclose.3:70
662 "Upon successful completion 0 is returned. Otherwise, B<EOF> is returned and "
663 "I<errno> is set to indicate the error. In either case any further access "
664 "(including another call to B<fclose>()) to the stream results in undefined "
667 "関数が正常に終了すると 0 が返される。 正常に終了しなかった場合には B<EOF> が"
668 "返され、 I<errno> がエラーを示すために設定される。 どちらの場合も、そのスト"
669 "リームに対する (B<fclose>() へのさらなる呼び出しを含む) それ以上のアクセス"
673 #: build/C/man3/fclose.3:70 build/C/man3/ferror.3:96 build/C/man3/fflush.3:81
674 #: build/C/man3/fgetwc.3:64 build/C/man3/flockfile.3:125
675 #: build/C/man3/fopen.3:201 build/C/man3/fpurge.3:65 build/C/man3/fputwc.3:63
676 #: build/C/man3/fseek.3:136 build/C/man3/fseeko.3:101
677 #: build/C/man3/getline.3:127 build/C/man2/link.2:192 build/C/man2/llseek.2:69
678 #: build/C/man2/lseek.2:187 build/C/man2/open.2:790
679 #: build/C/man2/open_by_handle_at.2:256 build/C/man2/pipe.2:134
680 #: build/C/man3/popen.3:146 build/C/man2/read.2:95 build/C/man2/readlink.2:159
681 #: build/C/man2/readv.2:188 build/C/man3/remove.3:65 build/C/man2/rename.2:208
682 #: build/C/man2/rmdir.2:45 build/C/man3/scanf.3:547 build/C/man2/symlink.2:145
683 #: build/C/man3/tempnam.3:101 build/C/man3/tmpfile.3:56
684 #: build/C/man3/tmpnam.3:84 build/C/man2/unlink.2:158 build/C/man2/write.2:107
690 #: build/C/man3/fclose.3:71 build/C/man3/fflush.3:82 build/C/man3/fpurge.3:66
691 #: build/C/man3/fseek.3:137 build/C/man2/link.2:276 build/C/man2/llseek.2:70
692 #: build/C/man2/lseek.2:188 build/C/man2/open.2:1005
693 #: build/C/man2/open_by_handle_at.2:317 build/C/man2/read.2:114
694 #: build/C/man2/readlink.2:202 build/C/man2/rename.2:349
695 #: build/C/man3/scanf.3:553 build/C/man2/symlink.2:208
696 #: build/C/man2/unlink.2:248 build/C/man2/write.2:126
701 #. This error cannot occur unless you are mixing ANSI C stdio operations and
702 #. low-level file operations on the same stream. If you do get this error,
703 #. you must have closed the stream's low-level file descriptor using
704 #. something like close(fileno(fp)).
706 #: build/C/man3/fclose.3:80
707 msgid "The file descriptor underlying I<fp> is not valid."
708 msgstr "I<fp> の基となるファイルディスクリプタが不正である。"
711 #: build/C/man3/fclose.3:90
713 "The B<fclose>() function may also fail and set I<errno> for any of the "
714 "errors specified for the routines B<close>(2), B<write>(2) or B<fflush>(3)."
716 "B<fclose>() 関数はこれ以外にも B<close>(2), B<write>(2), B<fflush>(3) の"
717 "ルーチンで失敗することがある。その場合は I<errno> が、失敗したルーチンで設定"
721 #: build/C/man3/fclose.3:92 build/C/man3/fseek.3:171 build/C/man3/puts.3:105
726 #: build/C/man3/fclose.3:92 build/C/man3/fflush.3:104 build/C/man3/fgetwc.3:72
727 #: build/C/man3/fmemopen.3:207 build/C/man3/fmtmsg.3:252
728 #: build/C/man3/fopen.3:255 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:70
729 #: build/C/man3/fseeko.3:106 build/C/man2/link.2:347 build/C/man2/llseek.2:84
730 #: build/C/man2/lseek.2:227 build/C/man2/open.2:1063
731 #: build/C/man2/open_by_handle_at.2:359 build/C/man3/perror.3:124
732 #: build/C/man3/printf.3:868 build/C/man2/read.2:175
733 #: build/C/man2/readlink.2:225 build/C/man2/readv.2:226
734 #: build/C/man3/remove.3:77 build/C/man3/scanf.3:608 build/C/man3/stdin.3:122
735 #: build/C/man2/symlink.2:238 build/C/man3/tempnam.3:110
736 #: build/C/man3/tmpfile.3:80 build/C/man3/tmpnam.3:101
737 #: build/C/man3/wprintf.3:213 build/C/man2/write.2:194
743 #: build/C/man3/fclose.3:102
745 "Note that B<fclose>() only flushes the user-space buffers provided by the C "
746 "library. To ensure that the data is physically stored on disk the kernel "
747 "buffers must be flushed too, for example, with B<sync>(2) or B<fsync>(2)."
749 "B<fclose>() は C ライブラリで提供されたユーザー空間バッファをフラッシュする"
750 "だけで ある点に注意すること。 データを確実に物理的にディスクに記録するために"
751 "は カーネルバッファも (B<sync>(2) や B<fsync>(2) を用いて) フラッシュしなけ"
755 #: build/C/man3/fclose.3:108
756 msgid "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
757 msgstr "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
760 #: build/C/man3/fcloseall.3:25
766 #: build/C/man3/fcloseall.3:28
767 msgid "fcloseall - close all open streams"
768 msgstr "fcloseall - 開いているすべてのストリームを閉じる"
771 #: build/C/man3/fcloseall.3:32 build/C/man3/fopencookie.3:33
774 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
775 "B<#include E<lt>stdio.hE<gt>>\n"
777 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
778 "B<#include E<lt>stdio.hE<gt>>\n"
781 #: build/C/man3/fcloseall.3:34
783 msgid "B<int fcloseall(void);>\n"
784 msgstr "B<int fcloseall(void);>\n"
787 #: build/C/man3/fcloseall.3:43
789 "The B<fcloseall>() function closes all of the calling process's open "
790 "streams. Buffered output for each stream is written before it is closed (as "
791 "for B<fflush>(3)); buffered input is discarded."
793 "B<fcloseall>() 関数は、呼び出し元プロセスが開いているすべてのストリームを閉"
794 "じる。 ストリームを閉じる前に、 (B<fflush>(3) と同じように) 各ストリームの"
795 "バッファに溜っている出力データは書き出される。 入力バッファ内のデータは破棄さ"
799 #: build/C/man3/fcloseall.3:50
801 "The standard streams, I<stdin>, I<stdout>, and I<stderr> are also closed."
802 msgstr "標準入出力 I<stdin>, I<stdout>, I<stderr> も閉じられる。"
805 #: build/C/man3/fcloseall.3:55
807 "This function returns 0 if all files were successfully closed; on error, "
808 "B<EOF> is returned."
810 "この関数は、すべてのファイルが正常に閉じられた場合 0 を返す。 エラーの場合、 "
814 #: build/C/man3/fcloseall.3:60
816 "The B<fcloseall>() function does not lock the streams, so it is not thread-"
819 "B<fcloseall>() 関数はストリームのロックを行わない。そのため、スレッドセーフで"
823 #: build/C/man3/fcloseall.3:62
824 msgid "This function is a GNU extension."
825 msgstr "この関数は GNU 拡張である。"
828 #: build/C/man3/fcloseall.3:68
829 msgid "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
830 msgstr "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
833 #: build/C/man3/ferror.3:44
839 #: build/C/man3/ferror.3:44
845 #: build/C/man3/ferror.3:47
846 msgid "clearerr, feof, ferror, fileno - check and reset stream status"
848 "clearerr, feof, ferror, fileno - ストリームステータスのチェックとリセット"
851 #: build/C/man3/ferror.3:51
852 msgid "B<void clearerr(FILE *>I<stream>B<);>"
853 msgstr "B<void clearerr(FILE *>I<stream>B<);>"
856 #: build/C/man3/ferror.3:53
857 msgid "B<int feof(FILE *>I<stream>B<);>"
858 msgstr "B<int feof(FILE *>I<stream>B<);>"
861 #: build/C/man3/ferror.3:55
862 msgid "B<int ferror(FILE *>I<stream>B<);>"
863 msgstr "B<int ferror(FILE *>I<stream>B<);>"
866 #: build/C/man3/ferror.3:57
867 msgid "B<int fileno(FILE *>I<stream>B<);>"
868 msgstr "B<int fileno(FILE *>I<stream>B<);>"
871 #: build/C/man3/ferror.3:65
873 "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
875 "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
878 #: build/C/man3/ferror.3:70
880 "The function B<clearerr>() clears the end-of-file and error indicators for "
881 "the stream pointed to by I<stream>."
883 "関数 B<clearerr>() は I<stream> で示されるストリームの EOF(end-of-file) 指示"
887 #: build/C/man3/ferror.3:78
889 "The function B<feof>() tests the end-of-file indicator for the stream "
890 "pointed to by I<stream>, returning nonzero if it is set. The end-of-file "
891 "indicator can be cleared only by the function B<clearerr>()."
893 "関数 B<feof>() は I<stream> で示されるストリームの EOF 指示子をテストし、 "
894 "セットされていれば 0 以外の数を返す。 EOF 指示子は、関数 B<clearerr>() に"
898 #: build/C/man3/ferror.3:87
900 "The function B<ferror>() tests the error indicator for the stream pointed "
901 "to by I<stream>, returning nonzero if it is set. The error indicator can be "
902 "reset only by the B<clearerr>() function."
904 "関数 B<ferror>() は I<stream> で示されるストリームのエラー指示子をテスト"
905 "し、 セットされていれば 0 以外の数を返す。 エラー指示子は、関数 "
906 "B<clearerr>() によってのみリセットすることができる。"
909 #: build/C/man3/ferror.3:93
911 "The function B<fileno>() examines the argument I<stream> and returns its "
912 "integer descriptor."
914 "関数 B<fileno>() は、引数 I<stream> を調べ、その整数のディスクリプタを返す。"
917 #: build/C/man3/ferror.3:96 build/C/man3/fgetc.3:99 build/C/man3/fgetwc.3:55
918 #: build/C/man3/fputwc.3:54 build/C/man3/fread.3:83 build/C/man3/puts.3:84
919 msgid "For nonlocking counterparts, see B<unlocked_stdio>(3)."
921 "これらの処理を停止せずに行いたいときは、 B<unlocked_stdio>(3) を参照のこと。"
924 #: build/C/man3/ferror.3:106
926 "These functions should not fail and do not set the external variable "
927 "I<errno>. (However, in case B<fileno>() detects that its argument is not a "
928 "valid stream, it must return -1 and set I<errno> to B<EBADF>.)"
930 "これらの関数は失敗すべきではなく、また、外部変数 I<errno> に値をセットしな"
931 "い。 (しかし、 B<fileno>() 関数の場合で、引数が有効なストリームでなかった場"
932 "合、 関数は -1 を返し、 I<errno> に B<EBADF> を設定しなければならない。)"
935 #: build/C/man3/ferror.3:115
937 "The B<clearerr>(), B<feof>(), B<ferror>(), and B<fileno>() functions are "
940 "関数 B<clearerr>(), B<feof>(), B<ferror>(), B<fileno>() はスレッドセーフであ"
944 #: build/C/man3/ferror.3:122
946 "The functions B<clearerr>(), B<feof>(), and B<ferror>() conform to C89, "
947 "C99, POSIX.1-2001, and POSIX.1-2008."
949 "関数 B<clearerr>(), B<feof>(), B<ferror>() は C89, C99, POSIX.1-2001, "
950 "POSIX.1-2008 に準拠している。"
953 #: build/C/man3/ferror.3:126
954 msgid "The function B<fileno>() conforms to POSIX.1-2001 and POSIX.1-2008."
955 msgstr "関数 B<fileno>() は POSIX.1-2001 と POSIX.1-2008 に準拠している。"
958 #: build/C/man3/ferror.3:131
959 msgid "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
960 msgstr "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
963 #: build/C/man3/fflush.3:45
969 #: build/C/man3/fflush.3:45
975 #: build/C/man3/fflush.3:48
976 msgid "fflush - flush a stream"
977 msgstr "fflush - ストリームの内容を強制的に出力(フラッシュ)する"
980 #: build/C/man3/fflush.3:52
981 msgid "B<int fflush(FILE *>I<stream>B<);>"
982 msgstr "B<int fflush(FILE *>I<stream>B<);>"
985 #: build/C/man3/fflush.3:63
987 "For output streams, B<fflush>() forces a write of all user-space buffered "
988 "data for the given output or update I<stream> via the stream's underlying "
989 "write function. For input streams, B<fflush>() discards any buffered data "
990 "that has been fetched from the underlying file, but has not been consumed by "
991 "the application. The open status of the stream is unaffected."
993 "出力ストリームに関しては、 B<fflush>() は、ユーザー空間でバッファリングされ"
994 "ているすべてのデータを 指定された出力に書き出す (フラッシュする)、 もしくはス"
995 "トリーム I<stream> の下位にある書き込み関数を用いてこのストリームを更新す"
996 "る。 入力ストリームに関しては、 B<fflush>() は、対応するファイルから取得され"
997 "たが、アプリケーションからは 読み出されていないバッファデータを全て破棄す"
998 "る。 ストリームは開いた状態のままであり、 この関数によって何の影響も受けな"
1002 #: build/C/man3/fflush.3:71
1004 "If the I<stream> argument is NULL, B<fflush>() flushes I<all> open output "
1007 "I<stream> 引数が NULL ならば、 B<fflush>() は開いているI<すべての>出力スト"
1011 #: build/C/man3/fflush.3:74
1012 msgid "For a nonlocking counterpart, see B<unlocked_stdio>(3)."
1014 "これらの処理をロックせずに行いたいときは、 B<unlocked_stdio>(3) を参照のこ"
1018 #: build/C/man3/fflush.3:81
1020 "Upon successful completion 0 is returned. Otherwise, B<EOF> is returned and "
1021 "I<errno> is set to indicate the error."
1023 "成功すると 0 が返される。 その他の場合には B<EOF> が返され、 I<errno> が、エ"
1027 #: build/C/man3/fflush.3:86
1028 msgid "I<Stream> is not an open stream, or is not open for writing."
1030 "I<Stream> は開いているストリームではない。 あるいはストリームは書き込み用では"
1034 #: build/C/man3/fflush.3:93
1036 "The function B<fflush>() may also fail and set I<errno> for any of the "
1037 "errors specified for B<write>(2)."
1039 "B<fflush>() 関数は B<write>(2) に関して規定されているエラーで失敗することも"
1040 "ある。 この場合 I<errno> もその値に設定される。"
1043 #: build/C/man3/fflush.3:98
1044 msgid "The B<fflush>() function is thread-safe."
1045 msgstr "関数 B<fflush>() はスレッドセーフである。"
1048 #: build/C/man3/fflush.3:100
1049 msgid "C89, C99, POSIX.1-2001, POSIX.1-2008."
1050 msgstr "C89, C99, POSIX.1-2001, POSIX.1-2008."
1052 #. Verified on: Solaris 8.
1054 #: build/C/man3/fflush.3:104
1056 "The standards do not specify the behavior for input streams. Most other "
1057 "implementations behave the same as Linux."
1059 "標準では、入力ストリームに対する動作は規定されていない。 他のほとんどの実装"
1063 #: build/C/man3/fflush.3:113
1065 "Note that B<fflush>() only flushes the user-space buffers provided by the C "
1066 "library. To ensure that the data is physically stored on disk the kernel "
1067 "buffers must be flushed too, for example, with B<sync>(2) or B<fsync>(2)."
1069 "B<fflush>() は、 C ライブラリが与えているユーザー空間のバッファしかフラッ"
1070 "シュしない。 データが物理的にディスクに保存されることを保証したければ、 カー"
1071 "ネルバッファもフラッシュしなければならない。 これには例えば B<sync>(2) や "
1075 #: build/C/man3/fflush.3:121
1077 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
1078 "B<setbuf>(3), B<unlocked_stdio>(3)"
1080 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
1081 "B<setbuf>(3), B<unlocked_stdio>(3)"
1084 #: build/C/man3/fgetc.3:27
1090 #: build/C/man3/fgetc.3:27
1096 #: build/C/man3/fgetc.3:30
1097 msgid "fgetc, fgets, getc, getchar, ungetc - input of characters and strings"
1098 msgstr "fgetc, fgets, getc, getchar, ungetc - 文字と文字列の入力"
1101 #: build/C/man3/fgetc.3:35
1103 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
1104 msgstr "B<int fgetc(FILE *>I<stream>B<);>\n"
1107 #: build/C/man3/fgetc.3:37
1109 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
1110 msgstr "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
1113 #: build/C/man3/fgetc.3:39
1115 msgid "B<int getc(FILE *>I<stream>B<);>\n"
1116 msgstr "B<int getc(FILE *>I<stream>B<);>\n"
1119 #: build/C/man3/fgetc.3:41
1121 msgid "B<int getchar(void);>\n"
1122 msgstr "B<int getchar(void);>\n"
1125 #: build/C/man3/fgetc.3:43
1127 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
1128 msgstr "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
1131 #: build/C/man3/fgetc.3:55
1133 "B<fgetc>() reads the next character from I<stream> and returns it as an "
1134 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
1136 "B<fgetc>() は、 I<stream> から次の文字を I<unsigned char> として読み、 "
1137 "I<int> にキャストして返す。ファイルの終わりやエラーとなった場合は B<EOF> を返"
1141 #: build/C/man3/fgetc.3:62
1143 "B<getc>() is equivalent to B<fgetc>() except that it may be implemented as "
1144 "a macro which evaluates I<stream> more than once."
1146 "B<getc>() は B<fgetc>() と同様だが、 I<stream> を複数回評価するマクロとして"
1150 #: build/C/man3/fgetc.3:66
1151 msgid "B<getchar>() is equivalent to B<getc(>I<stdin>B<)>."
1152 msgstr "B<getchar>() は B<getc(>I<stdin>B<)> と同じである。"
1155 #: build/C/man3/fgetc.3:80
1157 "B<fgets>() reads in at most one less than I<size> characters from I<stream> "
1158 "and stores them into the buffer pointed to by I<s>. Reading stops after an "
1159 "B<EOF> or a newline. If a newline is read, it is stored into the buffer. A "
1160 "terminating null byte (\\(aq\\e0\\(aq) is stored after the last character "
1163 "B<fgets>() は I<stream> から最大で I<size> - 1 個の文字を読み込み、 I<s> が"
1164 "指すバッファに格納する。読み込みは B<EOF> または改行文字を読み込んだ後で停止"
1165 "する。 読み込まれた改行文字はバッファに格納される。 終端のヌルバイト (\\(aq"
1166 "\\e0\\(aq) が一つバッファの中の最後の文字の後に書き込まれる。"
1169 #: build/C/man3/fgetc.3:91
1171 "B<ungetc>() pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
1172 "it is available for subsequent read operations. Pushed-back characters will "
1173 "be returned in reverse order; only one pushback is guaranteed."
1175 "B<ungetc>() は、後の read 操作で読めるように、 I<c> を I<unsigned char> に"
1176 "キャストして I<stream> に書き戻す。 書き戻された文字は逆順に戻される; 書き戻"
1177 "しとして保証されているのは、一文字だけである。"
1180 #: build/C/man3/fgetc.3:96
1182 "Calls to the functions described here can be mixed with each other and with "
1183 "calls to other input functions from the I<stdio> library for the same input "
1186 "ここで述べた関数や I<stdio> ライブラリの入力関数を同じ入力ストリームに対して"
1190 #: build/C/man3/fgetc.3:111
1192 "B<fgetc>(), B<getc>() and B<getchar>() return the character read as an "
1193 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
1195 "B<fgetc>(), B<getc>(), B<getchar>() は、文字を I<unsigned char> として読ん"
1196 "で I<int> にキャストして返す。ファイルの終わりやエラーの場合は B<EOF> を返"
1200 #: build/C/man3/fgetc.3:117
1202 "B<fgets>() returns I<s> on success, and NULL on error or when end of file "
1203 "occurs while no characters have been read."
1205 "B<fgets>() は、成功すると I<s> を返し、エラーや 1 文字も読み込んでいないのに"
1206 "ファイルの終わりになった 場合に NULL を返す。"
1209 #: build/C/man3/fgetc.3:124
1210 msgid "B<ungetc>() returns I<c> on success, or B<EOF> on error."
1211 msgstr "B<ungetc>() は成功すると I<c> を返し、エラーの場合は B<EOF> を返す。"
1214 #: build/C/man3/fgetc.3:126 build/C/man3/gets.3:60
1215 msgid "C89, C99, POSIX.1-2001."
1216 msgstr "C89, C99, POSIX.1-2001."
1219 #: build/C/man3/fgetc.3:133
1221 "It is not advisable to mix calls to input functions from the I<stdio> "
1222 "library with low-level calls to B<read>(2) for the file descriptor "
1223 "associated with the input stream; the results will be undefined and very "
1224 "probably not what you want."
1226 "入力ストリームのファイルディスクリプタに対して、 I<stdio> ライブラリの入力関"
1227 "数と、低レベル呼び出しの B<read>(2) を混ぜて呼び出す事は勧められない。 結果"
1228 "がどうなるかは分からず、おそらくあなたの 望んでいる結果にはならないだろう。"
1231 #: build/C/man3/fgetc.3:150
1233 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
1234 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<gets>(3), "
1235 "B<getwchar>(3), B<puts>(3), B<scanf>(3), B<ungetwc>(3), "
1236 "B<unlocked_stdio>(3), B<feature_test_macros>(7)"
1238 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
1239 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<gets>(3), "
1240 "B<getwchar>(3), B<puts>(3), B<scanf>(3), B<ungetwc>(3), "
1241 "B<unlocked_stdio>(3), B<feature_test_macros>(7)"
1244 #: build/C/man3/fgetwc.3:18
1250 #: build/C/man3/fgetwc.3:18 build/C/man3/fputwc.3:16 build/C/man3/popen.3:40
1256 #: build/C/man3/fgetwc.3:21
1257 msgid "fgetwc, getwc - read a wide character from a FILE stream"
1258 msgstr "fgetwc, getwc - ワイド文字を FILE ストリームから読み込む"
1261 #: build/C/man3/fgetwc.3:26 build/C/man3/fmemopen.3:22
1262 #: build/C/man3/fputwc.3:24 build/C/man3/unlocked_stdio.3:54
1264 msgid "B<#include E<lt>wchar.hE<gt>>\n"
1265 msgstr "B<#include E<lt>wchar.hE<gt>>\n"
1268 #: build/C/man3/fgetwc.3:29
1271 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
1272 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
1274 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
1275 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
1278 #: build/C/man3/fgetwc.3:44
1280 "The B<fgetwc>() function is the wide-character equivalent of the "
1281 "B<fgetc>(3) function. It reads a wide character from I<stream> and returns "
1282 "it. If the end of stream is reached, or if I<ferror(stream)> becomes true, "
1283 "it returns B<WEOF>. If a wide-character conversion error occurs, it sets "
1284 "I<errno> to B<EILSEQ> and returns B<WEOF>."
1286 "B<fgetwc>() 関数は、 B<fgetc>(3) に対応するワイド文字関数である。 この関数"
1287 "は I<stream> からワイド文字を 1 文字読み込み、これを返す。 ストリームの終端に"
1288 "達するか、I<ferror(stream)> が真になった場合には、 この関数は B<WEOF> を返"
1289 "す。 ワイド文字変換でエラーが発生した場合は、 I<errno> に B<EILSEQ> をセット"
1293 #: build/C/man3/fgetwc.3:52
1295 "The B<getwc>() function or macro functions identically to B<fgetwc>(). It "
1296 "may be implemented as a macro, and may evaluate its argument more than "
1297 "once. There is no reason ever to use it."
1299 "B<getwc>() 関数あるいはマクロは、 B<fgetwc>() と全く同じ動作をする。 この関"
1300 "数はマクロとして実装されるかもしれないので、引き数が複数回評価さ れるかもしれ"
1301 "ない。この関数を使う理由はもはや存在しない。"
1304 #: build/C/man3/fgetwc.3:64
1306 "The B<fgetwc>() function returns the next wide-character from the stream, "
1307 "or B<WEOF>. In the event of an error, I<errno> is set to indicate the cause."
1309 "B<fgetwc>() 関数はストリームの次のワイド文字か、あるいは B<WEOF> を返す。 エ"
1310 "ラーが起こった場合、 I<errno> にエラーの原因を示す値が設定される。"
1313 #: build/C/man3/fgetwc.3:66 build/C/man3/fputwc.3:65
1314 msgid "Apart from the usual ones, there is"
1315 msgstr "通常のエラーに加えて、以下のエラーがある:"
1318 #: build/C/man3/fgetwc.3:66 build/C/man3/fputwc.3:65 build/C/man3/scanf.3:558
1324 #: build/C/man3/fgetwc.3:70
1326 "The data obtained from the input stream does not form a valid character."
1327 msgstr "入力ストリームから取得したデータが、正しい文字でない。"
1330 #: build/C/man3/fgetwc.3:72 build/C/man3/fputwc.3:70
1331 msgid "C99, POSIX.1-2001."
1332 msgstr "C99, POSIX.1-2001."
1335 #: build/C/man3/fgetwc.3:79
1337 "The behavior of B<fgetwc>() depends on the B<LC_CTYPE> category of the "
1340 "B<fgetwc>() の動作は、現在のロケールの B<LC_CTYPE> カテゴリに依存する。"
1343 #: build/C/man3/fgetwc.3:87
1345 "In the absence of additional information passed to the B<fopen>(3) call, it "
1346 "is reasonable to expect that B<fgetwc>() will actually read a multibyte "
1347 "sequence from the stream and then convert it to a wide character."
1349 "B<fopen>(3) システムコールに渡す追加情報がない場合には、 B<fgetwc>() が実"
1350 "際 にはマルチバイトシーケンスをストリームから読み込み、これをワイド文字に 変"
1354 #: build/C/man3/fgetwc.3:92
1355 msgid "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
1356 msgstr "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
1359 #: build/C/man3/flockfile.3:25
1365 #: build/C/man3/flockfile.3:25
1371 #: build/C/man3/flockfile.3:28
1372 msgid "flockfile, ftrylockfile, funlockfile - lock FILE for stdio"
1373 msgstr "flockfile, ftrylockfile, funlockfile - 標準入出力 FILE のロックを行う"
1376 #: build/C/man3/flockfile.3:33
1378 msgid "B<void flockfile(FILE *>I<filehandle>B<);>\n"
1379 msgstr "B<void flockfile(FILE *>I<filehandle>B<);>\n"
1382 #: build/C/man3/flockfile.3:35
1384 msgid "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
1385 msgstr "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
1388 #: build/C/man3/flockfile.3:37
1390 msgid "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
1391 msgstr "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
1394 #: build/C/man3/flockfile.3:46 build/C/man3/wprintf.3:43
1395 msgid "All functions shown above:"
1399 #: build/C/man3/flockfile.3:49
1401 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
1404 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
1408 #: build/C/man3/flockfile.3:63
1410 "The stdio functions are thread-safe. This is achieved by assigning to each "
1411 "I<FILE> object a lockcount and (if the lockcount is nonzero) an owning "
1412 "thread. For each library call, these functions wait until the I<FILE> "
1413 "object is no longer locked by a different thread, then lock it, do the "
1414 "requested I/O, and unlock the object again."
1416 "標準入出力関数はスレッドセーフである。これは、各 I<FILE> オブジェクトに対し、"
1417 "ロック数 (lockcount) と (ロック数が 0 でない場合は) 所有者スレッド (owner "
1418 "thread) を管理することで実現される。 ライブラリの呼び出しが行われる毎に、標"
1419 "準入出力関数は I<FILE> オブジェクトが他のスレッドによってロックされていない状"
1420 "態になるまで待ち、 I<FILE> オブジェクトをロックし、要求されて入出力を行い、 "
1424 #: build/C/man3/flockfile.3:69
1426 "(Note: this locking has nothing to do with the file locking done by "
1427 "functions like B<flock>(2) and B<lockf>(3).)"
1429 "(注: このロックは、 B<flock>(2) や B<lockf>(3) といった関数が行うロックとは"
1433 #: build/C/man3/flockfile.3:77
1435 "All this is invisible to the C-programmer, but there may be two reasons to "
1436 "wish for more detailed control. On the one hand, maybe a series of I/O "
1437 "actions by one thread belongs together, and should not be interrupted by the "
1438 "I/O of some other thread. On the other hand, maybe the locking overhead "
1439 "should be avoided for greater efficiency."
1441 "これらのことはすべて C プログラマには見えない部分で行われるが、 より細かい制"
1442 "御ができた方がよい理由が2つあるだろう。一つは、一つのスレッドが 行う一連の入"
1443 "出力動作は一緒に行われ、他のスレッドの入出力によって中断されない 方がよいとい"
1444 "うことであろう。もう一つは、効率を大きく上げるためには ロックのオーバヘッドを"
1445 "避ける必要があるということであろう。"
1448 #: build/C/man3/flockfile.3:94
1450 "To this end, a thread can explicitly lock the I<FILE> object, then do its "
1451 "series of I/O actions, then unlock. This prevents other threads from coming "
1452 "in between. If the reason for doing this was to achieve greater efficiency, "
1453 "one does the I/O with the nonlocking versions of the stdio functions: with "
1454 "B<getc_unlocked>(3) and B<putc_unlocked>(3) instead of B<getc>(3) and "
1457 "この目的を実現するために、 I<FILE> オブジェクトのロック、一連の入出力動作の実"
1458 "行、 ロックの解除をスレッドが明示的に指示することができる。 これにより、他の"
1459 "スレッドが途中で入出力を行うのを防止する。 このようなことを行う理由が効率の向"
1460 "上であるならば、 ロックを行わないバージョンの標準入出力関数を使うこともでき"
1461 "る。 例えば、 B<getc>(3) や B<putc>(3) の代わりに B<getc_unlocked>(3) や "
1462 "B<putc_unlocked>(3) を使用する。"
1465 #: build/C/man3/flockfile.3:105
1467 "The B<flockfile>() function waits for I<*filehandle> to be no longer locked "
1468 "by a different thread, then makes the current thread owner of "
1469 "I<*filehandle>, and increments the lockcount."
1471 "B<flockfile>() 関数は、I<*filehandle> が他のスレッドにロックされていな い状"
1472 "態になるまで待ったのち、現在のスレッドを I<*filehandle> のオーナに設 定し、"
1476 #: build/C/man3/flockfile.3:109
1477 msgid "The B<funlockfile>() function decrements the lock count."
1478 msgstr "B<funlockfile>() 関数は、ロック数を減算する。"
1481 #: build/C/man3/flockfile.3:120
1483 "The B<ftrylockfile>() function is a nonblocking version of B<flockfile>(). "
1484 "It does nothing in case some other thread owns I<*filehandle>, and it "
1485 "obtains ownership and increments the lockcount otherwise."
1487 "B<ftrylockfile>() 関数は B<flockfile>() のブロッキングを行わない バージョン"
1488 "である。他のスレッドが I<*filehandle> をロックしている時は 何も行わず、そうで"
1489 "ない場合は I<*filehandle> の所有権を獲得し、 ロック数を加算する。"
1492 #: build/C/man3/flockfile.3:125
1494 "The B<ftrylockfile>() function returns zero for success (the lock was "
1495 "obtained), and nonzero for failure."
1497 "B<ftrylockfile>() 関数はロックに成功すると 0 を返し、 失敗した場合は 0 以外"
1501 #: build/C/man3/flockfile.3:127
1506 #: build/C/man3/flockfile.3:135
1508 "The B<flockfile>(), B<ftrylockfile>(), and B<funlockfile>() functions are "
1511 "関数 B<flockfile>(), B<ftrylockfile>(), B<funlockfile>() はスレッドセーフであ"
1515 #: build/C/man3/flockfile.3:137 build/C/man3/popen.3:174
1516 msgid "POSIX.1-2001."
1517 msgstr "POSIX.1-2001."
1520 #: build/C/man3/flockfile.3:137
1522 msgid "AVAILABILITY"
1526 #: build/C/man3/flockfile.3:143
1528 "These functions are available when B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
1529 "defined. They are in libc since libc 5.1.1 and in glibc since glibc 2.0."
1531 "B<_POSIX_THREAD_SAFE_FUNCTIONS> が定義されているときにこれらの関数を使用する"
1532 "ことができる。 5.1.1 以降の libc と 2.0 以降の glibc に存在する。"
1535 #: build/C/man3/flockfile.3:145
1536 msgid "B<unlocked_stdio>(3)"
1537 msgstr "B<unlocked_stdio>(3)"
1540 #: build/C/man3/fmemopen.3:10
1546 #: build/C/man3/fmemopen.3:10 build/C/man3/getline.3:26
1547 #: build/C/man7/symlink.7:37
1553 #: build/C/man3/fmemopen.3:13
1554 msgid "fmemopen, open_memstream, open_wmemstream - open memory as stream"
1556 "fmemopen, open_memstream, open_wmemstream - メモリをストリームとしてオープン"
1560 #: build/C/man3/fmemopen.3:18
1562 msgid "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char *>I<mode>B<);>\n"
1563 msgstr "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char *>I<mode>B<);>\n"
1566 #: build/C/man3/fmemopen.3:20
1568 msgid "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
1569 msgstr "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
1572 #: build/C/man3/fmemopen.3:24
1574 msgid "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
1575 msgstr "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
1578 #: build/C/man3/fmemopen.3:34
1579 msgid "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
1580 msgstr "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
1583 #: build/C/man3/fmemopen.3:57
1585 "The B<fmemopen>() function opens a stream that permits the access specified "
1586 "by I<mode>. The stream allows I/O to be performed on the string or memory "
1587 "buffer pointed to by I<buf>. This buffer must be at least I<size> bytes "
1590 "B<fmemopen>() 関数は、ストリームをオープンし、そのストリームに I<mode> で指"
1591 "定されたアクセス許可を設定する。 そのストリームを通じて、 I<buf> で指定された"
1592 "文字列やメモリバッファへの読み書きができる。 このバッファは少なくとも "
1593 "I<size> バイトの長さでなければならない。"
1596 #: build/C/man3/fmemopen.3:77
1598 "The argument I<mode> is the same as for B<fopen>(3). If I<mode> specifies "
1599 "an append mode, then the initial file position is set to the location of the "
1600 "first null byte (\\(aq\\e0\\(aq) in the buffer; otherwise the initial file "
1601 "position is set to the start of the buffer. Since glibc 2.9, the letter "
1602 "\\(aqb\\(aq may be specified as the second character in I<mode>. This "
1603 "provides \"binary\" mode: writes don't implicitly add a terminating null "
1604 "byte, and B<fseek>(3) B<SEEK_END> is relative to the end of the buffer (i."
1605 "e., the value specified by the I<size> argument), rather than the current "
1608 "引き数 I<mode> は B<fopen>(3) の場合と同じである。 I<mode> で追記モード\n"
1609 "(append mode) が指定された場合、ファイル位置の初期値は バッファ中の\n"
1610 "最初のヌルバイト (\\(aq\\e0\\(aq) の位置に設定される。\n"
1611 "それ以外の場合は、ファイル位置の初期値はバッファの先頭になる。 \n"
1612 "glibc 2.9 以降では、文字 \\(aqb\\(aq を I<mode> の二番目の文字として指定\n"
1613 "することができる。 この文字は「バイナリ」モードを指定するものである。\n"
1614 "このモードでは、書き込み時に文字列終端のヌルバイトが黙って追加 される\n"
1615 "ことはない。また、 B<fseek>(3) B<SEEK_END> は、文字列の長さからの相対値\n"
1616 "ではなく、バッファの末尾 (I<size> で指定した値) からの相対値となる。"
1619 #: build/C/man3/fmemopen.3:89
1621 "When a stream that has been opened for writing is flushed (B<fflush>(3)) or "
1622 "closed (B<fclose>(3)), a null byte is written at the end of the buffer if "
1623 "there is space. The caller should ensure that an extra byte is available in "
1624 "the buffer (and that I<size> counts that byte) to allow for this."
1626 "書き込み用にオープンされたストリームをフラッシュ (B<fflush>(3)) やクローズ "
1627 "(B<fclose>(3)) した時に、 (バッファに空きがあれば) ヌルバイトがバッファの末"
1628 "尾に書き込まれる。 このようにするためには、呼び出し元は バッファに 1バイト余"
1629 "裕を作る (I<size> にこの 1バイトを含めた値を指定する) 必要がある。"
1631 #. See http://sourceware.org/bugzilla/show_bug.cgi?id=1995
1633 #. http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html
1635 #: build/C/man3/fmemopen.3:107
1637 "Attempts to write more than I<size> bytes to the buffer result in an error. "
1638 "(By default, such errors will be visible only when the I<stdio> buffer is "
1639 "flushed. Disabling buffering with I<setbuf(fp,\\ NULL)> may be useful to "
1640 "detect errors at the time of an output operation. Alternatively, the caller "
1641 "can explicitly set I<buf> as the stdio stream buffer, at the same time "
1642 "informing stdio of the buffer's size, using I<setbuffer(fp, buf, size)>.)"
1644 "バッファに I<size> バイトよりたくさん書き込もうとした場合には、エラーとな"
1645 "る。 (デフォルトでは、このようなエラーが見えるのは I<stdio> バッファがフラッ"
1646 "シュされた時だけである。 I<setbuf(fp,\\ NULL)> を使ってバッファリングを無効に"
1647 "する方法は、 出力操作を行った時点でエラーを検出するのに役立つ。 別の方法とし"
1648 "ては、 I<setbuffer(fp, buf, size)> を使って、呼び出し側が明示的に stdio スト"
1649 "リームバッファとして I<buf> を指定し、バッファの指定時にバッファのサイズを "
1653 #: build/C/man3/fmemopen.3:115
1655 "In a stream opened for reading, null bytes (\\(aq\\e0\\(aq) in the buffer do "
1656 "not cause read operations to return an end-of-file indication. A read from "
1657 "the buffer will only indicate end-of-file when the file pointer advances "
1658 "I<size> bytes past the start of the buffer."
1660 "読み出し用にオープンされたストリームでは、 バッファ内にヌルバイト (\\(aq"
1661 "\\e0\\(aq) があっても 読み出し操作がファイル末尾 (end-of-file) を返すことはな"
1662 "い。 バッファからの読み出しでファイル末尾が返るのは、 ファイルポインタがバッ"
1663 "ファの先頭から I<size> バイトを越えて先に進もうとした場合だけである。"
1666 #: build/C/man3/fmemopen.3:130
1668 "If I<buf> is specified as NULL, then B<fmemopen>() dynamically allocates a "
1669 "buffer I<size> bytes long. This is useful for an application that wants to "
1670 "write data to a temporary buffer and then read it back again. The buffer is "
1671 "automatically freed when the stream is closed. Note that the caller has no "
1672 "way to obtain a pointer to the temporary buffer allocated by this call (but "
1673 "see B<open_memstream>() below)."
1675 "I<buf> に NULL が指定された場合、 B<fmemopen>() は動的に I<size> バイトの長"
1676 "さのバッファを確保する。 この方法は、一時バッファにデータの書き込みを行ってか"
1677 "ら、 その内容を再度読み出すようなアプリケーションで有用である。 このバッファ"
1678 "はストリームがクローズされるときに自動的に解放される。 呼び出し元からはこの関"
1679 "数が割り当てた一時バッファへのポインタ値を 知る方法は存在しない点に注意 (下記"
1680 "の B<open_memstream>() も参照)。"
1683 #: build/C/man3/fmemopen.3:141
1685 "The B<open_memstream>() function opens a stream for writing to a buffer. "
1686 "The buffer is dynamically allocated (as with B<malloc>(3)), and "
1687 "automatically grows as required. After closing the stream, the caller "
1688 "should B<free>(3) this buffer."
1690 "B<open_memstream>() 関数は、バッファへの書き込み用にストリームをオープンす"
1691 "る。 バッファは (B<malloc>(3) を使って) 動的に割り当てられ、必要に応じて自動"
1692 "的に伸長する。 ストリームをクローズした後で、呼び出し元はこのバッファを "
1693 "B<free>(3) すべきである。"
1696 #: build/C/man3/fmemopen.3:156
1698 "When the stream is closed (B<fclose>(3)) or flushed (B<fflush>(3)), the "
1699 "locations pointed to by I<ptr> and I<sizeloc> are updated to contain, "
1700 "respectively, a pointer to the buffer and the current size of the buffer. "
1701 "These values remain valid only as long as the caller performs no further "
1702 "output on the stream. If further output is performed, then the stream must "
1703 "again be flushed before trying to access these variables."
1705 "このストリームが クローズ (B<fclose>(3)) されたりフラッシュ (B<fflush>(3)) "
1706 "された時に、 I<ptr> と I<sizeloc> の値はそれぞれバッファへのポインタとそのサ"
1707 "イズに更新される。 これらの値は、呼び出し元がそのストリームに新たな書き込み"
1708 "を 行わない場合に限り有効である。 ストリームに書き込みを行った際には、これら"
1709 "の変数を参照する前に ストリームを再度フラッシュしなければならない。"
1712 #: build/C/man3/fmemopen.3:162
1714 "A null byte is maintained at the end of the buffer. This byte is I<not> "
1715 "included in the size value stored at I<sizeloc>."
1717 "バッファ末尾のヌルバイトは保持される。 このヌルバイトは I<sizeloc> に格納され"
1721 #: build/C/man3/fmemopen.3:170
1723 "The stream's file position can be changed with B<fseek>(3) or "
1724 "B<fseeko>(3). Moving the file position past the end of the data already "
1725 "written fills the intervening space with zeros."
1727 "ストリームのファイル位置は B<fseek>(3) や B<fseeko>(3) で変更できる。 すで"
1728 "にデータが書き込まれた領域の末尾より先にファイル位置を動かすと、 その間の領域"
1732 #: build/C/man3/fmemopen.3:176
1734 "The B<open_wmemstream>() is similar to B<open_memstream>(), but operates on "
1735 "wide characters instead of bytes."
1737 "B<open_wmemstream>() は B<open_memstream>() と同様だが、バイトではなくワイ"
1738 "ド文字に対して操作を行う点が異なる。"
1741 #: build/C/man3/fmemopen.3:188
1743 "Upon successful completion B<fmemopen>(), B<open_memstream>() and "
1744 "B<open_wmemstream>() return a I<FILE> pointer. Otherwise, NULL is returned "
1745 "and I<errno> is set to indicate the error."
1747 "成功して終了した場合には、 B<fmemopen>(), B<open_memstream>(), "
1748 "B<open_wmemstream>() は I<FILE> ポインタを返す。 失敗した場合は、 NULL を返"
1749 "し、 I<errno> にエラーを示す値をセットする。"
1752 #: build/C/man3/fmemopen.3:188 build/C/man3/fmtmsg.3:222
1753 #: build/C/man3/getline.3:137 build/C/man2/link.2:334 build/C/man2/open.2:1015
1754 #: build/C/man2/open_by_handle_at.2:349 build/C/man2/pipe.2:150
1755 #: build/C/man2/readlink.2:212 build/C/man2/readv.2:209
1756 #: build/C/man2/rename.2:397 build/C/man2/symlink.2:224
1757 #: build/C/man2/unlink.2:269
1763 #: build/C/man3/fmemopen.3:195
1765 "B<fmemopen>() and B<open_memstream>() were already available in glibc 1.0."
1766 "x. B<open_wmemstream>() is available since glibc 2.4."
1768 "B<fmemopen>() と B<open_memstream>() は glibc 1.0.x ですでに利用可能であっ"
1769 "た。 B<open_wmemstream>() は glibc 2.4 以降で利用可能である。"
1772 #: build/C/man3/fmemopen.3:199
1774 "POSIX.1-2008. These functions are not specified in POSIX.1-2001, and are "
1775 "not widely available on other systems."
1777 "POSIX.1-2008. これらの関数は POSIX.1-2001 では規定れていないが、 Linux 以外"
1780 #. http://austingroupbugs.net/view.php?id=396
1782 #: build/C/man3/fmemopen.3:207
1784 "POSIX.1-2008 specifies that \\(aqb\\(aq in I<mode> shall be ignored. "
1785 "However, Technical Corrigendum 1 adjusts the standard to allow "
1786 "implementation-specific treatment for this case, thus permitting the glibc "
1787 "treatment of \\(aqb\\(aq."
1789 "POSIX.1-2008 では I<mode> の \\(aqb\\(aq は無視されるべきだと規定されて\n"
1790 "いる。一方、Technical Corrigendum (正誤表) 1 では、I<mode> の\n"
1791 "\\(aqb\\(aq が指定された場合の扱いは実装依存であることを許容するように\n"
1792 "標準規格が修正されており、glibc の \\(aqb\\(aq の扱いは許されている。"
1795 #: build/C/man3/fmemopen.3:213
1797 "There is no file descriptor associated with the file stream returned by "
1798 "these functions (i.e., B<fileno>(3) will return an error if called on the "
1801 "これらの関数が返すファイルストリームに対応するファイル ディスクリプタはない "
1802 "(つまり、返されたストリームに対して B<fileno>(3) を呼び出すとエラーが返るこ"
1805 #. http://sourceware.org/bugzilla/show_bug.cgi?id=1996
1807 #: build/C/man3/fmemopen.3:220
1809 "In glibc before version 2.7, seeking past the end of a stream created by "
1810 "B<open_memstream>() does not enlarge the buffer; instead the B<fseek>(3) "
1811 "call fails, returning -1."
1813 "バージョン 2.7 より前の glibc では、 B<open_memstream>() で作成されたスト"
1814 "リームの末尾より先にファイル位置を動かしても、 バッファが伸長されず、 "
1815 "B<fseek>(3) が失敗し -1 が返る。"
1817 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=11216
1819 #: build/C/man3/fmemopen.3:231
1821 "If I<size> is specified as zero, B<fmemopen>() fails with the error "
1822 "B<EINVAL>. It would be more consistent if this case successfully created a "
1823 "stream that then returned end of file on the first attempt at reading. "
1824 "Furthermore, POSIX.1-2008 does not specify a failure for this case."
1826 "I<size> に 0 が指定された場合、 B<fmemopen>() はエラー B<EINVAL> で失敗\n"
1827 "する。この場合にはストリームの作成に成功して、最初の読み出しを行った際に\n"
1828 "EOF (end of file) が返される方が、ストリームの扱いの一貫性が増すだろう。\n"
1829 "また、 POSIX.1-2008 ではこの場合のエラーは規定されていない。"
1831 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13152
1833 #: build/C/man3/fmemopen.3:239
1835 "Specifying append mode (\"a\" or \"a+\") for B<fmemopen>() sets the initial "
1836 "file position to the first null byte, but (if the file offset is reset to a "
1837 "location other than the end of the stream) does not force subsequent writes "
1838 "to append at the end of the stream."
1840 "B<fmemopen>() に追記モード (\"a\" や \"a+\") を指定すると、\n"
1841 "ファイル位置の初期値は最初のヌルバイトに設定されるが、(ファイル\n"
1842 "オフセットをストリームの末尾以外の位置に再設定した場合)それ以降の\n"
1843 "書き込みではストリームの末尾への追記が行われる訳ではない。"
1845 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=13151
1847 #: build/C/man3/fmemopen.3:255
1849 "If the I<mode> argument to B<fmemopen>() specifies append (\"a\" or \"a+"
1850 "\"), and the I<size> argument does not cover a null byte in I<buf>, then, "
1851 "according to POSIX.1-2008, the initial file position should be set to the "
1852 "next byte after the end of the buffer. However, in this case the glibc "
1853 "B<fmemopen>() sets the file position to -1."
1855 "B<fmemopen>() の I<mode> 引き数に追記モード (\"a\" や \"a+\") を指定し、\n"
1856 "I<size> 引き数で指定した範囲の I<buf> 内にヌルバイトがない場合、\n"
1857 "POSIX.1-2008 では、ファイル位置の初期値はバッファの末尾の直後の\n"
1858 "バイトに設定すべきとされている。しかし、glibc の B<fmemopen>() では\n"
1859 "この場合ファイル位置は -1 に設定される。"
1861 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12836
1863 #: build/C/man3/fmemopen.3:268
1865 "To specify binary mode for B<fmemopen>() the \\(aqb\\(aq must be the "
1866 "I<second> character in I<mode>. Thus, for example, \"wb+\" has the desired "
1867 "effect, but \"w+b\" does not. This is inconsistent with the treatment of "
1868 "I<mode> by B<fopen>(3)."
1870 "B<fmemopen>() でバイナリモードを指定するには、\n"
1871 "\\(aqb\\(aq は I<mode> の I<2 文字目> でなければならない。\n"
1872 "例えば、 \"wb+\" は意図通りの効果になるが、 \"w+b\" はそうではない。\n"
1873 "これは B<fopen>(3) の I<mode> の扱いとは異なる。"
1875 #. http://sourceware.org/bugzilla/show_bug.cgi?id=6544
1877 #: build/C/man3/fmemopen.3:276
1879 "The glibc 2.9 addition of \"binary\" mode for B<fmemopen>() silently "
1880 "changed the ABI: previously, B<fmemopen>() ignored \\(aqb\\(aq in I<mode>."
1882 "glibc 2.9 での B<fmemopen>() の「バイナリ」モードの追加は、\n"
1883 "ABI (Application Binary Interface) が黙って変更された。\n"
1884 "それ以前の B<fmemopen>() では I<mode> 内の \\(aqb\\(aq は無視されていた。"
1887 #: build/C/man3/fmemopen.3:276 build/C/man3/fmtmsg.3:256
1888 #: build/C/man3/fopencookie.3:247 build/C/man3/getline.3:146
1889 #: build/C/man2/open_by_handle_at.2:439 build/C/man2/pipe.2:161
1890 #: build/C/man3/printf.3:974 build/C/man2/readlink.2:256
1891 #: build/C/man2/readv.2:265 build/C/man3/scanf.3:704
1897 #: build/C/man3/fmemopen.3:286
1899 "The program below uses B<fmemopen>() to open an input buffer, and "
1900 "B<open_memstream>() to open a dynamically sized output buffer. The program "
1901 "scans its input string (taken from the program's first command-line "
1902 "argument) reading integers, and writes the squares of these integers to the "
1903 "output buffer. An example of the output produced by this program is the "
1906 "このプログラムは B<fmemopen>() を使って出力バッファをオープンし、 "
1907 "B<open_memstream>() を使って動的にサイズが変化する出力バッファをオープンして"
1908 "いる。 (プログラムの第一コマンドライン引き数から取った) 入力文字列を スキャン"
1909 "して整数を読み込み、これらの整数の二乗を出力バッファに書き出す。 このプログラ"
1913 #: build/C/man3/fmemopen.3:291
1916 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1917 "size=11; ptr=1 529 1849\n"
1919 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1920 "size=11; ptr=1 529 1849\n"
1923 #: build/C/man3/fmemopen.3:293 build/C/man3/fopencookie.3:271
1924 #: build/C/man2/pipe.2:177
1926 msgid "Program source"
1930 #: build/C/man3/fmemopen.3:300
1933 "#define _GNU_SOURCE\n"
1934 "#include E<lt>string.hE<gt>\n"
1935 "#include E<lt>stdio.hE<gt>\n"
1936 "#include E<lt>stdlib.hE<gt>\n"
1938 "#define _GNU_SOURCE\n"
1939 "#include E<lt>string.hE<gt>\n"
1940 "#include E<lt>stdio.hE<gt>\n"
1941 "#include E<lt>stdlib.hE<gt>\n"
1944 #: build/C/man3/fmemopen.3:303
1947 "#define handle_error(msg) \\e\n"
1948 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1950 "#define handle_error(msg) \\e\n"
1951 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1954 #: build/C/man3/fmemopen.3:311
1958 "main(int argc, char *argv[])\n"
1960 " FILE *out, *in;\n"
1966 "main(int argc, char *argv[])\n"
1968 " FILE *out, *in;\n"
1974 #: build/C/man3/fmemopen.3:316
1977 " if (argc != 2) {\n"
1978 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1979 " exit(EXIT_FAILURE);\n"
1982 " if (argc != 2) {\n"
1983 " fprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1984 " exit(EXIT_FAILURE);\n"
1988 #: build/C/man3/fmemopen.3:320
1991 " in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1992 " if (in == NULL)\n"
1993 " handle_error(\"fmemopen\");\n"
1995 " in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1996 " if (in == NULL)\n"
1997 " handle_error(\"fmemopen\");\n"
2000 #: build/C/man3/fmemopen.3:324
2003 " out = open_memstream(&ptr, &size);\n"
2004 " if (out == NULL)\n"
2005 " handle_error(\"open_memstream\");\n"
2007 " out = open_memstream(&ptr, &size);\n"
2008 " if (out == NULL)\n"
2009 " handle_error(\"open_memstream\");\n"
2012 #: build/C/man3/fmemopen.3:329
2016 " s = fscanf(in, \"%d\", &v);\n"
2017 " if (s E<lt>= 0)\n"
2021 " s = fscanf(in, \"%d\", &v);\n"
2022 " if (s E<lt>= 0)\n"
2026 #: build/C/man3/fmemopen.3:340
2029 " s = fprintf(out, \"%d \", v * v);\n"
2031 " handle_error(\"fprintf\");\n"
2035 " printf(\"size=%zu; ptr=%s\\en\", size, ptr);\n"
2037 " exit(EXIT_SUCCESS);\n"
2040 " s = fprintf(out, \"%d \", v * v);\n"
2042 " handle_error(\"fprintf\");\n"
2046 " printf(\"size=%zu; ptr=%s\\en\", size, ptr);\n"
2048 " exit(EXIT_SUCCESS);\n"
2052 #: build/C/man3/fmemopen.3:344
2053 msgid "B<fopen>(3), B<fopencookie>(3)"
2054 msgstr "B<fopen>(3), B<fopencookie>(3)"
2057 #: build/C/man3/fmtmsg.3:13
2063 #: build/C/man3/fmtmsg.3:16
2064 msgid "fmtmsg - print formatted error messages"
2065 msgstr "fmtmsg - 整形されたエラーメッセージを表示する"
2068 #: build/C/man3/fmtmsg.3:19
2070 msgid "B<#include E<lt>fmtmsg.hE<gt>>\n"
2071 msgstr "B<#include E<lt>fmtmsg.hE<gt>>\n"
2074 #: build/C/man3/fmtmsg.3:21
2076 msgid "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
2077 msgstr "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
2080 #: build/C/man3/fmtmsg.3:23
2082 msgid "B< int >I<severity>B<, const char *>I<text>B<,>\n"
2083 msgstr "B< int >I<severity>B<, const char *>I<text>B<,>\n"
2086 #: build/C/man3/fmtmsg.3:25
2088 msgid "B< const char *>I<action>B<, const char *>I<tag>B<);>\n"
2089 msgstr "B< const char *>I<action>B<, const char *>I<tag>B<);>\n"
2092 #: build/C/man3/fmtmsg.3:36
2094 "This function displays a message described by its arguments on the "
2095 "device(s) specified in the I<classification> argument. For messages "
2096 "written to I<stderr>, the format depends on the B<MSGVERB> environment "
2099 "この関数は、引き数で記述されたメッセージを、 I<classification> 引き数で指定さ"
2100 "れたデバイス上に表示する。 I<stderr> に書き出されるメッセージのフォーマット"
2101 "は、 B<MSGVERB> 環境変数に依存する。"
2104 #: build/C/man3/fmtmsg.3:43
2106 "The I<label> argument identifies the source of the message. The string must "
2107 "consist of two colon separated parts where the first part has not more than "
2108 "10 and the second part not more than 14 characters."
2110 "I<label> 引き数はメッセージの発生源を識別する。 この文字列はコロンで区切られ"
2111 "た 2 つの部分から構成されていなければならない。 1 つ目の部分は 10 文字以内で"
2112 "なければならず、 2 つ目の部分は 14 文字以内でなければならない。"
2115 #: build/C/man3/fmtmsg.3:47
2116 msgid "The I<text> argument describes the condition of the error."
2117 msgstr "I<text> 引き数にはエラー条件を記述する。"
2120 #: build/C/man3/fmtmsg.3:52
2122 "The I<action> argument describes possible steps to recover from the error. "
2123 "If it is printed, it is prefixed by \"TO FIX: \"."
2125 "I<action> 引き数にはエラーから回復するために利用可能なステップを記述する。 こ"
2126 "れが表示される場合、\"TO FIX: \" が前に付く。"
2129 #: build/C/man3/fmtmsg.3:60
2131 "The I<tag> argument is a reference to the online documentation where more "
2132 "information can be found. It should contain the I<label> value and a unique "
2133 "identification number."
2135 "I<tag> 引き数はより多くの情報を見つけるためのオンラインドキュメントへの参照で"
2136 "ある。 これは I<label> 値とユニークな識別番号を含んでいるべきである。"
2139 #: build/C/man3/fmtmsg.3:60
2141 msgid "Dummy arguments"
2145 #: build/C/man3/fmtmsg.3:79
2147 "Each of the arguments can have a dummy value. The dummy classification "
2148 "value B<MM_NULLMC> (0L) does not specify any output, so nothing is printed. "
2149 "The dummy severity value B<NO_SEV> (0) says that no severity is supplied. "
2150 "The values B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> are "
2151 "synonyms for I<((char\\ *)\\ 0)>, the empty string, and B<MM_NULLSEV> is a "
2152 "synonym for B<NO_SEV>."
2154 "各引き数にはダミーの値を入れることができる。 ダミーの I<classification> 値 "
2155 "B<MM_NULLMC> (0L) は出力を何も指定しない。そのため何も表示されない。 ダミー"
2156 "の I<severity> 値 B<NO_SEV> (0) は重大度 (severity) が与えられていないことを"
2157 "表す。 値 B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> は "
2158 "I<((char\\ *)\\ 0)> と空文字列の別名であり、 B<MM_NULLSEV> は B<NO_SEV> の別"
2162 #: build/C/man3/fmtmsg.3:79
2164 msgid "The classification argument"
2165 msgstr "classification 引き数"
2168 #: build/C/man3/fmtmsg.3:83
2170 "The I<classification> argument is the sum of values describing 4 types of "
2172 msgstr "I<classification> 引き数は 4 種類の情報を記述する値の和である。"
2175 #: build/C/man3/fmtmsg.3:86
2176 msgid "The first value defines the output channel."
2177 msgstr "最初の値は出力チャンネルを定義する。"
2180 #: build/C/man3/fmtmsg.3:86
2183 msgstr "B<MM_PRINT>"
2186 #: build/C/man3/fmtmsg.3:90
2187 msgid "Output to I<stderr>."
2188 msgstr "I<stderr> に出力する。"
2191 #: build/C/man3/fmtmsg.3:90
2193 msgid "B<MM_CONSOLE>"
2194 msgstr "B<MM_CONSOLE>"
2197 #: build/C/man3/fmtmsg.3:93
2198 msgid "Output to the system console."
2199 msgstr "システムコンソールに出力する。"
2202 #: build/C/man3/fmtmsg.3:93
2204 msgid "B<MM_PRINT | MM_CONSOLE>"
2205 msgstr "B<MM_PRINT | MM_CONSOLE>"
2208 #: build/C/man3/fmtmsg.3:96
2209 msgid "Output to both."
2213 #: build/C/man3/fmtmsg.3:98
2214 msgid "The second value is the source of the error:"
2215 msgstr "2 番目の値はエラーの発生源である:"
2218 #: build/C/man3/fmtmsg.3:98
2224 #: build/C/man3/fmtmsg.3:101
2225 msgid "A hardware error occurred."
2226 msgstr "ハードウェアエラーが起こった。"
2229 #: build/C/man3/fmtmsg.3:101
2235 #: build/C/man3/fmtmsg.3:104
2236 msgid "A firmware error occurred."
2237 msgstr "ファームウェアエラーが起こった。"
2240 #: build/C/man3/fmtmsg.3:104
2246 #: build/C/man3/fmtmsg.3:107
2247 msgid "A software error occurred."
2248 msgstr "ソフトウェアエラーが起こった。"
2251 #: build/C/man3/fmtmsg.3:109
2252 msgid "The third value encodes the detector of the problem:"
2253 msgstr "3 番目の値は問題の検知を行ったものをエンコードする:"
2256 #: build/C/man3/fmtmsg.3:109
2262 #: build/C/man3/fmtmsg.3:112
2263 msgid "It is detected by an application."
2264 msgstr "アプリケーションによって検知された。"
2267 #: build/C/man3/fmtmsg.3:112
2273 #: build/C/man3/fmtmsg.3:115
2274 msgid "It is detected by a utility."
2275 msgstr "ユーティリティによって検知された。"
2278 #: build/C/man3/fmtmsg.3:115
2281 msgstr "B<MM_OPSYS>"
2284 #: build/C/man3/fmtmsg.3:118
2285 msgid "It is detected by the operating system."
2286 msgstr "オペレーティングシステムによって検知された。"
2289 #: build/C/man3/fmtmsg.3:120
2290 msgid "The fourth value shows the severity of the incident:"
2291 msgstr "4 番目の値は問題の重大度を表す:"
2294 #: build/C/man3/fmtmsg.3:120
2296 msgid "B<MM_RECOVER>"
2297 msgstr "B<MM_RECOVER>"
2300 #: build/C/man3/fmtmsg.3:123
2301 msgid "It is a recoverable error."
2302 msgstr "回復可能なエラーである。"
2305 #: build/C/man3/fmtmsg.3:123
2307 msgid "B<MM_NRECOV>"
2308 msgstr "B<MM_NRECOV>"
2311 #: build/C/man3/fmtmsg.3:126
2312 msgid "It is a nonrecoverable error."
2313 msgstr "回復不可能なエラーである。"
2316 #: build/C/man3/fmtmsg.3:126
2318 msgid "The severity argument"
2319 msgstr "severity 引き数"
2322 #: build/C/man3/fmtmsg.3:130
2323 msgid "The I<severity> argument can take one of the following values:"
2324 msgstr "I<severity> 引き数は以下の 1 つの値をとることができる。"
2327 #: build/C/man3/fmtmsg.3:130
2330 msgstr "B<MM_NOSEV>"
2333 #: build/C/man3/fmtmsg.3:133
2334 msgid "No severity is printed."
2335 msgstr "重大度は表示されない。"
2338 #: build/C/man3/fmtmsg.3:133
2344 #: build/C/man3/fmtmsg.3:136
2345 msgid "This value is printed as HALT."
2346 msgstr "この値は HALT として表示される。"
2349 #: build/C/man3/fmtmsg.3:136
2352 msgstr "B<MM_ERROR>"
2355 #: build/C/man3/fmtmsg.3:139
2356 msgid "This value is printed as ERROR."
2357 msgstr "この値は ERROR として表示される。"
2360 #: build/C/man3/fmtmsg.3:139
2362 msgid "B<MM_WARNING>"
2363 msgstr "B<MM_WARNING>"
2366 #: build/C/man3/fmtmsg.3:142
2367 msgid "This value is printed as WARNING."
2368 msgstr "この値は WARNING として表示される。"
2371 #: build/C/man3/fmtmsg.3:142
2377 #: build/C/man3/fmtmsg.3:145
2378 msgid "This value is printed as INFO."
2379 msgstr "この値は INFO として表示される。"
2382 #: build/C/man3/fmtmsg.3:152
2384 "The numeric values are between 0 and 4. Using B<addseverity>(3) or the "
2385 "environment variable B<SEV_LEVEL> you can add more levels and strings to "
2388 "数値の場合は 0 から 4 である。 B<addseverity>(3) または環境変数 "
2389 "B<SEV_LEVEL> を使うことにより、表示するレベルと文字列を更に追加できる。"
2392 #: build/C/man3/fmtmsg.3:154
2393 msgid "The function can return 4 values:"
2394 msgstr "関数は 4 つの値を返す:"
2397 #: build/C/man3/fmtmsg.3:154
2403 #: build/C/man3/fmtmsg.3:157
2404 msgid "Everything went smooth."
2408 #: build/C/man3/fmtmsg.3:157
2411 msgstr "B<MM_NOTOK>"
2414 #: build/C/man3/fmtmsg.3:160
2415 msgid "Complete failure."
2419 #: build/C/man3/fmtmsg.3:160
2422 msgstr "B<MM_NOMSG>"
2425 #: build/C/man3/fmtmsg.3:164
2426 msgid "Error writing to I<stderr>."
2427 msgstr "I<stderr> に書き込むときにエラーが起こった。"
2430 #: build/C/man3/fmtmsg.3:164
2433 msgstr "B<MM_NOCON>"
2436 #: build/C/man3/fmtmsg.3:167
2437 msgid "Error writing to the console."
2438 msgstr "コンソールに書き込むときにエラーが起こった。"
2441 #: build/C/man3/fmtmsg.3:167
2447 #: build/C/man3/fmtmsg.3:178
2449 "The environment variable B<MSGVERB> (\"message verbosity\") can be used to "
2450 "suppress parts of the output to I<stderr>. (It does not influence output to "
2451 "the console.) When this variable is defined, is non-NULL, and is a colon-"
2452 "separated list of valid keywords, then only the parts of the message "
2453 "corresponding to these keywords is printed. Valid keywords are \"label\", "
2454 "\"severity\", \"text\", \"action\" and \"tag\"."
2456 "環境変数 B<MSGVERB> (\"message verbosity\") は I<stderr> への出力の一部を抑制"
2457 "するのに使うことができる。 (コンソールへの出力には影響しない。) この変数が定"
2458 "義されて、NULL でなく、 コロンで区切られた有効なキーワードのリストである場"
2459 "合、 キーワードに対応するメッセージの一部のみが表示される。 有効なキーワード"
2460 "は \"label\", \"severity\", \"text\", \"action\", \"tag\" である。"
2463 #: build/C/man3/fmtmsg.3:190
2465 "The environment variable B<SEV_LEVEL> can be used to introduce new severity "
2466 "levels. By default, only the five severity levels described above are "
2467 "available. Any other numeric value would make B<fmtmsg>() print nothing. "
2468 "If the user puts B<SEV_LEVEL> with a format like"
2470 "環境変数 B<SEV_LEVEL> は新しい重大度レベルを導入するのに使用できる。 デフォル"
2471 "トでは、上記の 5 つの重大度レベルのみが利用可能である。 他の数値の場合、 "
2472 "B<fmtmsg>() は何も表示しない。 B<fmtmsg>() を初めて呼び出す前に、ユーザが "
2476 #: build/C/man3/fmtmsg.3:193
2477 msgid "SEV_LEVEL=[description[:description[:...]]]"
2478 msgstr "SEV_LEVEL=[description[:description[:...]]]"
2481 #: build/C/man3/fmtmsg.3:198
2483 "in the environment of the process before the first call to B<fmtmsg>(), "
2484 "where each description is of the form"
2486 "のような形式でプロセスの環境に設定すると、 B<fmtmsg>() は (標準のレベル 0-4 "
2487 "に加えて) level に指定された値も受け付け、 そのようなレベルの問題が発生すると"
2488 "指定された printstring を表示する。 各 description は"
2491 #: build/C/man3/fmtmsg.3:201
2492 msgid "severity-keyword,level,printstring"
2493 msgstr "severity-keyword,level,printstring"
2496 #: build/C/man3/fmtmsg.3:208
2498 "then B<fmtmsg>() will also accept the indicated values for the level (in "
2499 "addition to the standard levels 0-4), and use the indicated printstring when "
2500 "such a level occurs."
2504 #: build/C/man3/fmtmsg.3:222
2506 "The severity-keyword part is not used by B<fmtmsg>() but it has to be "
2507 "present. The level part is a string representation of a number. The "
2508 "numeric value must be a number greater than 4. This value must be used in "
2509 "the severity argument of B<fmtmsg>() to select this class. It is not "
2510 "possible to overwrite any of the predefined classes. The printstring is the "
2511 "string printed when a message of this class is processed by B<fmtmsg>()."
2513 "severity-keyword 部は B<fmtmsg>() に使用されないが、存在しなければならな"
2514 "い。 level 部は数値を文字列で表したものである。 数値は 4 より大きい値でなけれ"
2515 "ばならない。 この値は B<fmtmsg>() の severity 引き数で使用されなければなら"
2516 "ず、この重大度を選択する。 前もって宣言された重大度を上書きすることはできな"
2517 "い。 printstring は、 この重大度のメッセージが B<fmtmsg>() によって生成され"
2521 #: build/C/man3/fmtmsg.3:225
2522 msgid "B<fmtmsg>() is provided in glibc since version 2.1."
2523 msgstr "B<fmtmsg>() は、バージョン 2.1 以降の glibc で提供されている。"
2526 #: build/C/man3/fmtmsg.3:231
2528 "Before glibc 2.16, the B<fmtmsg>() function uses a static variable that is "
2529 "not protected, so it is not thread-safe."
2531 "glibc 2.16 より前のバージョンでは、 B<fmtmsg>() 関数は、 保護されていない静的"
2532 "な変数を使うため、 スレッドセーフではない。"
2534 #. Modified in commit 7724defcf8873116fe4efab256596861eef21a94
2536 #: build/C/man3/fmtmsg.3:237
2538 "Since glibc 2.16, the B<fmtmsg>() function uses a lock to protect the "
2539 "static variable, so it is thread-safe."
2541 "glibc 2.16 以降では、 B<fmtmsg>() 関数はロックを使って静的な変数を保護してお"
2545 #: build/C/man3/fmtmsg.3:252
2547 "The functions B<fmtmsg>() and B<addseverity>(3), and environment variables "
2548 "B<MSGVERB> and B<SEV_LEVEL> come from System V. The function B<fmtmsg>() "
2549 "and the environment variable B<MSGVERB> are described in POSIX.1-2001."
2551 "関数 B<fmtmsg>() と B<addseverity>(3) と環境変数 B<MSGVERB> と "
2552 "B<SEV_LEVEL> は System V に由来している。 関数 B<fmtmsg>() と環境変数 "
2553 "B<MSGVERB> は POSIX.1-2001 に記述されている。"
2556 #: build/C/man3/fmtmsg.3:256
2558 "System V and UnixWare man pages tell us that these functions have been "
2559 "replaced by \"pfmt() and addsev()\" or by \"pfmt(), vpfmt(), lfmt(), and "
2560 "vlfmt()\", and will be removed later."
2562 "System V と UnixWare の man ページには、 「これらの関数は \"pfmt() と "
2563 "addsev()\" または \"pfmt(), vpfmt(), lfmt(), vlfmt()\" で置き換えられてお"
2564 "り、 将来は削除される予定である」と書かれている。"
2567 #: build/C/man3/fmtmsg.3:261
2570 "#include E<lt>stdio.hE<gt>\n"
2571 "#include E<lt>stdlib.hE<gt>\n"
2572 "#include E<lt>fmtmsg.hE<gt>\n"
2574 "#include E<lt>stdio.hE<gt>\n"
2575 "#include E<lt>stdlib.hE<gt>\n"
2576 "#include E<lt>fmtmsg.hE<gt>\n"
2579 #: build/C/man3/fmtmsg.3:267
2585 " long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
2591 " long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
2595 #: build/C/man3/fmtmsg.3:288
2598 " err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
2599 " \"unknown mount option\", \"See mount(8).\",\n"
2600 " \"util-linux:mount:017\");\n"
2605 " printf(\"Nothing printed\\en\");\n"
2608 " printf(\"Nothing printed to stderr\\en\");\n"
2611 " printf(\"No console output\\en\");\n"
2614 " printf(\"Unknown error from fmtmsg()\\en\");\n"
2616 " exit(EXIT_SUCCESS);\n"
2619 " err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
2620 " \"unknown mount option\", \"See mount(8).\",\n"
2621 " \"util-linux:mount:017\");\n"
2626 " printf(\"Nothing printed\\en\");\n"
2629 " printf(\"Nothing printed to stderr\\en\");\n"
2632 " printf(\"No console output\\en\");\n"
2635 " printf(\"Unknown error from fmtmsg()\\en\");\n"
2637 " exit(EXIT_SUCCESS);\n"
2641 #: build/C/man3/fmtmsg.3:291
2642 msgid "The output should be:"
2646 #: build/C/man3/fmtmsg.3:295
2649 " util-linux:mount: ERROR: unknown mount option\n"
2650 " TO FIX: See mount(8). util-linux:mount:017\n"
2652 " util-linux:mount: ERROR: unknown mount option\n"
2653 " TO FIX: See mount(8). util-linux:mount:017\n"
2656 #: build/C/man3/fmtmsg.3:298
2661 #: build/C/man3/fmtmsg.3:301
2663 msgid " MSGVERB=text:action; export MSGVERB\n"
2664 msgstr " MSGVERB=text:action; export MSGVERB\n"
2667 #: build/C/man3/fmtmsg.3:304
2668 msgid "the output becomes:"
2669 msgstr "を実行すると、次のようになる。"
2672 #: build/C/man3/fmtmsg.3:308
2675 " unknown mount option\n"
2676 " TO FIX: See mount(8).\n"
2678 " unknown mount option\n"
2679 " TO FIX: See mount(8).\n"
2682 #: build/C/man3/fmtmsg.3:312
2683 msgid "B<addseverity>(3), B<perror>(3)"
2684 msgstr "B<addseverity>(3), B<perror>(3)"
2687 #: build/C/man3/fopen.3:44
2693 #: build/C/man3/fopen.3:44
2699 #: build/C/man3/fopen.3:47
2700 msgid "fopen, fdopen, freopen - stream open functions"
2701 msgstr "fopen, fdopen, freopen - ストリームを開く関数"
2704 #: build/C/man3/fopen.3:52
2706 msgid "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
2707 msgstr "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
2710 #: build/C/man3/fopen.3:54
2712 msgid "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
2713 msgstr "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
2716 #: build/C/man3/fopen.3:56
2718 msgid "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE *>I<stream>B<);>\n"
2719 msgstr "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE *>I<stream>B<);>\n"
2722 #: build/C/man3/fopen.3:65
2724 "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
2726 "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
2729 #: build/C/man3/fopen.3:71
2731 "The B<fopen>() function opens the file whose name is the string pointed to "
2732 "by I<path> and associates a stream with it."
2734 "B<fopen>() 関数は、 I<path> で指定された名前のファイルを開き、ストリームと結"
2738 #: build/C/man3/fopen.3:76
2740 "The argument I<mode> points to a string beginning with one of the following "
2741 "sequences (possibly followed by additional characters, as described below):"
2743 "引数 I<mode> は、以下に続く文字のひとつから始まる文字列へのポインタであ\n"
2744 "る (以下の述べる、追加の文字が後に続くこともある):"
2747 #: build/C/man3/fopen.3:76
2753 #: build/C/man3/fopen.3:80
2755 "Open text file for reading. The stream is positioned at the beginning of "
2758 "テキストファイルを読み出すために開く。 ストリームはファイルの先頭に位置され"
2762 #: build/C/man3/fopen.3:80
2768 #: build/C/man3/fopen.3:84
2770 "Open for reading and writing. The stream is positioned at the beginning of "
2773 "読み出しおよび書き込みするために開く。 ストリームはファイルの先頭に位置され"
2777 #: build/C/man3/fopen.3:84
2783 #: build/C/man3/fopen.3:88
2785 "Truncate file to zero length or create text file for writing. The stream is "
2786 "positioned at the beginning of the file."
2788 "ファイルを書き込みのために開く。 ファイルが既に存在する場合には長さゼロに切り"
2789 "詰める。 ファイルがなかった場合には新たに作成する。 ストリームはファイルの先"
2793 #: build/C/man3/fopen.3:88
2799 #: build/C/man3/fopen.3:94
2801 "Open for reading and writing. The file is created if it does not exist, "
2802 "otherwise it is truncated. The stream is positioned at the beginning of the "
2805 "読み出しおよび書き込みのために開く。 ファイルが存在していない場合には新たに作"
2806 "成する。 存在している場合には長さゼロに切り詰められる。 ストリームはファイル"
2810 #: build/C/man3/fopen.3:94 build/C/man3/scanf.3:447
2816 #: build/C/man3/fopen.3:99
2818 "Open for appending (writing at end of file). The file is created if it does "
2819 "not exist. The stream is positioned at the end of the file."
2821 "追加 (ファイルの最後に書き込む) のために開く。 ファイルが存在していない場合に"
2822 "は新たに作成する。 ストリームはファイルの最後に位置される。"
2825 #: build/C/man3/fopen.3:99
2831 #: build/C/man3/fopen.3:105
2833 "Open for reading and appending (writing at end of file). The file is "
2834 "created if it does not exist. The initial file position for reading is at "
2835 "the beginning of the file, but output is always appended to the end of the "
2838 "読み出しおよび追加 (ファイルの最後に書き込む) のために開く。 ファイルが存在し"
2839 "ていない場合には新たに作成する。 読み出しの初期ファイル位置はファイルの先頭で"
2840 "あるが、 書き込みは常にファイルの最後に追加される。"
2843 #: build/C/man3/fopen.3:118
2845 "The I<mode> string can also include the letter \\(aqb\\(aq either as a last "
2846 "character or as a character between the characters in any of the two-"
2847 "character strings described above. This is strictly for compatibility with "
2848 "C89 and has no effect; the \\(aqb\\(aq is ignored on all POSIX conforming "
2849 "systems, including Linux. (Other systems may treat text files and binary "
2850 "files differently, and adding the \\(aqb\\(aq may be a good idea if you do I/"
2851 "O to a binary file and expect that your program may be ported to non-UNIX "
2854 "I<mode> 文字列には文字 \\(aqb\\(aq を追加指定することができ、 I<mode> 文字列"
2855 "の最後の文字として指定する。 上記のうち 2 文字のモードの場合には 2 つの文字の"
2856 "間に指定することもできる。 これは C89 との互換性のためだけに用意された もので"
2857 "あり、関数の実行に対してはいかなる影響も持たない。 すなわち、Linux を含む全て"
2858 "の POSIX 準拠システムでは、 この \\(aqb\\(aq は無視される。 (その他のシステム"
2859 "ではテキストファイルとバイナリファイルを別々に扱うものもあるので、 もしバイナ"
2860 "リファイルの入出力を行い、 そのプログラムが非 UNIX 環境へ移植されると予測する"
2861 "なら、 \\(aqb\\(aqを付けておくのは良い考えである)"
2864 #: build/C/man3/fopen.3:121
2865 msgid "See NOTES below for details of glibc extensions for I<mode>."
2866 msgstr "I<mode> の glibc による拡張の詳細については下記の「注意」を参照。"
2869 #: build/C/man3/fopen.3:126
2871 "Any created files will have mode B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
2872 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666), as modified by the process's "
2873 "umask value (see B<umask>(2))."
2875 "すべての生成されたファイルは、 B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
2876 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666) のモードを そのプロセスの umask "
2877 "値によって修正したモードを持つ (B<umask>(2) を見よ)。"
2880 #: build/C/man3/fopen.3:141
2882 "Reads and writes may be intermixed on read/write streams in any order. Note "
2883 "that ANSI C requires that a file positioning function intervene between "
2884 "output and input, unless an input operation encounters end-of-file. (If "
2885 "this condition is not met, then a read is allowed to return the result of "
2886 "writes other than the most recent.) Therefore it is good practice (and "
2887 "indeed sometimes necessary under Linux) to put an B<fseek>(3) or "
2888 "B<fgetpos>(3) operation between write and read operations on such a "
2889 "stream. This operation may be an apparent no-op (as in I<fseek(..., 0L, "
2890 "SEEK_CUR)> called for its synchronizing side effect)."
2892 "読み出し/書き込みストリームに対しては任意の順序で読み書きを行うことができ"
2893 "る。 ただし ANSI C では、 (入力操作がファイルの末尾に到達した場合を除いて) "
2894 "出力と入力の間にはファイルの位置決め関数を 挟まなければならないことになってい"
2895 "ることに注意されたい (この条件を満足しない場合には、読み込み操作は、 最後に書"
2896 "き込まれたものでなく、以前に書き込まれた 値を返すことを許されている)。 した"
2897 "がって、このようなストリームでの読み書き操作の間には B<fseek>(3) または "
2898 "B<fgetpos>(3) 操作を挟んでおくと良いだろう (Linux では本当に必要となることも"
2899 "ときどきある)。 この操作は見かけ上何もしない操作 (no-op) でも良い (例えば "
2900 "I<fseek(..., 0L, SEEK_CUR)> を その副次的効果である同期のためだけに呼べば良"
2904 #: build/C/man3/fopen.3:146
2906 "Opening a file in append mode (B<a> as the first character of I<mode>) "
2907 "causes all subsequent write operations to this stream to occur at end-of-"
2908 "file, as if preceded the call:"
2910 "ファイルを追加モード (I<mode> の最初の文字を B<a> にする) で開くと、\n"
2911 "このストリームに対する書き込み操作は全て (先に以下の呼び出しを行った\n"
2912 "かのように) ファイルの末尾で行われる。"
2915 #: build/C/man3/fopen.3:149
2917 msgid " fseek(stream, 0, SEEK_END);\n"
2918 msgstr " fseek(stream, 0, SEEK_END);\n"
2921 #: build/C/man3/fopen.3:171
2923 "The B<fdopen>() function associates a stream with the existing file "
2924 "descriptor, I<fd>. The I<mode> of the stream (one of the values \"r\", \"r+"
2925 "\", \"w\", \"w+\", \"a\", \"a+\") must be compatible with the mode of the "
2926 "file descriptor. The file position indicator of the new stream is set to "
2927 "that belonging to I<fd>, and the error and end-of-file indicators are "
2928 "cleared. Modes \"w\" or \"w+\" do not cause truncation of the file. The "
2929 "file descriptor is not dup'ed, and will be closed when the stream created by "
2930 "B<fdopen>() is closed. The result of applying B<fdopen>() to a shared "
2931 "memory object is undefined."
2933 "B<fdopen>() 関数は、既存のファイル記述子 I<fd> にストリームを結びつける。 ス"
2934 "トリームの I<mode> (\"r\", \"r+\", \"w\", \"w+\", \"a\", \"a+\" のいずれか) "
2935 "は ファイル記述子のモードと互換のものでなければならない。 新しいストリームの"
2936 "ファイル位置指示子は I<fd> に属している値に設定される。 error と end-of-file "
2937 "の各指示子はクリアされる。 \"w\" および \"w+\" モードでのファイルの切り詰めは"
2938 "行われない。 ファイル記述子の複製は行なわれない。 B<fdopen>() で作成されたス"
2939 "トリームが閉じられたときにファイル記述子も 閉じられる。 共有メモリのオブジェ"
2940 "クトへ B<fdopen>() を行ったときの結果は定義されていない。"
2943 #: build/C/man3/fopen.3:189
2945 "The B<freopen>() function opens the file whose name is the string pointed "
2946 "to by I<path> and associates the stream pointed to by I<stream> with it. "
2947 "The original stream (if it exists) is closed. The I<mode> argument is used "
2948 "just as in the B<fopen>() function. The primary use of the B<freopen>() "
2949 "function is to change the file associated with a standard text stream "
2950 "(I<stderr>, I<stdin>, or I<stdout>)."
2952 "B<freopen>() 関数は I<path> で名前が指定されたファイルを開き、 I<stream> で"
2953 "指定されたストリームに、そのファイルを結びつける。 もとのストリームは (もし存"
2954 "在する場合には) 閉じられる。 I<mode> 引数は B<fopen>() 関数と同じ形で使われ"
2955 "る。 B<freopen>() 関数の主な用途は、標準テキストストリーム (I<stderr>, "
2956 "I<stdin>, I<stdout>) と対応付けられているファイルを変更することである。"
2959 #: build/C/man3/fopen.3:201
2961 "Upon successful completion B<fopen>(), B<fdopen>() and B<freopen>() return "
2962 "a I<FILE> pointer. Otherwise, NULL is returned and I<errno> is set to "
2963 "indicate the error."
2965 "B<fopen>(), B<fdopen>(), B<freopen>() は成功すると I<FILE> 型のポインタを返"
2966 "す。 失敗すると NULL が返され、 I<errno> がエラーを示す値にセットされる。"
2969 #: build/C/man3/fopen.3:202 build/C/man3/fseek.3:142
2970 #: build/C/man3/getline.3:128 build/C/man2/link.2:282 build/C/man2/llseek.2:77
2971 #: build/C/man2/lseek.2:192 build/C/man2/open.2:832 build/C/man2/open.2:840
2972 #: build/C/man2/open.2:845 build/C/man2/open_by_handle_at.2:273
2973 #: build/C/man2/open_by_handle_at.2:277 build/C/man2/open_by_handle_at.2:325
2974 #: build/C/man2/pipe.2:139 build/C/man2/read.2:126 build/C/man2/read.2:137
2975 #: build/C/man2/readlink.2:169 build/C/man2/readlink.2:178
2976 #: build/C/man2/readv.2:200 build/C/man2/rename.2:251
2977 #: build/C/man2/rename.2:376 build/C/man2/rename.2:385 build/C/man2/rmdir.2:67
2978 #: build/C/man3/scanf.3:565 build/C/man2/unlink.2:252 build/C/man2/write.2:154
2984 #: build/C/man3/fopen.3:212
2986 "The I<mode> provided to B<fopen>(), B<fdopen>(), or B<freopen>() was "
2989 "B<fopen>(), B<fdopen>(), B<freopen>() で与えられた I<mode> が不適切である。"
2992 #: build/C/man3/fopen.3:222
2994 "The B<fopen>(), B<fdopen>() and B<freopen>() functions may also fail and "
2995 "set I<errno> for any of the errors specified for the routine B<malloc>(3)."
2997 "B<fopen>(), B<fdopen>(), B<freopen>() 関数は B<malloc>(3) ルーチンで規定さ"
2998 "れているエラーでも失敗することがあり、 その時は対応する値に I<errno> をセット"
3002 #: build/C/man3/fopen.3:229
3004 "The B<fopen>() function may also fail and set I<errno> for any of the "
3005 "errors specified for the routine B<open>(2)."
3007 "B<fopen>() 関数は B<open>(2) ルーチンで規定されているエラーでも失敗すること"
3008 "があり、 その時は対応する値に I<errno> をセットする。"
3011 #: build/C/man3/fopen.3:236
3013 "The B<fdopen>() function may also fail and set I<errno> for any of the "
3014 "errors specified for the routine B<fcntl>(2)."
3016 "B<fdopen>() 関数は B<fcntl>(2) ルーチンで規定されているエラーでも失敗するこ"
3017 "とがあり、 その時は対応する値に I<errno> をセットする。"
3020 #: build/C/man3/fopen.3:246
3022 "The B<freopen>() function may also fail and set I<errno> for any of the "
3023 "errors specified for the routines B<open>(2), B<fclose>(3) and B<fflush>(3)."
3025 "B<freopen>() 関数は B<open>(2), B<fclose>(3), B<fflush>(3) 各ルーチンで規定"
3026 "されているエラーでも失敗することがあり、 その時は対応する値に I<errno> をセッ"
3030 #: build/C/man3/fopen.3:255
3032 "The B<fopen>() and B<freopen>() functions conform to C89. The "
3033 "B<fdopen>() function conforms to POSIX.1-1990."
3035 "B<fopen>() 関数と B<freopen>() 関数は C89に準拠している。 B<fdopen>() 関数"
3036 "は POSIX.1-1990 に準拠している。"
3039 #: build/C/man3/fopen.3:256
3045 #: build/C/man3/fopen.3:259
3047 "The GNU C library allows the following extensions for the string specified "
3050 "GNU C ライブラリでは、 I<mode> に指定できる文字列として、以下の拡張が行われて"
3054 #: build/C/man3/fopen.3:259
3056 msgid "B<c> (since glibc 2.3.3)"
3057 msgstr "B<c> (glibc 2.3.3 以降)"
3060 #: build/C/man3/fopen.3:266
3062 "Do not make the open operation, or subsequent read and write operations, "
3063 "thread cancellation points. This flag is ignored for B<fdopen>()."
3065 "open 操作、それに続く read/write 操作の、 スレッドの取り消しポイント\n"
3066 "(cancellation points) を作成しない。\n"
3067 "このフラグは B<fdopen>() では無視される。"
3070 #: build/C/man3/fopen.3:266
3072 msgid "B<e> (since glibc 2.7)"
3073 msgstr "B<e> (glibc 2.7 以降)"
3076 #: build/C/man3/fopen.3:276
3078 "Open the file with the B<O_CLOEXEC> flag. See B<open>(2) for more "
3079 "information. This flag is ignored for B<fdopen>()."
3081 "B<O_CLOEXEC> フラグを有効にしてファイルをオープンする。詳細は\n"
3082 "B<open>(2) を参照。このフラグは B<fdopen>() では無視される。"
3085 #: build/C/man3/fopen.3:276
3087 msgid "B<m> (since glibc 2.3)"
3088 msgstr "B<m> (glibc 2.3 以降)"
3092 #: build/C/man3/fopen.3:288
3094 "Attempt to access the file using B<mmap>(2), rather than I/O system calls "
3095 "(B<read>(2), B<write>(2)). Currently, use of B<mmap>(2) is attempted only "
3096 "for a file opened for reading."
3098 "I/O システムコール (B<read>(2), B<write>(2)) ではなく、 B<mmap>(2) を使って"
3099 "ファイルにアクセスしようとする。 B<mmap>(2) を使おうとするのは、読み出し用に"
3100 "オープンするファイルについてだけである。"
3103 #: build/C/man3/fopen.3:288 build/C/man3/scanf.3:421
3109 #. FIXME C11 specifies this flag
3111 #: build/C/man3/fopen.3:305
3113 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)). If the "
3114 "file already exists, B<fopen>() fails, and sets I<errno> to B<EEXIST>. "
3115 "This flag is ignored for B<fdopen>()."
3117 "ファイルを排他的にオープンする (B<open>(2) の B<O_EXCL> フラグと同様)。 ファ"
3118 "イルがすでに存在する場合、 B<fopen>() は失敗し、 I<errno> に B<EEXIST> が"
3119 "セットされる。 このフラグは B<fdopen>() では無視される。"
3122 #: build/C/man3/fopen.3:313
3124 "In addition to the above characters, B<fopen>() and B<freopen>() support "
3125 "the following syntax in I<mode>:"
3128 "B<fopen>() と B<freopen>() では I<mode> に\n"
3129 "以下の書式を 指定することができる。"
3132 #: build/C/man3/fopen.3:315
3133 msgid "B< ,ccs=>I<string>"
3134 msgstr "B< ,ccs=>I<string>"
3137 #: build/C/man3/fopen.3:331
3139 "The given I<string> is taken as the name of a coded character set and the "
3140 "stream is marked as wide-oriented. Thereafter, internal conversion "
3141 "functions convert I/O to and from the character set I<string>. If the B<,"
3142 "ccs=>I<string> syntax is not specified, then the wide-orientation of the "
3143 "stream is determined by the first file operation. If that operation is a "
3144 "wide-character operation, the stream is marked wide-oriented, and functions "
3145 "to convert to the coded character set are loaded."
3147 "指定された I<string> は、符号化文字集合の名前と解釈され、\n"
3148 "ストリームではワイド文字のストリームとして扱われる。\n"
3149 "内部変換関数で入出力時に文字集合 I<string> との変換が行われる。\n"
3150 "書式 B<,ccs=>I<string> が指定されない場合は、\n"
3151 "ストリームをワイド文字のストリームとして扱うかは\n"
3152 "最初のファイル操作時に決定される。\n"
3153 "最初のファイル操作がワイド文字操作であった場合は、\n"
3154 "そのストリームはワイド文字のストリームとして扱われ、\n"
3155 "符号化文字集合との変換を行う関数が読み込まれる。"
3157 #. FIXME http://sourceware.org/bugzilla/show_bug.cgi?id=12685
3159 #: build/C/man3/fopen.3:348
3161 "When parsing for individual flag characters in I<mode> (i.e., the characters "
3162 "preceding the \"ccs\" specification), the glibc implementation of "
3163 "B<fopen>() and B<freopen>() limits the number of characters examined in "
3164 "I<mode> to 7 (or, in glibc versions before 2.14, to 6, which was not enough "
3165 "to include possible specifications such as \"rb+cmxe\"). The current "
3166 "implementation of B<fdopen>() parses at most 5 characters in I<mode>."
3168 "I<mode> の個々のフラグ文字 (\"ccs\" 指定の前の文字) を解釈する際に、\n"
3169 "glibc の B<fopen>() と B<freopen>() の実装では、\n"
3170 "I<mode> の確認を最大 7 文字しか行わないという制限がある\n"
3171 "(バージョン 2.14 より前の glibc では最大 6 文字だが、\n"
3172 "6 文字では \"rb+cmxe\" などの指定を行うには不十分であった)。\n"
3173 "B<fdopen>() の現在の実装では最大 5 文字の I<mode> しか解釈されない。"
3176 #: build/C/man3/fopen.3:354
3178 "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
3180 "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
3183 #: build/C/man3/fopencookie.3:26
3186 msgstr "FOPENCOOKIE"
3189 #: build/C/man3/fopencookie.3:26
3195 #: build/C/man3/fopencookie.3:26 build/C/man2/link.2:32
3196 #: build/C/man2/llseek.2:28 build/C/man2/lseek.2:47 build/C/man3/lseek64.3:25
3197 #: build/C/man2/open.2:51 build/C/man2/open_by_handle_at.2:25
3198 #: build/C/man2/pipe.2:36 build/C/man2/read.2:35 build/C/man2/readlink.2:44
3199 #: build/C/man2/readv.2:32 build/C/man2/rename.2:33 build/C/man2/rmdir.2:30
3200 #: build/C/man3/setbuf.3:48 build/C/man3/stdin.3:13 build/C/man2/symlink.2:33
3201 #: build/C/man7/symlink.7:37 build/C/man2/unlink.2:33 build/C/man2/write.2:39
3207 #: build/C/man3/fopencookie.3:29
3208 msgid "fopencookie - opening a custom stream"
3212 #: build/C/man3/fopencookie.3:36
3215 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
3216 "B< cookie_io_functions_t >I<io_funcs>B<);>\n"
3218 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
3219 "B< cookie_io_functions_t >I<io_funcs>B<);>\n"
3222 #: build/C/man3/fopencookie.3:49
3224 "The B<fopencookie>() function allows the programmer to create a custom "
3225 "implementation for a standard I/O stream. This implementation can store the "
3226 "stream's data at a location of its own choosing; for example, "
3227 "B<fopencookie>() is used to implement B<fmemopen>(3), which provides a "
3228 "stream interface to data that is stored in a buffer in memory."
3232 #: build/C/man3/fopencookie.3:51
3233 msgid "In order to create a custom stream the programmer must:"
3237 #: build/C/man3/fopencookie.3:51 build/C/man3/fopencookie.3:54
3238 #: build/C/man3/fopencookie.3:65 build/C/man2/lseek.2:168
3239 #: build/C/man2/lseek.2:170 build/C/man2/lseek.2:173 build/C/man2/lseek.2:175
3240 #: build/C/man2/lseek.2:177 build/C/man2/open.2:535 build/C/man2/open.2:543
3241 #: build/C/man2/open.2:549 build/C/man2/open.2:555 build/C/man2/open.2:561
3242 #: build/C/man2/open.2:574 build/C/man2/open.2:695 build/C/man2/open.2:703
3243 #: build/C/man2/open_by_handle_at.2:138 build/C/man2/open_by_handle_at.2:146
3244 #: build/C/man2/open_by_handle_at.2:157 build/C/man2/open_by_handle_at.2:170
3245 #: build/C/man2/pipe.2:95 build/C/man2/pipe.2:101 build/C/man2/pipe.2:111
3246 #: build/C/man3/scanf.3:658 build/C/man3/scanf.3:663
3247 #: build/C/man7/symlink.7:290 build/C/man7/symlink.7:300
3248 #: build/C/man7/symlink.7:330 build/C/man7/symlink.7:390
3249 #: build/C/man7/symlink.7:419 build/C/man7/symlink.7:448
3250 #: build/C/man7/symlink.7:479 build/C/man7/symlink.7:492
3256 #: build/C/man3/fopencookie.3:54
3258 "Implement four \"hook\" functions that are used internally by the standard I/"
3259 "O library when performing I/O on the stream."
3263 #: build/C/man3/fopencookie.3:65
3265 "Define a \"cookie\" data type, a structure that provides bookkeeping "
3266 "information (e.g., where to store data) used by the aforementioned hook "
3267 "functions. The standard I/O package knows nothing about the contents of "
3268 "this cookie (thus it is typed as I<void\\ *> when passed to "
3269 "B<fopencookie>()), but automatically supplies the cookie as the first "
3270 "argument when calling the hook functions."
3274 #: build/C/man3/fopencookie.3:70
3276 "Call B<fopencookie>() to open a new stream and associate the cookie and "
3277 "hook functions with that stream."
3281 #: build/C/man3/fopencookie.3:78
3283 "The B<fopencookie>() function serves a purpose similar to B<fopen>(3): it "
3284 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
3285 "operate on that stream."
3289 #: build/C/man3/fopencookie.3:85
3291 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
3292 "to be associated with the new stream. This pointer is supplied as the first "
3293 "argument when the standard I/O library invokes any of the hook functions "
3298 #: build/C/man3/fopencookie.3:101
3300 "The I<mode> argument serves the same purpose as for B<fopen>(3). The "
3301 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>. "
3302 "See B<fopen>(3) for details."
3306 #: build/C/man3/fopencookie.3:107
3308 "The I<io_funcs> argument is a structure that contains four fields pointing "
3309 "to the programmer-defined hook functions that are used to implement this "
3310 "stream. The structure is defined as follows"
3314 #: build/C/man3/fopencookie.3:116
3317 "typedef struct {\n"
3318 " cookie_read_function_t *read;\n"
3319 " cookie_write_function_t *write;\n"
3320 " cookie_seek_function_t *seek;\n"
3321 " cookie_close_function_t *close;\n"
3322 "} cookie_io_functions_t;\n"
3324 "typedef struct {\n"
3325 " cookie_read_function_t *read;\n"
3326 " cookie_write_function_t *write;\n"
3327 " cookie_seek_function_t *seek;\n"
3328 " cookie_close_function_t *close;\n"
3329 "} cookie_io_functions_t;\n"
3332 #: build/C/man3/fopencookie.3:120
3333 msgid "The four fields are as follows:"
3337 #: build/C/man3/fopencookie.3:120
3339 msgid "I<cookie_read_function_t *read>"
3340 msgstr "I<cookie_read_function_t *read>"
3343 #: build/C/man3/fopencookie.3:124
3345 "This function implements read operations for the stream. When called, it "
3346 "receives three arguments:"
3350 #: build/C/man3/fopencookie.3:126
3352 msgid " ssize_t read(void *cookie, char *buf, size_t size);\n"
3353 msgstr " ssize_t read(void *cookie, char *buf, size_t size);\n"
3356 #: build/C/man3/fopencookie.3:141
3358 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
3359 "input data can be placed and the size of that buffer. As its function "
3360 "result, the I<read> function should return the number of bytes copied into "
3361 "I<buf>, 0 on end of file, or -1 on error. The I<read> function should "
3362 "update the stream offset appropriately."
3366 #: build/C/man3/fopencookie.3:146
3368 "If I<*read> is a null pointer, then reads from the custom stream always "
3369 "return end of file."
3373 #: build/C/man3/fopencookie.3:146
3375 msgid "I<cookie_write_function_t *write>"
3376 msgstr "I<cookie_write_function_t *write>"
3379 #: build/C/man3/fopencookie.3:150
3381 "This function implements write operations for the stream. When called, it "
3382 "receives three arguments:"
3386 #: build/C/man3/fopencookie.3:152
3388 msgid " ssize_t write(void *cookie, const char *buf, size_t size);\n"
3389 msgstr " ssize_t write(void *cookie, const char *buf, size_t size);\n"
3392 #: build/C/man3/fopencookie.3:168
3394 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
3395 "output to the stream and the size of that buffer. As its function result, "
3396 "the I<write> function should return the number of bytes copied from I<buf>, "
3397 "or 0 on error. (The function must not return a negative value.) The "
3398 "I<write> function should update the stream offset appropriately."
3402 #: build/C/man3/fopencookie.3:173
3403 msgid "If I<*write> is a null pointer, then output to the stream is discarded."
3407 #: build/C/man3/fopencookie.3:173
3409 msgid "I<cookie_seek_function_t *seek>"
3410 msgstr "I<cookie_seek_function_t *seek>"
3413 #: build/C/man3/fopencookie.3:177
3415 "This function implements seek operations on the stream. When called, it "
3416 "receives three arguments:"
3420 #: build/C/man3/fopencookie.3:179
3422 msgid " int seek(void *cookie, off64_t *offset, int whence);\n"
3423 msgstr " int seek(void *cookie, off64_t *offset, int whence);\n"
3426 #: build/C/man3/fopencookie.3:185
3428 "The I<*offset> argument specifies the new file offset depending on which of "
3429 "the following three values is supplied in I<whence>:"
3433 #: build/C/man3/fopencookie.3:186 build/C/man2/lseek.2:67
3436 msgstr "B<SEEK_SET>"
3439 #: build/C/man3/fopencookie.3:191
3441 "The stream offset should be set I<*offset> bytes from the start of the "
3446 #: build/C/man3/fopencookie.3:191 build/C/man2/lseek.2:72
3449 msgstr "B<SEEK_CUR>"
3452 #: build/C/man3/fopencookie.3:195
3453 msgid "I<*offset> should be added to the current stream offset."
3457 #: build/C/man3/fopencookie.3:195 build/C/man2/lseek.2:77
3460 msgstr "B<SEEK_END>"
3463 #: build/C/man3/fopencookie.3:199
3465 "The stream offset should be set to the size of the stream plus I<*offset>."
3469 #: build/C/man3/fopencookie.3:206
3471 "Before returning, the I<seek> function should update I<*offset> to indicate "
3472 "the new stream offset."
3476 #: build/C/man3/fopencookie.3:210
3478 "As its function result, the I<seek> function should return 0 on success, and "
3483 #: build/C/man3/fopencookie.3:215
3485 "If I<*seek> is a null pointer, then it is not possible to perform seek "
3486 "operations on the stream."
3490 #: build/C/man3/fopencookie.3:215
3492 msgid "I<cookie_close_function_t *close>"
3493 msgstr "I<cookie_close_function_t *close>"
3496 #: build/C/man3/fopencookie.3:221
3498 "This function closes the stream. The hook function can do things such as "
3499 "freeing buffers allocated for the stream. When called, it receives one "
3504 #: build/C/man3/fopencookie.3:223
3506 msgid " int close(void *cookie);\n"
3507 msgstr " int close(void *cookie);\n"
3510 #: build/C/man3/fopencookie.3:228
3512 "The I<cookie> argument is the cookie that the programmer supplied when "
3513 "calling B<fopencookie>()."
3517 #: build/C/man3/fopencookie.3:234
3519 "As its function result, the I<close> function should return 0 on success, "
3520 "and B<EOF> on error."
3524 #: build/C/man3/fopencookie.3:238
3526 "If I<*close> is NULL, then no special action is performed when the stream is "
3531 #. It's not clear if errno ever gets set...
3533 #: build/C/man3/fopencookie.3:245
3535 "On success B<fopencookie>() returns a pointer to the new stream. On error, "
3540 #: build/C/man3/fopencookie.3:247
3541 msgid "This function is a nonstandard GNU extension."
3545 #: build/C/man3/fopencookie.3:256
3547 "The program below implements a custom stream whose functionality is similar "
3548 "(but not identical) to that available via B<fmemopen>(3). It implements a "
3549 "stream whose data is stored in a memory buffer. The program writes its "
3550 "command-line arguments to the stream, and then seeks through the stream "
3551 "reading two out of every five characters and writing them to standard "
3552 "output. The following shell session demonstrates the use of the program:"
3556 #: build/C/man3/fopencookie.3:264
3559 "$B< ./a.out \\(aqhello world\\(aq>\n"
3563 "Reached end of file\n"
3565 "$B< ./a.out \\(aqhello world\\(aq>\n"
3569 "Reached end of file\n"
3572 #: build/C/man3/fopencookie.3:271
3574 "Note that a more general version of the program below could be improved to "
3575 "more robustly handle various error situations (e.g., opening a stream with a "
3576 "cookie that already has an open stream; closing a stream that has already "
3581 #: build/C/man3/fopencookie.3:280
3584 "#define _GNU_SOURCE\n"
3585 "#include E<lt>sys/types.hE<gt>\n"
3586 "#include E<lt>stdio.hE<gt>\n"
3587 "#include E<lt>stdlib.hE<gt>\n"
3588 "#include E<lt>unistd.hE<gt>\n"
3589 "#include E<lt>string.hE<gt>\n"
3591 "#define _GNU_SOURCE\n"
3592 "#include E<lt>sys/types.hE<gt>\n"
3593 "#include E<lt>stdio.hE<gt>\n"
3594 "#include E<lt>stdlib.hE<gt>\n"
3595 "#include E<lt>unistd.hE<gt>\n"
3596 "#include E<lt>string.hE<gt>\n"
3599 #: build/C/man3/fopencookie.3:282
3601 msgid "#define INIT_BUF_SIZE 4\n"
3602 msgstr "#define INIT_BUF_SIZE 4\n"
3605 #: build/C/man3/fopencookie.3:289
3608 "struct memfile_cookie {\n"
3609 " char *buf; /* Dynamically sized buffer for data */\n"
3610 " size_t allocated; /* Size of buf */\n"
3611 " size_t endpos; /* Number of characters in buf */\n"
3612 " off_t offset; /* Current file offset in buf */\n"
3615 "struct memfile_cookie {\n"
3616 " char *buf; /* Dynamically sized buffer for data */\n"
3617 " size_t allocated; /* Size of buf */\n"
3618 " size_t endpos; /* Number of characters in buf */\n"
3619 " off_t offset; /* Current file offset in buf */\n"
3623 #: build/C/man3/fopencookie.3:295
3627 "memfile_write(void *c, const char *buf, size_t size)\n"
3629 " char *new_buff;\n"
3630 " struct memfile_cookie *cookie = c;\n"
3633 "memfile_write(void *c, const char *buf, size_t size)\n"
3635 " char *new_buff;\n"
3636 " struct memfile_cookie *cookie = c;\n"
3639 #: build/C/man3/fopencookie.3:297
3641 msgid " /* Buffer too small? Keep doubling size until big enough */\n"
3642 msgstr " /* Buffer too small? Keep doubling size until big enough */\n"
3645 #: build/C/man3/fopencookie.3:307
3648 " while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
3649 " new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
3650 " if (new_buff == NULL) {\n"
3653 " cookie-E<gt>allocated *= 2;\n"
3654 " cookie-E<gt>buf = new_buff;\n"
3658 " while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
3659 " new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
3660 " if (new_buff == NULL) {\n"
3663 " cookie-E<gt>allocated *= 2;\n"
3664 " cookie-E<gt>buf = new_buff;\n"
3669 #: build/C/man3/fopencookie.3:309
3671 msgid " memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
3672 msgstr " memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
3675 #: build/C/man3/fopencookie.3:313
3678 " cookie-E<gt>offset += size;\n"
3679 " if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
3680 " cookie-E<gt>endpos = cookie-E<gt>offset;\n"
3682 " cookie-E<gt>offset += size;\n"
3683 " if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
3684 " cookie-E<gt>endpos = cookie-E<gt>offset;\n"
3687 #: build/C/man3/fopencookie.3:316
3697 #: build/C/man3/fopencookie.3:322
3701 "memfile_read(void *c, char *buf, size_t size)\n"
3703 " ssize_t xbytes;\n"
3704 " struct memfile_cookie *cookie = c;\n"
3707 "memfile_read(void *c, char *buf, size_t size)\n"
3709 " ssize_t xbytes;\n"
3710 " struct memfile_cookie *cookie = c;\n"
3713 #: build/C/man3/fopencookie.3:324
3715 msgid " /* Fetch minimum of bytes requested and bytes available */\n"
3716 msgstr " /* Fetch minimum of bytes requested and bytes available */\n"
3719 #: build/C/man3/fopencookie.3:330
3723 " if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
3724 " xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
3725 " if (xbytes E<lt> 0) /* offset may be past endpos */\n"
3729 " if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
3730 " xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
3731 " if (xbytes E<lt> 0) /* offset may be past endpos */\n"
3735 #: build/C/man3/fopencookie.3:332
3737 msgid " memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
3738 msgstr " memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
3741 #: build/C/man3/fopencookie.3:336
3744 " cookie-E<gt>offset += xbytes;\n"
3748 " cookie-E<gt>offset += xbytes;\n"
3753 #: build/C/man3/fopencookie.3:342
3757 "memfile_seek(void *c, off64_t *offset, int whence)\n"
3759 " off64_t new_offset;\n"
3760 " struct memfile_cookie *cookie = c;\n"
3763 "memfile_seek(void *c, off64_t *offset, int whence)\n"
3765 " off64_t new_offset;\n"
3766 " struct memfile_cookie *cookie = c;\n"
3769 #: build/C/man3/fopencookie.3:351
3772 " if (whence == SEEK_SET)\n"
3773 " new_offset = *offset;\n"
3774 " else if (whence == SEEK_END)\n"
3775 " new_offset = cookie-E<gt>endpos + *offset;\n"
3776 " else if (whence == SEEK_CUR)\n"
3777 " new_offset = cookie-E<gt>offset + *offset;\n"
3781 " if (whence == SEEK_SET)\n"
3782 " new_offset = *offset;\n"
3783 " else if (whence == SEEK_END)\n"
3784 " new_offset = cookie-E<gt>endpos + *offset;\n"
3785 " else if (whence == SEEK_CUR)\n"
3786 " new_offset = cookie-E<gt>offset + *offset;\n"
3791 #: build/C/man3/fopencookie.3:354
3794 " if (new_offset E<lt> 0)\n"
3797 " if (new_offset E<lt> 0)\n"
3801 #: build/C/man3/fopencookie.3:359
3804 " cookie-E<gt>offset = new_offset;\n"
3805 " *offset = new_offset;\n"
3809 " cookie-E<gt>offset = new_offset;\n"
3810 " *offset = new_offset;\n"
3815 #: build/C/man3/fopencookie.3:364
3819 "memfile_close(void *c)\n"
3821 " struct memfile_cookie *cookie = c;\n"
3824 "memfile_close(void *c)\n"
3826 " struct memfile_cookie *cookie = c;\n"
3829 #: build/C/man3/fopencookie.3:368
3832 " free(cookie-E<gt>buf);\n"
3833 " cookie-E<gt>allocated = 0;\n"
3834 " cookie-E<gt>buf = NULL;\n"
3836 " free(cookie-E<gt>buf);\n"
3837 " cookie-E<gt>allocated = 0;\n"
3838 " cookie-E<gt>buf = NULL;\n"
3841 #: build/C/man3/fopencookie.3:371
3851 #: build/C/man3/fopencookie.3:387
3855 "main(int argc, char *argv[])\n"
3857 " cookie_io_functions_t memfile_func = {\n"
3858 " .read = memfile_read,\n"
3859 " .write = memfile_write,\n"
3860 " .seek = memfile_seek,\n"
3861 " .close = memfile_close\n"
3864 " struct memfile_cookie mycookie;\n"
3868 " char buf[1000];\n"
3871 "main(int argc, char *argv[])\n"
3873 " cookie_io_functions_t memfile_func = {\n"
3874 " .read = memfile_read,\n"
3875 " .write = memfile_write,\n"
3876 " .seek = memfile_seek,\n"
3877 " .close = memfile_close\n"
3880 " struct memfile_cookie mycookie;\n"
3884 " char buf[1000];\n"
3887 #: build/C/man3/fopencookie.3:389
3889 msgid " /* Set up the cookie before calling fopencookie() */\n"
3890 msgstr " /* Set up the cookie before calling fopencookie() */\n"
3893 #: build/C/man3/fopencookie.3:395
3896 " mycookie.buf = malloc(INIT_BUF_SIZE);\n"
3897 " if (mycookie.buf == NULL) {\n"
3898 " perror(\"malloc\");\n"
3899 " exit(EXIT_FAILURE);\n"
3902 " mycookie.buf = malloc(INIT_BUF_SIZE);\n"
3903 " if (mycookie.buf == NULL) {\n"
3904 " perror(\"malloc\");\n"
3905 " exit(EXIT_FAILURE);\n"
3909 #: build/C/man3/fopencookie.3:399
3912 " mycookie.allocated = INIT_BUF_SIZE;\n"
3913 " mycookie.offset = 0;\n"
3914 " mycookie.endpos = 0;\n"
3916 " mycookie.allocated = INIT_BUF_SIZE;\n"
3917 " mycookie.offset = 0;\n"
3918 " mycookie.endpos = 0;\n"
3921 #: build/C/man3/fopencookie.3:405
3924 " fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
3925 " if (fp == NULL) {\n"
3926 " perror(\"fopencookie\");\n"
3927 " exit(EXIT_FAILURE);\n"
3930 " fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
3931 " if (fp == NULL) {\n"
3932 " perror(\"fopencookie\");\n"
3933 " exit(EXIT_FAILURE);\n"
3937 #: build/C/man3/fopencookie.3:407
3939 msgid " /* Write command-line arguments to our file */\n"
3940 msgstr " /* Write command-line arguments to our file */\n"
3943 #: build/C/man3/fopencookie.3:413
3946 " for (j = 1; j E<lt> argc; j++)\n"
3947 " if (fputs(argv[j], fp) == EOF) {\n"
3948 " perror(\"fputs\");\n"
3949 " exit(EXIT_FAILURE);\n"
3952 " for (j = 1; j E<lt> argc; j++)\n"
3953 " if (fputs(argv[j], fp) == EOF) {\n"
3954 " perror(\"fputs\");\n"
3955 " exit(EXIT_FAILURE);\n"
3959 #: build/C/man3/fopencookie.3:415
3961 msgid " /* Read two bytes out of every five, until EOF */\n"
3962 msgstr " /* Read two bytes out of every five, until EOF */\n"
3965 #: build/C/man3/fopencookie.3:430
3968 " for (p = 0; ; p += 5) {\n"
3969 " if (fseek(fp, p, SEEK_SET) == -1) {\n"
3970 " perror(\"fseek\");\n"
3971 " exit(EXIT_FAILURE);\n"
3973 " nread = fread(buf, 1, 2, fp);\n"
3974 " if (nread == -1) {\n"
3975 " perror(\"fread\");\n"
3976 " exit(EXIT_FAILURE);\n"
3978 " if (nread == 0) {\n"
3979 " printf(\"Reached end of file\\en\");\n"
3983 " for (p = 0; ; p += 5) {\n"
3984 " if (fseek(fp, p, SEEK_SET) == -1) {\n"
3985 " perror(\"fseek\");\n"
3986 " exit(EXIT_FAILURE);\n"
3988 " nread = fread(buf, 1, 2, fp);\n"
3989 " if (nread == -1) {\n"
3990 " perror(\"fread\");\n"
3991 " exit(EXIT_FAILURE);\n"
3993 " if (nread == 0) {\n"
3994 " printf(\"Reached end of file\\en\");\n"
3999 #: build/C/man3/fopencookie.3:433
4002 " printf(\"/%.*s/\\en\", nread, buf);\n"
4005 " printf(\"/%.*s/\\en\", nread, buf);\n"
4009 #: build/C/man3/fopencookie.3:436 build/C/man2/open_by_handle_at.2:579
4010 #: build/C/man2/open_by_handle_at.2:719 build/C/man2/readlink.2:312
4013 " exit(EXIT_SUCCESS);\n"
4016 " exit(EXIT_SUCCESS);\n"
4020 #: build/C/man3/fopencookie.3:442
4021 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
4022 msgstr "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
4025 #: build/C/man3/fpurge.3:25
4031 #: build/C/man3/fpurge.3:25
4037 #: build/C/man3/fpurge.3:28
4038 msgid "fpurge, __fpurge - purge a stream"
4039 msgstr "fpurge, __fpurge - ストリームを一掃 (purge) する"
4042 #: build/C/man3/fpurge.3:32
4045 "/* unsupported */\n"
4046 "B<#include E<lt>stdio.hE<gt>>\n"
4048 "/* unsupported */\n"
4049 "B<#include E<lt>stdio.hE<gt>>\n"
4052 #: build/C/man3/fpurge.3:34
4054 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
4055 msgstr "B<int fpurge(FILE *>I<stream>B<);>\n"
4058 #: build/C/man3/fpurge.3:37
4062 "B<#include E<lt>stdio.hE<gt>>\n"
4065 "B<#include E<lt>stdio.hE<gt>>\n"
4068 #: build/C/man3/fpurge.3:39
4070 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
4071 msgstr "B<#include E<lt>stdio_ext.hE<gt>>\n"
4074 #: build/C/man3/fpurge.3:41
4076 msgid "B<void __fpurge(FILE *>I<stream>B<);>\n"
4077 msgstr "B<void __fpurge(FILE *>I<stream>B<);>\n"
4080 #: build/C/man3/fpurge.3:54
4082 "The function B<fpurge>() clears the buffers of the given stream. For "
4083 "output streams this discards any unwritten output. For input streams this "
4084 "discards any input read from the underlying object but not yet obtained via "
4085 "B<getc>(3); this includes any text pushed back via B<ungetc>(3). See also "
4088 "B<fpurge>() 関数は、与えられたストリームのバッファをクリアする。 出力スト"
4089 "リームでこれを行うと、書き出されていない出力は捨てられる。 入力ストリームでこ"
4090 "れを行うと、 下層にあるオブジェクトから読み込まれ B<getc>(3) による取得を"
4091 "待っている入力が、すべて捨てられる。 これには B<ungetc>(3) によって戻された"
4092 "テキストも含まれる。 B<fflush>(3) も参照のこと。"
4095 #: build/C/man3/fpurge.3:58
4097 "The function B<__fpurge>() does precisely the same, but without returning a "
4099 msgstr "B<__fpurge>() 関数も全く同じことを行うが、ただし返り値を返さない。"
4102 #: build/C/man3/fpurge.3:65
4104 "Upon successful completion B<fpurge>() returns 0. On error, it returns -1 "
4105 "and sets I<errno> appropriately."
4107 "成功すると B<fpurge>() は 0 を返す。 エラーが起こると -1 を返し、 I<errno> "
4111 #: build/C/man3/fpurge.3:70
4112 msgid "I<stream> is not an open stream."
4113 msgstr "I<stream> がオープンされていない。"
4116 #: build/C/man3/fpurge.3:78
4118 "These functions are nonstandard and not portable. The function B<fpurge>() "
4119 "was introduced in 4.4BSD and is not available under Linux. The function "
4120 "B<__fpurge>() was introduced in Solaris, and is present in glibc 2.1.95 and "
4123 "これらの関数は標準ではなく、よって移植性もない。 B<fpurge>() 関数は 4.4BSD "
4124 "で導入されたが、Linux では利用できない。 B<__fpurge>() 関数は Solaris で導入"
4125 "され、glibc 2.1.95 以降には存在している。"
4128 #: build/C/man3/fpurge.3:80
4129 msgid "Usually it is a mistake to want to discard input buffers."
4130 msgstr "通常は入力バッファを捨てようとするのは間違っている。"
4134 #: build/C/man3/fpurge.3:85
4135 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
4136 msgstr "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
4139 #: build/C/man3/fputwc.3:16
4145 #: build/C/man3/fputwc.3:19
4146 msgid "fputwc, putwc - write a wide character to a FILE stream"
4147 msgstr "fputwc, putwc - ワイド文字を FILE ストリームに書き込む"
4150 #: build/C/man3/fputwc.3:27
4153 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
4154 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
4156 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
4157 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
4160 #: build/C/man3/fputwc.3:43
4162 "The B<fputwc>() function is the wide-character equivalent of the "
4163 "B<fputc>(3) function. It writes the wide character I<wc> to I<stream>. If "
4164 "I<ferror(stream)> becomes true, it returns B<WEOF>. If a wide-character "
4165 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>. "
4166 "Otherwise, it returns I<wc>."
4168 "B<fputwc>() 関数は、 B<fputc>(3) に対応するワイド文字関数である。この 関数"
4169 "は、ワイド文字 I<wc> を I<stream> に書き込む。 I<ferror(stream)> が真になる"
4170 "と、この関数は B<WEOF> を返す。 ワイド文字変換でエラーが発生した場合は、 "
4171 "I<errno> に B<EILSEQ> をセットし、 B<WEOF> を返す。 それ以外の場合では、この"
4175 #: build/C/man3/fputwc.3:51
4177 "The B<putwc>() function or macro functions identically to B<fputwc>(). It "
4178 "may be implemented as a macro, and may evaluate its argument more than "
4179 "once. There is no reason ever to use it."
4181 "B<putwc>() 関数あるいはマクロは、 B<fputwc>() と全く同じ動作をする。 この関"
4182 "数はマクロとして実装されるかもしれないので、引き数が複数回評価さ れるかもしれ"
4183 "ない。この関数を使う理由はもはや存在しない。"
4186 #: build/C/man3/fputwc.3:63
4188 "The B<fputwc>() function returns I<wc> if no error occurred, or B<WEOF> to "
4189 "indicate an error. In the event of an error, I<errno> is set to indicate "
4192 "B<fputwc>() 関数は、エラーが起きなければ I<wc> を返す。エラーの場合には "
4193 "B<WEOF> が返り、 I<errno> にエラーの原因を示す値が設定される。"
4196 #: build/C/man3/fputwc.3:68
4197 msgid "Conversion of I<wc> to the stream's encoding fails."
4198 msgstr "I<wc> からストリームの符号への変換に失敗した。"
4201 #: build/C/man3/fputwc.3:77
4203 "The behavior of B<fputwc>() depends on the B<LC_CTYPE> category of the "
4205 msgstr "B<fputwc>() の動作は現在のロケールの B<LC_CTYPE> カテゴリに依存する。"
4208 #: build/C/man3/fputwc.3:85
4210 "In the absence of additional information passed to the B<fopen>(3) call, it "
4211 "is reasonable to expect that B<fputwc>() will actually write the multibyte "
4212 "sequence corresponding to the wide character I<wc>."
4214 "B<fopen>(3) システムコールに渡す追加情報がない場合には、 B<fputwc>() は 実"
4215 "際にはワイド文字 I<wc> に対応するマルチバイトシーケンスを書き込むと 期待して"
4219 #: build/C/man3/fputwc.3:89
4220 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
4221 msgstr "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
4224 #: build/C/man3/fread.3:45
4230 #: build/C/man3/fread.3:45
4236 #: build/C/man3/fread.3:48
4237 msgid "fread, fwrite - binary stream input/output"
4238 msgstr "fread, fwrite - バイナリストリームの入出力"
4241 #: build/C/man3/fread.3:54
4243 msgid "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE *>I<stream>B<);>\n"
4244 msgstr "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE *>I<stream>B<);>\n"
4247 #: build/C/man3/fread.3:57
4250 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<,>\n"
4251 "B< FILE *>I<stream>B<);>\n"
4253 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<,>\n"
4254 "B< FILE *>I<stream>B<);>\n"
4257 #: build/C/man3/fread.3:69
4259 "The function B<fread>() reads I<nmemb> elements of data, each I<size> bytes "
4260 "long, from the stream pointed to by I<stream>, storing them at the location "
4263 "B<fread>() 関数は I<stream> ポインタで指定されたストリームから I<nmemb> 個の"
4264 "データを読み込み、 I<ptr> で与えられた場所に格納する。 個々のデータは "
4265 "I<size> バイトの長さを持つ。"
4268 #: build/C/man3/fread.3:80
4270 "The function B<fwrite>() writes I<nmemb> elements of data, each I<size> "
4271 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
4272 "location given by I<ptr>."
4274 "B<fwrite>() 関数は I<ptr> で指定された場所から得た I<nmemb> 個のデータを、 "
4275 "I<stream> ポインタで指定されたストリームに書き込む。 個々のデータは I<size> "
4279 #: build/C/man3/fread.3:96
4281 "On success, B<fread>() and B<fwrite>() return the number of I<items> read "
4282 "or written. This number equals the number of bytes transferred only when "
4283 "I<size> is 1. If an error occurs, or the end of the file is reached, the "
4284 "return value is a short item count (or zero)."
4286 "成功すると、 B<fread>() と B<fwrite>() は読み書きを行った要素の個数を返す。\n"
4287 "I<size> が 1 の場合は、この数字は転送されたバイト数と等しい。\n"
4288 "エラーが生じた場合や、ファイルの末尾 (end-of-file) に達した場合、\n"
4289 "返り値は指定した個数よりも小さい値 (または 0) となる。"
4292 #: build/C/man3/fread.3:103
4294 "B<fread>() does not distinguish between end-of-file and error, and callers "
4295 "must use B<feof>(3) and B<ferror>(3) to determine which occurred."
4297 "B<fread>() は end-of-file とエラーを区別しないので、 どちらが生じたかを判断"
4298 "するためには、 呼び出し側で B<feof>(3) と B<ferror>(3) とを使用しなければな"
4302 #: build/C/man3/fread.3:105
4303 msgid "C89, POSIX.1-2001."
4304 msgstr "C89, POSIX.1-2001."
4307 #: build/C/man3/fread.3:111
4308 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
4310 "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
4313 #: build/C/man3/fseek.3:42
4319 #: build/C/man3/fseek.3:42 build/C/man3/perror.3:31
4321 #| msgid "2014-05-08"
4326 #: build/C/man3/fseek.3:45
4327 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
4328 msgstr "fgetpos, fseek, fsetpos, ftell, rewind - ストリームの位置を変更する"
4331 #: build/C/man3/fseek.3:49
4332 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
4333 msgstr "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
4336 #: build/C/man3/fseek.3:51
4337 msgid "B<long ftell(FILE *>I<stream>B<);>"
4338 msgstr "B<long ftell(FILE *>I<stream>B<);>"
4341 #: build/C/man3/fseek.3:53
4342 msgid "B<void rewind(FILE *>I<stream>B<);>"
4343 msgstr "B<void rewind(FILE *>I<stream>B<);>"
4346 #: build/C/man3/fseek.3:55
4347 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
4348 msgstr "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
4351 #: build/C/man3/fseek.3:57
4353 #| msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
4354 msgid "B<int fsetpos(FILE *>I<stream>B<, const fpos_t *>I<pos>B<);>"
4355 msgstr "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
4358 #: build/C/man3/fseek.3:81
4360 "The B<fseek>() function sets the file position indicator for the stream "
4361 "pointed to by I<stream>. The new position, measured in bytes, is obtained "
4362 "by adding I<offset> bytes to the position specified by I<whence>. If "
4363 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
4364 "relative to the start of the file, the current position indicator, or end-of-"
4365 "file, respectively. A successful call to the B<fseek>() function clears "
4366 "the end-of-file indicator for the stream and undoes any effects of the "
4367 "B<ungetc>(3) function on the same stream."
4369 "B<fseek>() 関数は I<stream> によって指定されたストリームにおいて、ファイル位"
4370 "置表示子 (file position indicator) をセットする。新たな位置 (バイト単位) は "
4371 "I<whence> で指定された位置に I<offset> バイトを加えることによって与えられ"
4372 "る。 I<whence> が B<SEEK_SET>, B<SEEK_CUR>, B<SEEK_END> のどれかになっている"
4373 "場合は、それぞれファイルの先頭、現在の位置表示子、 ファイルの末尾からのオフ"
4374 "セットが取られる。 B<fseek>() 関数の呼び出しが成功すると、ストリームの end-"
4375 "of-file 表示子は クリアされ、それまでに B<ungetc>(3) 関数で戻したデータはな"
4379 #: build/C/man3/fseek.3:87
4381 "The B<ftell>() function obtains the current value of the file position "
4382 "indicator for the stream pointed to by I<stream>."
4384 "B<ftell>() 関数は I<stream> によって指定されたストリームにおける、ファイル位"
4388 #: build/C/man3/fseek.3:94
4390 "The B<rewind>() function sets the file position indicator for the stream "
4391 "pointed to by I<stream> to the beginning of the file. It is equivalent to:"
4393 "B<rewind>() 関数は I<stream> によって指定されたストリームにおいて、ファイル"
4394 "位置表示子 をファイルの先頭にセットする。この関数は以下と等価である。"
4397 #: build/C/man3/fseek.3:97
4398 msgid "(void) fseek(stream, 0L, SEEK_SET)"
4399 msgstr "(void) fseek(stream, 0L, SEEK_SET)"
4402 #: build/C/man3/fseek.3:101
4404 "except that the error indicator for the stream is also cleared (see "
4407 "ただし B<rewind>() ではストリームに対するエラー表示子 (error indicator) も同"
4408 "時に クリアされる ( B<clearerr>(3) を見よ)。"
4411 #: build/C/man3/fseek.3:121
4413 "The B<fgetpos>() and B<fsetpos>() functions are alternate interfaces "
4414 "equivalent to B<ftell>() and B<fseek>() (with I<whence> set to "
4415 "B<SEEK_SET>), setting and storing the current value of the file offset into "
4416 "or from the object referenced by I<pos>. On some non-UNIX systems, an "
4417 "I<fpos_t> object may be a complex object and these routines may be the only "
4418 "way to portably reposition a text stream."
4420 "B<fgetpos>() 関数と B<fsetpos>() 関数は、それぞれ B<ftell>() と "
4421 "B<fseek>() で I<whence> に B<SEEK_SET> を指定した場合と同様の機能を、異なる"
4422 "インターフェースで提供する。 B<fgetpos>() はファイルオフセットの現在の値を "
4423 "I<pos> が参照するオブジェクトに保存し、 B<fsetpos>() はファイルオフセットを "
4424 "I<pos> に設定する。 UNIX 以外のシステムにおいては、 I<fpos_t> が構造体などの"
4425 "複雑なオブジェクトになっていて、これらのルーチンがテキス トストリームでファイ"
4426 "ル位置を変更する方法のうち、移植性のある唯一のもの になっている場合もある。"
4429 #: build/C/man3/fseek.3:136
4431 "The B<rewind>() function returns no value. Upon successful completion, "
4432 "B<fgetpos>(), B<fseek>(), B<fsetpos>() return 0, and B<ftell>() returns "
4433 "the current offset. Otherwise, -1 is returned and I<errno> is set to "
4434 "indicate the error."
4436 "B<rewind>() は返り値を持たない。 B<fgetpos>(), B<fseek>(), B<fsetpos>() は"
4437 "成功すると 0 を返す。 B<ftell>() は現在のオフセットを返す。失敗した場合は返"
4438 "り値は -1 となり、 I<errno> にエラーを示す値がセットされる。"
4441 #: build/C/man3/fseek.3:142
4442 msgid "The I<stream> specified is not a seekable stream."
4443 msgstr "指定した I<stream> がシークできない。"
4446 #: build/C/man3/fseek.3:154
4448 "The I<whence> argument to B<fseek>() was not B<SEEK_SET>, B<SEEK_END>, or "
4449 "B<SEEK_CUR>. Or: the resulting file offset would be negative."
4451 "B<fseek>() 関数に対して与えた I<whence> 引数が B<SEEK_SET>, B<SEEK_END>, "
4452 "B<SEEK_CUR> 以外の値であった。 または、更新後のファイルオフセットが負になって"
4456 #: build/C/man3/fseek.3:169
4458 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>() may "
4459 "also fail and set I<errno> for any of the errors specified for the routines "
4460 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
4462 "B<fgetpos>(), B<fseek>(), B<fsetpos>(), B<ftell>() は、それぞれ "
4463 "B<fflush>(3), B<fstat>(2), B<lseek>(2), B<malloc>(3) などのルーチンを呼び出"
4464 "す際に失敗する可能性がある。この場合は それぞれ対応した I<errno> が設定され"
4468 #: build/C/man3/fseek.3:174
4469 msgid "B<lseek>(2), B<fseeko>(3)"
4470 msgstr "B<lseek>(2), B<fseeko>(3)"
4473 #: build/C/man3/fseeko.3:25
4479 #: build/C/man3/fseeko.3:25
4485 #: build/C/man3/fseeko.3:28
4486 msgid "fseeko, ftello - seek to or report file position"
4487 msgstr "fseeko, ftello - ファイル位置を探す/報告する"
4490 #: build/C/man3/fseeko.3:33
4492 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4493 msgstr "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4496 #: build/C/man3/fseeko.3:36
4499 "B<off_t ftello(FILE *>I<stream>B<);>\n"
4502 "B<off_t ftello(FILE *>I<stream>B<);>\n"
4506 #: build/C/man3/fseeko.3:45
4507 msgid "B<fseeko>(), B<ftello>():"
4508 msgstr "B<fseeko>(), B<ftello>():"
4511 #: build/C/man3/fseeko.3:50
4513 "_FILE_OFFSET_BITS\\ ==\\ 64 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || "
4514 "_XOPEN_SOURCE\\ E<gt>=\\ 600"
4516 "_FILE_OFFSET_BITS\\ ==\\ 64 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || "
4517 "_XOPEN_SOURCE\\ E<gt>=\\ 600"
4520 #: build/C/man3/fseeko.3:52
4521 msgid "(defining the obsolete _LARGEFILE_SOURCE macro also works)"
4522 msgstr "(廃止予定のマクロ _LARGEFILE_SOURCE を指定しても動作する)"
4525 #: build/C/man3/fseeko.3:75
4527 "The B<fseeko>() and B<ftello>() functions are identical to B<fseek>(3) "
4528 "and B<ftell>(3) (see B<fseek>(3)), respectively, except that the I<offset> "
4529 "argument of B<fseeko>() and the return value of B<ftello>() is of type "
4530 "I<off_t> instead of I<long>."
4532 "B<fseeko>() 関数および B<ftello>() 関数は、 それぞれ B<fseek>(3) および "
4533 "B<ftell>(3) と同一の機能を持つ (B<fseek>(3) を見よ) が、ただし "
4534 "B<fseeko>() 関数の I<offset> 引数と B<ftello>() の返り値が、 I<long> ではな"
4535 "く I<off_t> になっている。"
4538 #: build/C/man3/fseeko.3:82
4540 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
4543 "多くのアーキテクチャでは I<off_t> も I<long> も共に 32 ビットの型であるが、"
4546 #: build/C/man3/fseeko.3:86 build/C/man3/lseek64.3:81
4548 msgid "#define _FILE_OFFSET_BITS 64\n"
4549 msgstr "#define _FILE_OFFSET_BITS 64\n"
4552 #: build/C/man3/fseeko.3:92
4553 msgid "will turn I<off_t> into a 64-bit type."
4554 msgstr "でコンパイルすると I<off_t> は 64 ビット型となる。"
4557 #: build/C/man3/fseeko.3:101
4559 "On successful completion, B<fseeko>() returns 0, while B<ftello>() returns "
4560 "the current offset. Otherwise, -1 is returned and I<errno> is set to "
4561 "indicate the error."
4563 "成功した場合、 B<fseeko>() は 0 を、 B<ftello>() は現在のオフセットを返"
4564 "す。 失敗した場合、-1 を返し、 I<errno> にエラーを示す値をセットする。"
4567 #: build/C/man3/fseeko.3:104
4568 msgid "See the ERRORS in B<fseek>(3)."
4569 msgstr "B<fseek>(3) の「エラー」の節を参照。"
4572 #: build/C/man3/fseeko.3:106
4573 msgid "SUSv2, POSIX.1-2001."
4574 msgstr "SUSv2, POSIX.1-2001."
4577 #: build/C/man3/fseeko.3:110
4579 "These functions are found on System V-like systems. They are not present in "
4580 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
4582 "これらの関数は System V 的なシステムにある。 libc4, libc5, glibc 2.0 にはな"
4583 "かったが、 glibc 2.1 から使えるようになった。"
4586 #: build/C/man3/fseeko.3:112
4588 msgstr "B<fseek>(3)"
4591 #: build/C/man3/getline.3:26
4597 #: build/C/man3/getline.3:29
4598 msgid "getline, getdelim - delimited string input"
4599 msgstr "getline, getdelim - 区切り文字までの文字列入力を読み込む"
4602 #: build/C/man3/getline.3:34
4604 msgid "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE *>I<stream>B<);>\n"
4605 msgstr "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE *>I<stream>B<);>\n"
4608 #: build/C/man3/getline.3:37
4610 msgid "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, FILE *>I<stream>B<);>\n"
4611 msgstr "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, FILE *>I<stream>B<);>\n"
4614 #: build/C/man3/getline.3:47
4615 msgid "B<getline>(), B<getdelim>():"
4616 msgstr "B<getline>(), B<getdelim>():"
4619 #: build/C/man3/getline.3:52
4620 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
4621 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
4624 #: build/C/man3/getline.3:65
4626 "B<getline>() reads an entire line from I<stream>, storing the address of "
4627 "the buffer containing the text into I<*lineptr>. The buffer is null-"
4628 "terminated and includes the newline character, if one was found."
4630 "B<getline>() は I<stream> から 1 行全てを読み込み、テキストが含まれている"
4631 "バッファのアドレスを I<*lineptr> に格納する。 バッファはヌル文字 (\\e0) で終"
4632 "端される。 改行文字が見つかった場合は、改行文字もバッファに格納される。"
4635 #: build/C/man3/getline.3:77
4637 "If I<*lineptr> is set to NULL and I<*n> is set 0 before the call, then "
4638 "B<getline>() will allocate a buffer for storing the line. This buffer "
4639 "should be freed by the user program even if B<getline>() failed."
4641 "I<*lineptr> が NULL にセットされ、 I<*n> が呼び出し前に 0 にセットされた場"
4642 "合、 B<getline>() は行の内容を格納するためのバッファを確保する。 このバッ"
4643 "ファは、 B<getline>() が失敗した場合であっても、ユーザーのプログラムで解放す"
4647 #: build/C/man3/getline.3:95
4649 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
4650 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size. If the "
4651 "buffer is not large enough to hold the line, B<getline>() resizes it with "
4652 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
4654 "別の方法として、 B<getline>() を呼び出す際に、 I<*lineptr> に B<malloc>(3) "
4655 "で確保した大きさ I<*n> バイトのバッファへのポインタを入れて渡すこともでき"
4656 "る。 読み込んだ行を保持するのに十分なバッファがない場合、 B<getline>() は "
4657 "B<realloc>(3) を使ってバッファのサイズを変更し、必要に応じて I<*lineptr> と "
4661 #: build/C/man3/getline.3:101
4663 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
4664 "to reflect the buffer address and allocated size respectively."
4666 "どちらの場合でも、呼び出しに成功したときには、 I<*lineptr> と I<*n> がバッ"
4667 "ファのアドレスと割り当てたサイズを反映した値に更新される。"
4670 #: build/C/man3/getline.3:112
4672 "B<getdelim>() works like B<getline>(), except that a line delimiter other "
4673 "than newline can be specified as the I<delimiter> argument. As with "
4674 "B<getline>(), a delimiter character is not added if one was not present in "
4675 "the input before end of file was reached."
4677 "B<getdelim>() は B<getline>() と同じように動作するが、改行文字以外の区切り"
4678 "文字を引き数 I<delim> に指定することができる。 B<getline>() と同様に、ファイ"
4679 "ル終端に達するまでに入力行に区切り文字が見付からない場合は、 区切り文字をバッ"
4683 #: build/C/man3/getline.3:121
4685 "On success, B<getline>() and B<getdelim>() return the number of characters "
4686 "read, including the delimiter character, but not including the terminating "
4687 "null byte (\\(aq\\e0\\(aq). This value can be used to handle embedded null "
4688 "bytes in the line read."
4690 "成功した場合、 B<getline>() と B<getdelim>() は読み込んだ文字数を返す。 文"
4691 "字数には区切り文字は含まれるが、終端に使うヌルバイト (\\(aq\\e0\\(aq) は含ま"
4692 "れない。 この値によって、読み込んだ行に含まれるヌルバイトを操作することができ"
4696 #: build/C/man3/getline.3:127
4698 "Both functions return -1 on failure to read a line (including end-of-file "
4699 "condition). In the event of an error, I<errno> is set to indicate the cause."
4701 "どちらの関数も、行の読み込みに失敗した場合には -1 を返す (ファイルの終端に達"
4702 "した場合にも -1 を返す)。 エラーが発生した場合には、 I<errno> にエラーの原因"
4706 #: build/C/man3/getline.3:137
4707 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
4709 "引き数が不正である (I<n> または I<lineptr> が NULL である。 もしくは "
4710 "I<stream> が有効でない)。"
4713 #: build/C/man3/getline.3:139
4714 msgid "These functions are available since libc 4.6.27."
4715 msgstr "これらの関数は libc 4.6.27 以降で利用可能である。"
4718 #: build/C/man3/getline.3:146
4720 "Both B<getline>() and B<getdelim>() were originally GNU extensions. They "
4721 "were standardized in POSIX.1-2008."
4723 "B<getline>() と B<getdelim>() は、どちらも元は GNU による拡張であったが、 "
4724 "POSIX.1-2008 で標準化された。"
4727 #: build/C/man3/getline.3:151
4730 "#define _GNU_SOURCE\n"
4731 "#include E<lt>stdio.hE<gt>\n"
4732 "#include E<lt>stdlib.hE<gt>\n"
4734 "#define _GNU_SOURCE\n"
4735 "#include E<lt>stdio.hE<gt>\n"
4736 "#include E<lt>stdlib.hE<gt>\n"
4739 #: build/C/man3/getline.3:159
4746 " char *line = NULL;\n"
4747 " size_t len = 0;\n"
4754 " char *line = NULL;\n"
4755 " size_t len = 0;\n"
4759 #: build/C/man3/getline.3:163
4762 " fp = fopen(\"/etc/motd\", \"r\");\n"
4763 " if (fp == NULL)\n"
4764 " exit(EXIT_FAILURE);\n"
4766 " fp = fopen(\"/etc/motd\", \"r\");\n"
4767 " if (fp == NULL)\n"
4768 " exit(EXIT_FAILURE);\n"
4771 #: build/C/man3/getline.3:168
4774 " while ((read = getline(&line, &len, fp)) != -1) {\n"
4775 " printf(\"Retrieved line of length %zu :\\en\", read);\n"
4776 " printf(\"%s\", line);\n"
4779 " while ((read = getline(&line, &len, fp)) != -1) {\n"
4780 " printf(\"Retrieved line of length %zu :\\en\", read);\n"
4781 " printf(\"%s\", line);\n"
4785 #: build/C/man3/getline.3:172
4789 " exit(EXIT_SUCCESS);\n"
4793 " exit(EXIT_SUCCESS);\n"
4797 #: build/C/man3/getline.3:179
4798 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<scanf>(3)"
4799 msgstr "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<scanf>(3)"
4802 #: build/C/man3/gets.3:29
4808 #: build/C/man3/gets.3:29
4814 #: build/C/man3/gets.3:32
4815 msgid "gets - get a string from standard input (DEPRECATED)"
4816 msgstr "gets - 標準入力からの文字列を取得する (非推奨)"
4819 #: build/C/man3/gets.3:37
4821 msgid "B<char *gets(char *>I<s>B<);>\n"
4822 msgstr "B<char *gets(char *>I<s>B<);>\n"
4825 #: build/C/man3/gets.3:40
4826 msgid "I<Never use this function>."
4827 msgstr "I<この関数は使用しないこと>。"
4830 #: build/C/man3/gets.3:50
4832 "B<gets>() reads a line from I<stdin> into the buffer pointed to by I<s> "
4833 "until either a terminating newline or B<EOF>, which it replaces with a null "
4834 "byte (\\(aq\\e0\\(aq). No check for buffer overrun is performed (see BUGS "
4837 "B<gets>() は、改行文字か B<EOF> までの 1行を I<stdin> から読み込み I<s> が指"
4838 "すバッファに格納する (末尾の改行文字や B<EOF> はヌルバイト (\\(aq\\e0\\(aq) "
4839 "に置き換えられる)。 バッファオーバーランのチェックは行われない (下記の「バ"
4843 #: build/C/man3/gets.3:58
4845 "B<gets>() returns I<s> on success, and NULL on error or when end of file "
4846 "occurs while no characters have been read. However, given the lack of "
4847 "buffer overrun checking, there can be no guarantees that the function will "
4850 "B<gets>() は、成功すると I<s> を返し、エラーや 1 文字も読み込んでいないのに"
4851 "ファイルの終わりになった 場合に NULL を返す。 しかし、バッファの行き過ぎの"
4852 "チェックが行われないため、この関数が返るという保証はない。"
4855 #: build/C/man3/gets.3:72
4857 "LSB deprecates B<gets>(). POSIX.1-2008 marks B<gets>() obsolescent. ISO "
4858 "C11 removes the specification of B<gets>() from the C language, and since "
4859 "version 2.16, glibc header files don't expose the function declaration if "
4860 "the B<_ISOC11_SOURCE> feature test macro is defined."
4862 "LSB は B<gets>() を非推奨としている。\n"
4863 "POSIX.1-2008 では B<gets>() に廃止予定の印が付けられている。\n"
4864 "ISO C11 では B<gets>)() の規定が C 言語から削除されている。\n"
4865 "glibc バージョン 2.16 以降では、機能検査マクロ B<_ISOC11_SOURCE> が定義され"
4867 "場合、glibc ヘッダファイルでは B<gets>)() の宣言が公開されない。"
4870 #: build/C/man3/gets.3:86
4872 "Never use B<gets>(). Because it is impossible to tell without knowing the "
4873 "data in advance how many characters B<gets>() will read, and because "
4874 "B<gets>() will continue to store characters past the end of the buffer, it "
4875 "is extremely dangerous to use. It has been used to break computer "
4876 "security. Use B<fgets>() instead."
4878 "B<gets>() は絶対に使用してはならない。 前もってデータを知ることなしに "
4879 "B<gets>() が何文字読むかを知ることはできず、 B<gets>() がバッファの終わりを"
4880 "越えて書き込み続けるため、 B<gets>() を使うのは極めて危険である。 これを利用"
4881 "してコンピュータのセキュリティが破られてきた。 代わりに B<fgets>() を使うこ"
4885 #: build/C/man3/gets.3:90
4887 "For more information, see CWE-242 (aka \"Use of Inherently Dangerous Function"
4888 "\") at http://cwe.mitre.org/data/definitions/242.html"
4890 "詳しい情報については、CWE-242 (別名 \"Use of Inherently Dangerous Function"
4891 "\" (「本質的に危険な関数を使う」)) を参照。 http://cwe.mitre.org/data/"
4892 "definitions/242.html で参照できる。"
4895 #: build/C/man3/gets.3:108
4897 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetc>(3), B<fgets>(3), "
4898 "B<fgetwc>(3), B<fgetws>(3), B<fopen>(3), B<fread>(3), B<fseek>(3), "
4899 "B<getline>(3), B<getwchar>(3), B<puts>(3), B<scanf>(3), B<ungetwc>(3), "
4900 "B<unlocked_stdio>(3), B<feature_test_macros>(7)"
4902 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetc>(3), B<fgets>(3), "
4903 "B<fgetwc>(3), B<fgetws>(3), B<fopen>(3), B<fread>(3), B<fseek>(3), "
4904 "B<getline>(3), B<getwchar>(3), B<puts>(3), B<scanf>(3), B<ungetwc>(3), "
4905 "B<unlocked_stdio>(3), B<feature_test_macros>(7)"
4908 #: build/C/man3/getw.3:25
4914 #: build/C/man3/getw.3:25
4920 #: build/C/man3/getw.3:28
4921 msgid "getw, putw - input and output of words (ints)"
4922 msgstr "getw, putw - ワード(int)の入出力"
4925 #: build/C/man3/getw.3:33
4927 msgid "B<int getw(FILE *>I<stream>B<);>\n"
4928 msgstr "B<int getw(FILE *>I<stream>B<);>\n"
4931 #: build/C/man3/getw.3:35
4933 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
4934 msgstr "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
4937 #: build/C/man3/getw.3:44
4938 msgid "B<getw>(), B<putw>():"
4939 msgstr "B<getw>(), B<putw>():"
4942 #: build/C/man3/getw.3:47
4944 msgid "Since glibc 2.3.3:"
4945 msgstr "glibc 2.3.3 以降:"
4948 #: build/C/man3/getw.3:50
4949 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
4950 msgstr "_SVID_SOURCE || _BSD_SOURCE ||"
4953 #: build/C/man3/getw.3:53
4956 "(_XOPEN_SOURCE &&\n"
4957 " !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
4959 "(_XOPEN_SOURCE &&\n"
4960 " !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
4963 #: build/C/man3/getw.3:53
4965 msgid "Before glibc 2.3.3:"
4966 msgstr "glibc 2.3.3 より前:"
4969 #: build/C/man3/getw.3:56
4970 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
4971 msgstr "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
4974 #: build/C/man3/getw.3:66
4976 "B<getw>() reads a word (that is, an I<int>) from I<stream>. It's provided "
4977 "for compatibility with SVr4. We recommend you use B<fread>(3) instead."
4979 "B<getw>() は I<stream> からワード (I<int>型) を読み込む。 この関数は、SVr4 "
4980 "との互換性のために提供されている。 この関数の代わりに B<fread>(3) を使用する"
4984 #: build/C/man3/getw.3:73
4986 "B<putw>() writes the word I<w> (that is, an I<int>) to I<stream>. It is "
4987 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3) "
4990 "B<putw>() は I<stream> にワード I<w> (I<int>型) を書き込む。 この関数は "
4991 "SVr4 との互換性のために提供されているが、この関数の代わりに B<fwrite>(3) を"
4995 #: build/C/man3/getw.3:80
4997 "Normally, B<getw>() returns the word read, and B<putw>() returns 0. On "
4998 "error, they return B<EOF>."
5000 "通常、 B<getw>() は読み込んだワードを返し、 B<putw>() は 0 を返す。 エラー"
5001 "が発生した場合、これらの関数は B<EOF> を返す。"
5004 #: build/C/man3/getw.3:83
5005 msgid "SVr4, SUSv2. Not present in POSIX.1-2001."
5006 msgstr "SVr4, SUSv2. POSIX.1-2001 には存在しない。"
5009 #: build/C/man3/getw.3:87
5011 "The value returned on error is also a legitimate data value. B<ferror>(3) "
5012 "can be used to distinguish between the two cases."
5014 "エラーの時に返される値は、正しいデータとして返されることもある。 "
5015 "B<ferror>(3) を用いると、この二つの場合を区別することが出来る。"
5018 #: build/C/man3/getw.3:93
5019 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
5020 msgstr "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
5023 #: build/C/man2/link.2:32
5029 #: build/C/man2/link.2:32 build/C/man2/open.2:51 build/C/man2/readlink.2:44
5035 #: build/C/man2/link.2:35
5036 msgid "link, linkat - make a new name for a file"
5037 msgstr "link, linkat - ファイルの新しい名前を作成する"
5040 #: build/C/man2/link.2:38 build/C/man2/pipe.2:42 build/C/man2/read.2:41
5041 #: build/C/man2/readlink.2:50 build/C/man2/symlink.2:39
5042 #: build/C/man2/unlink.2:39
5044 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5045 msgstr "B<#include E<lt>unistd.hE<gt>>\n"
5048 #: build/C/man2/link.2:40
5050 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>\n"
5051 msgstr "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>\n"
5054 #: build/C/man2/link.2:43 build/C/man2/readlink.2:56 build/C/man2/symlink.2:44
5055 #: build/C/man2/unlink.2:44
5058 "B<#include E<lt>fcntl.hE<gt> >/* Definition of AT_* constants */\n"
5059 "B<#include E<lt>unistd.hE<gt>>\n"
5061 "B<#include E<lt>fcntl.hE<gt> >/* AT_* 定数の定義 */\n"
5062 "B<#include E<lt>unistd.hE<gt>>\n"
5065 #: build/C/man2/link.2:46
5068 "B<int linkat(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
5069 "B< int >I<newdirfd>B<, const char *>I<newpath>B<, int >I<flags>B<);>\n"
5071 "B<int linkat(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
5072 "B< int >I<newdirfd>B<, const char *>I<newpath>B<, int >I<flags>B<);>\n"
5075 #: build/C/man2/link.2:54
5076 msgid "B<linkat>():"
5077 msgstr "B<linkat>():"
5080 #: build/C/man2/link.2:63 build/C/man2/open.2:85 build/C/man2/readlink.2:83
5081 #: build/C/man2/rename.2:69 build/C/man2/symlink.2:71 build/C/man2/unlink.2:63
5082 msgid "_ATFILE_SOURCE"
5083 msgstr "_ATFILE_SOURCE"
5086 #: build/C/man2/link.2:69
5088 "B<link>() creates a new link (also known as a hard link) to an existing "
5091 "B<link>() は存在するファイルへの新しいリンク (link) (ハードリンク (hard "
5092 "link) ともいう) を作成する。"
5095 #: build/C/man2/link.2:75
5096 msgid "If I<newpath> exists, it will I<not> be overwritten."
5097 msgstr "I<newpath> が存在する場合には、上書きはI<されない>。"
5100 #: build/C/man2/link.2:80
5102 "This new name may be used exactly as the old one for any operation; both "
5103 "names refer to the same file (and so have the same permissions and "
5104 "ownership) and it is impossible to tell which name was the \"original\"."
5106 "この新しい名前は全ての操作において古い名前と完全に同じように使用される; 両方"
5107 "の名前は同じファイルを参照しており (それで同じ許可 (permission) や所有者 "
5108 "(ownership) となるので)、 どちらの名前が本来のものであるか判別できない。"
5111 #: build/C/man2/link.2:80
5117 #: build/C/man2/link.2:86
5119 "The B<linkat>() system call operates in exactly the same way as B<link>(), "
5120 "except for the differences described here."
5122 "B<linkat>() システムコールは B<link>() と全く同様に動作するが、以下で説明する"
5126 #: build/C/man2/link.2:96
5128 "If the pathname given in I<oldpath> is relative, then it is interpreted "
5129 "relative to the directory referred to by the file descriptor I<olddirfd> "
5130 "(rather than relative to the current working directory of the calling "
5131 "process, as is done by B<link>() for a relative pathname)."
5133 "I<oldpath> で指定されたパス名が相対パスの場合、このパス名はファイルディスクリ"
5134 "プター I<olddirfd> が参照するディレクトリに対する相対パスと解釈される "
5135 "(B<link>(2) に相対パス名を渡した場合のように、呼び出したプロセスのカレント"
5136 "ワーキングディレクトリに対する相対パスではない)。"
5139 #: build/C/man2/link.2:108
5141 "If I<oldpath> is relative and I<olddirfd> is the special value B<AT_FDCWD>, "
5142 "then I<oldpath> is interpreted relative to the current working directory of "
5143 "the calling process (like B<link>())."
5145 "I<oldpath> で指定されたパス名が相対パスで、 I<olddirfd> が特別な値 "
5146 "B<AT_FDCWD> の場合、 (B<link>(2) と同様に) I<oldpath> は呼び出したプロセスの"
5147 "カレントワーキングディレクトリに対する相対パスと解釈される。"
5150 #: build/C/man2/link.2:114 build/C/man2/rename.2:158
5151 msgid "If I<oldpath> is absolute, then I<olddirfd> is ignored."
5153 "I<oldpath> で指定されたパス名が絶対パスの場合、 I<olddirfd> は無視される。"
5156 #: build/C/man2/link.2:122 build/C/man2/rename.2:166
5158 "The interpretation of I<newpath> is as for I<oldpath>, except that a "
5159 "relative pathname is interpreted relative to the directory referred to by "
5160 "the file descriptor I<newdirfd>."
5162 "I<newpath> の解釈は I<oldpath> と同じである。 相対パスのパス名がファイルディ"
5163 "スクリプター I<newdirfd> が参照するディレクトリと解釈される点だけが異なる。"
5166 #: build/C/man2/link.2:125
5167 msgid "The following values can be bitwise ORed in I<flags>:"
5168 msgstr "以下の値のビット単位の論理和を I<flags> に指定できる。"
5171 #: build/C/man2/link.2:125
5173 msgid "B<AT_EMPTY_PATH> (since Linux 2.6.39)"
5174 msgstr "B<AT_EMPTY_PATH> (Linux 2.6.39 以降)"
5176 #. commit 11a7b371b64ef39fc5fb1b6f2218eef7c4d035e3
5177 #. Before glibc 2.16, defining _ATFILE_SOURCE sufficed
5179 #: build/C/man2/link.2:152
5182 #| "If I<oldpath> is an empty string, create a link to the file referenced by "
5183 #| "I<olddirfd> (which may have been obtained using the B<open>(2) B<O_PATH> "
5184 #| "flag). In this case, I<olddirfd> must refer to a file other than a "
5185 #| "directory. The caller must have the B<CAP_DAC_READ_SEARCH> capability in "
5186 #| "order to use this flag; this prevents arbitrary users from creating hard "
5187 #| "links using file descriptors received via a UNIX domain socket (see the "
5188 #| "discussion of B<SCM_RIGHTS> in B<unix>(7)). This flag is Linux-specific; "
5189 #| "define B<_GNU_SOURCE> to obtain its definition."
5191 "If I<oldpath> is an empty string, create a link to the file referenced by "
5192 "I<olddirfd> (which may have been obtained using the B<open>(2) B<O_PATH> "
5193 "flag). In this case, I<olddirfd> can refer to any type of file, not just a "
5194 "directory. This will generally not work if the file has a link count of "
5195 "zero (files created with B<O_TMPFILE> and without B<O_EXCL> are an "
5196 "exception). The caller must have the B<CAP_DAC_READ_SEARCH> capability in "
5197 "order to use this flag. This flag is Linux-specific; define B<_GNU_SOURCE> "
5198 "to obtain its definition."
5200 "I<oldpath> が空文字列の場合、 I<olddirfd> が参照するファイルへのリンクを作成"
5201 "する (I<olddirfd> は B<open>(2) の B<O_PATH> フラグを使って取得する)。 この場"
5202 "合、 I<olddirfd> はディレクトリではなくファイルを参照していなければならな"
5203 "い。 このフラグを使用するためには、 呼び出し元は B<CAP_DAC_READ_SEARCH> ケー"
5204 "パビリティを持っていなければならない。 これにより、 任意のユーザーが UNIX ド"
5205 "メインソケット経由で受信したファイルディスクリプターを使ってハードリンクを作"
5206 "成することがないようになっている (B<unix>(7) の B<SCM_RIGHTS> の議論を参"
5207 "照)。 このフラグは Linux 固有で、 この定義を得るには B<_GNU_SOURCE> を定義す"
5211 #: build/C/man2/link.2:152
5213 msgid "B<AT_SYMLINK_FOLLOW> (since Linux 2.6.18)"
5214 msgstr "B<AT_SYMLINK_FOLLOW> (Linux 2.6.18 以降)"
5217 #: build/C/man2/link.2:171
5220 #| "By default, B<linkat>(), does not dereference I<oldpath> if it is a "
5221 #| "symbolic link (like B<link>()). The flag B<AT_SYMLINK_FOLLOW> can be "
5222 #| "specified in I<flags> to cause I<oldpath> to be dereferenced if it is a "
5225 "By default, B<linkat>(), does not dereference I<oldpath> if it is a symbolic "
5226 "link (like B<link>()). The flag B<AT_SYMLINK_FOLLOW> can be specified in "
5227 "I<flags> to cause I<oldpath> to be dereferenced if it is a symbolic link. "
5228 "If procfs is mounted, this can be used as an alternative to "
5229 "B<AT_EMPTY_PATH>, like this:"
5231 "B<linkat>() は (B<link>() 同様) デフォルトでは I<oldpath> がシンボリックリン"
5232 "クの場合リンクの展開を行わない。 フラグ B<AT_SYMLINK_FOLLOW> を I<flags> に指"
5233 "定することができ、指定した場合 I<oldpath> がシンボリックリンクの場合リンクの"
5237 #: build/C/man2/link.2:176
5240 "linkat(AT_FDCWD, \"/proc/self/fd/E<lt>fdE<gt>\", newdirfd,\n"
5241 " newname, AT_SYMLINK_FOLLOW);\n"
5243 "linkat(AT_FDCWD, \"/proc/self/fd/E<lt>fdE<gt>\", newdirfd,\n"
5244 " newname, AT_SYMLINK_FOLLOW);\n"
5247 #: build/C/man2/link.2:182
5249 "Before kernel 2.6.18, the I<flags> argument was unused, and had to be "
5252 "カーネル 2.6.18 より前では、 I<flags> 引き数は未使用で、 0 を指定しなければな"
5256 #: build/C/man2/link.2:187
5257 msgid "See B<openat>(2) for an explanation of the need for B<linkat>()."
5258 msgstr "B<linkat>() の必要性についての説明については B<openat>(2) を参照。"
5261 #: build/C/man2/link.2:192 build/C/man2/pipe.2:134 build/C/man3/remove.3:65
5262 #: build/C/man2/rename.2:208 build/C/man2/rmdir.2:45
5263 #: build/C/man2/symlink.2:145 build/C/man2/unlink.2:158
5265 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
5268 "成功した場合は 0 が返される。エラーの場合は -1 が返され、 I<errno> が適切に設"
5272 #: build/C/man2/link.2:193 build/C/man2/open.2:796 build/C/man2/readlink.2:160
5273 #: build/C/man2/rename.2:209 build/C/man2/rmdir.2:46
5274 #: build/C/man2/symlink.2:146 build/C/man3/tmpfile.3:57
5275 #: build/C/man2/unlink.2:159
5281 #: build/C/man2/link.2:204
5283 "Write access to the directory containing I<newpath> is denied, or search "
5284 "permission is denied for one of the directories in the path prefix of "
5285 "I<oldpath> or I<newpath>. (See also B<path_resolution>(7).)"
5287 "I<newpath> を含んでいるディレクトリへの書き込みが許されていないか、 "
5288 "I<oldpath> または I<newpath> へのディレクトリのどれかに検索許可がない "
5289 "(B<path_resolution>(7) を参照)。"
5292 #: build/C/man2/link.2:204 build/C/man2/open.2:805 build/C/man2/rename.2:245
5293 #: build/C/man2/symlink.2:155 build/C/man2/write.2:135
5299 #: build/C/man2/link.2:207 build/C/man2/rename.2:248
5300 msgid "The user's quota of disk blocks on the filesystem has been exhausted."
5302 "ディスクブロックか inode がそのファイルシステムのユーザクォータに達していた。"
5305 #: build/C/man2/link.2:207 build/C/man2/open.2:811 build/C/man2/rename.2:368
5306 #: build/C/man2/symlink.2:160 build/C/man3/tmpfile.3:60
5312 #: build/C/man2/link.2:211
5313 msgid "I<newpath> already exists."
5314 msgstr "I<newpath> が既に存在する。"
5317 #: build/C/man2/link.2:211 build/C/man2/llseek.2:74 build/C/man2/open.2:817
5318 #: build/C/man2/open_by_handle_at.2:266 build/C/man2/open_by_handle_at.2:321
5319 #: build/C/man2/pipe.2:135 build/C/man2/read.2:118 build/C/man2/readlink.2:165
5320 #: build/C/man2/rename.2:248 build/C/man2/rmdir.2:64
5321 #: build/C/man2/symlink.2:164 build/C/man2/unlink.2:178
5322 #: build/C/man2/write.2:141
5328 #: build/C/man2/link.2:214 build/C/man2/rename.2:251
5329 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
5331 "I<oldpath> や I<newpath> がアクセス可能なアドレス空間の外を指している。"
5334 #: build/C/man2/link.2:214 build/C/man2/read.2:147 build/C/man2/readlink.2:181
5335 #: build/C/man2/symlink.2:167 build/C/man2/unlink.2:182
5336 #: build/C/man2/write.2:165
5342 #: build/C/man2/link.2:217 build/C/man2/symlink.2:170
5343 #: build/C/man2/unlink.2:185
5344 msgid "An I/O error occurred."
5345 msgstr "I/O エラーが発生した。"
5348 #: build/C/man2/link.2:217 build/C/man2/open.2:878 build/C/man2/open.2:882
5349 #: build/C/man2/open_by_handle_at.2:331 build/C/man2/readlink.2:184
5350 #: build/C/man2/rename.2:261 build/C/man2/rmdir.2:73
5351 #: build/C/man2/symlink.2:170 build/C/man2/unlink.2:190
5357 #: build/C/man2/link.2:221 build/C/man2/rename.2:265
5359 "Too many symbolic links were encountered in resolving I<oldpath> or "
5362 "I<oldpath> または I<newpath> を解決する際に遭遇したシンボリックリンクが多過ぎ"
5366 #: build/C/man2/link.2:221 build/C/man2/rename.2:265
5372 #: build/C/man2/link.2:226
5374 "The file referred to by I<oldpath> already has the maximum number of links "
5377 "I<oldpath> によって参照されるファイルは 既に最大数までのリンクを持っている。"
5380 #: build/C/man2/link.2:226 build/C/man2/open.2:894 build/C/man2/readlink.2:187
5381 #: build/C/man2/rename.2:272 build/C/man2/rmdir.2:77
5382 #: build/C/man2/symlink.2:174 build/C/man2/unlink.2:194
5384 msgid "B<ENAMETOOLONG>"
5385 msgstr "B<ENAMETOOLONG>"
5388 #: build/C/man2/link.2:229 build/C/man2/rename.2:275
5389 msgid "I<oldpath> or I<newpath> was too long."
5390 msgstr "I<oldpath> または I<newpath> が長過ぎる。"
5393 #: build/C/man2/link.2:229 build/C/man2/link.2:286 build/C/man2/link.2:294
5394 #: build/C/man2/link.2:304 build/C/man2/open.2:908 build/C/man2/open.2:915
5395 #: build/C/man2/open_by_handle_at.2:282 build/C/man2/readlink.2:190
5396 #: build/C/man2/rename.2:275 build/C/man2/rename.2:389 build/C/man2/rmdir.2:80
5397 #: build/C/man2/symlink.2:177 build/C/man2/symlink.2:212
5398 #: build/C/man2/unlink.2:197
5404 #: build/C/man2/link.2:234
5406 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
5407 "dangling symbolic link."
5409 "I<oldpath> または I<newpath> のディレクトリ部分が存在しないか、 壊れた"
5410 "(dangling)シンボリックリンクである。"
5413 #: build/C/man2/link.2:234 build/C/man2/open.2:929 build/C/man2/readlink.2:193
5414 #: build/C/man2/rename.2:288 build/C/man2/rmdir.2:85 build/C/man3/scanf.3:570
5415 #: build/C/man2/symlink.2:184 build/C/man3/tempnam.3:102
5416 #: build/C/man2/unlink.2:204
5422 #: build/C/man2/link.2:237 build/C/man2/open.2:932 build/C/man2/readlink.2:196
5423 #: build/C/man2/rename.2:291 build/C/man2/rmdir.2:88
5424 #: build/C/man2/symlink.2:187 build/C/man2/unlink.2:207
5425 msgid "Insufficient kernel memory was available."
5426 msgstr "十分なカーネルメモリーがない。"
5429 #: build/C/man2/link.2:237 build/C/man2/open.2:932 build/C/man2/rename.2:291
5430 #: build/C/man2/symlink.2:187 build/C/man3/tmpfile.3:72
5431 #: build/C/man2/write.2:168
5437 #: build/C/man2/link.2:241 build/C/man2/rename.2:295
5438 #: build/C/man2/symlink.2:191
5439 msgid "The device containing the file has no room for the new directory entry."
5441 "そのファイルを含んでいるデバイスに新しいディレクトリエントリを 作成するための"
5445 #: build/C/man2/link.2:241 build/C/man2/link.2:315 build/C/man2/open.2:938
5446 #: build/C/man2/open.2:1009 build/C/man2/open_by_handle_at.2:289
5447 #: build/C/man2/readlink.2:196 build/C/man2/readlink.2:206
5448 #: build/C/man2/rename.2:295 build/C/man2/rename.2:355 build/C/man2/rmdir.2:88
5449 #: build/C/man2/symlink.2:191 build/C/man2/symlink.2:218
5450 #: build/C/man2/unlink.2:207 build/C/man2/unlink.2:263
5456 #: build/C/man2/link.2:246
5458 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
5461 "I<oldpath> または I<newpath> のディレクトリ部分が、実際には、ディレクトリでな"
5465 #: build/C/man2/link.2:246 build/C/man2/link.2:250 build/C/man2/link.2:325
5466 #: build/C/man2/open.2:977 build/C/man2/open_by_handle_at.2:338
5467 #: build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118
5468 #: build/C/man2/symlink.2:196 build/C/man2/unlink.2:212
5474 #: build/C/man2/link.2:250
5475 msgid "I<oldpath> is a directory."
5476 msgstr "I<oldpath> がディレクトリである。"
5479 #: build/C/man2/link.2:255
5481 "The filesystem containing I<oldpath> and I<newpath> does not support the "
5482 "creation of hard links."
5484 "I<oldpath> と I<newpath> を含んでいるファイルシステムがハードリンクをサポート"
5488 #: build/C/man2/link.2:255
5490 msgid "B<EPERM> (since Linux 3.6)"
5491 msgstr "B<EPERM> (Linux 3.6 以降)"
5494 #: build/C/man2/link.2:262
5496 "The caller does not have permission to create a hard link to this file (see "
5497 "the description of I</proc/sys/fs/protected_hardlinks> in B<proc>(5))."
5499 "呼び出し元にこのファイルへのハードリンクを作成する許可がなかった (B<proc>(5) "
5500 "の I</proc/sys/fs/protected_hardlinks> の説明を参照)。"
5503 #: build/C/man2/link.2:262 build/C/man2/open.2:985 build/C/man2/rename.2:333
5504 #: build/C/man2/rmdir.2:123 build/C/man2/symlink.2:201
5505 #: build/C/man3/tmpfile.3:75 build/C/man2/unlink.2:235
5511 #: build/C/man2/link.2:265 build/C/man2/rename.2:336
5512 msgid "The file is on a read-only filesystem."
5513 msgstr "ファイルが読み込み専用のファイルシステムに存在する。"
5516 #: build/C/man2/link.2:265 build/C/man2/rename.2:336
5522 #: build/C/man2/link.2:273
5524 "I<oldpath> and I<newpath> are not on the same mounted filesystem. (Linux "
5525 "permits a filesystem to be mounted at multiple points, but B<link>() does "
5526 "not work across different mount points, even if the same filesystem is "
5529 "I<oldpath> と I<newpath> が同じマウントされたファイルシステムに存在しない。 "
5530 "(Linux は 1 つのファイルシステムを複数のマウント位置に マウントすることを許可"
5531 "している。 しかし B<link>() は、たとえ同じファイルシステムであっても、 別々"
5532 "のマウント位置を跨いでは動作しない。)"
5535 #: build/C/man2/link.2:276
5536 msgid "The following additional errors can occur for B<linkat>():"
5537 msgstr "B<linkat>() では以下のエラーも発生する。"
5540 #: build/C/man2/link.2:282 build/C/man2/rename.2:355
5541 msgid "I<olddirfd> or I<newdirfd> is not a valid file descriptor."
5542 msgstr "I<olddirfd> か I<newdirfd> が有効なファイルディスクリプタでない。"
5545 #: build/C/man2/link.2:286 build/C/man2/unlink.2:256
5546 msgid "An invalid flag value was specified in I<flags>."
5547 msgstr "無効なフラグ値が I<flags> に指定された。"
5550 #: build/C/man2/link.2:294
5552 "B<AT_EMPTY_PATH> was specified in I<flags>, but the caller did not have the "
5553 "B<CAP_DAC_READ_SEARCH> capability."
5555 "B<AT_EMPTY_PATH> が I<flags> に指定されたが、呼び出し元が "
5556 "B<CAP_DAC_READ_SEARCH> ケーパビリティを持っていなかった。"
5559 #: build/C/man2/link.2:299
5561 "An attempt was made to link to the I</proc/self/fd/NN> file corresponding to "
5562 "a file descriptor created with"
5564 "以下の呼び出しで作成されたファイルディスクリプターに対応する I</proc/self/fd/"
5565 "NN> ファイルに対してリンクを行おおうとした。"
5568 #: build/C/man2/link.2:301
5570 msgid " open(path, O_TMPFILE | O_EXCL, mode);\n"
5571 msgstr " open(path, O_TMPFILE | O_EXCL, mode);\n"
5574 #: build/C/man2/link.2:304
5575 msgid "See B<open>(2)."
5576 msgstr "B<open>(2) 参照。"
5579 #: build/C/man2/link.2:315
5581 "I<oldpath> is a relative pathname and I<olddirfd> refers to a directory that "
5582 "has been deleted, or I<newpath> is a relative pathname and I<newdirfd> "
5583 "refers to a directory that has been deleted."
5587 #: build/C/man2/link.2:325 build/C/man2/rename.2:365
5589 "I<oldpath> is relative and I<olddirfd> is a file descriptor referring to a "
5590 "file other than a directory; or similar for I<newpath> and I<newdirfd>"
5592 "I<oldpath> が相対パスで、 I<olddirfd> がディレクトリ以外のファイルを参照して"
5593 "いる。または I<newpath> と I<newdirfd> に関して同じ状況である。"
5596 #: build/C/man2/link.2:334
5598 "B<AT_EMPTY_PATH> was specified in I<flags>, I<oldpath> is an empty string, "
5599 "and I<olddirfd> refers to a directory."
5601 "I<flags> に B<AT_EMPTY_PATH> が指定され、 I<oldpath> が空文字列で、 "
5602 "I<olddirfd> がディレクトリを参照している。"
5605 #: build/C/man2/link.2:338
5607 "B<linkat>() was added to Linux in kernel 2.6.16; library support was added "
5608 "to glibc in version 2.4."
5610 "B<linkat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサポー"
5611 "トはバージョン 2.4 で glibc に追加された。"
5613 #. SVr4 documents additional ENOLINK and
5614 #. EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
5615 #. X/OPEN does not document EFAULT, ENOMEM or EIO.
5617 #: build/C/man2/link.2:344
5618 msgid "B<link>(): SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES), POSIX.1-2008."
5620 "B<link>(): SVr4, 4.3BSD, POSIX.1-2001 (但し「注意」を参照), POSIX.1-2008."
5623 #: build/C/man2/link.2:347
5624 msgid "B<linkat>(): POSIX.1-2008."
5625 msgstr "B<linkat>(): POSIX.1-2008."
5628 #: build/C/man2/link.2:354
5630 "Hard links, as created by B<link>(), cannot span filesystems. Use "
5631 "B<symlink>(2) if this is required."
5633 "B<link>() でファイルシステムを超えてハードリンクを作成することはできない。 "
5634 "このような場合は B<symlink>(2) を使用すること。"
5636 #. more precisely: since kernel 1.3.56
5637 #. For example, the default Solaris compilation environment
5638 #. behaves like Linux, and contributors to a March 2005
5639 #. thread in the Austin mailing list reported that some
5640 #. other (System V) implementations did/do the same -- MTK, Apr 05
5642 #: build/C/man2/link.2:385
5644 "POSIX.1-2001 says that B<link>() should dereference I<oldpath> if it is a "
5645 "symbolic link. However, since kernel 2.0, Linux does not do so: if "
5646 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
5647 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
5648 "the same file that I<oldpath> refers to). Some other implementations behave "
5649 "in the same manner as Linux. POSIX.1-2008 changes the specification of "
5650 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
5651 "dereferenced if it is a symbolic link. For precise control over the "
5652 "treatment of symbolic links when creating a link, use B<linkat>(2)."
5654 "POSIX.1-2001 では、 I<oldpath> がシンボリックリンクである場合、 B<link>() "
5655 "は I<oldpath> の参照を解決すべきであると記述されている。 しかし、カーネル "
5656 "2.0 以降の Linux ではそのようになっていない。 I<oldpath> がシンボリックリンク"
5657 "である場合、 I<newpath> は同じシンボリックリンクファイルへの (ハード) リンク"
5658 "として作成される (つまり I<newpath> は I<oldpath> が参照していた同じファイル"
5659 "へのシンボリックリンクになる)。 他のいくつかの実装でも Linux と同じように動作"
5660 "する。 POSIX.1-2008 では B<link>() の仕様が変更され、 I<oldpath> がシンボ"
5661 "リックリンクの場合にシンボリックリンクの参照を 解決するかどうかは実装依存と"
5662 "なった。 リンク作成時のシンボリックリンクの扱いについての詳細な制御を行う場合"
5663 "には B<linkat>(2) を使用すること。"
5666 #: build/C/man2/link.2:391
5668 "On NFS filesystems, the return code may be wrong in case the NFS server "
5669 "performs the link creation and dies before it can say so. Use B<stat>(2) "
5670 "to find out if the link got created."
5672 "NFS ファイルシステムでは、NFS サーバーがリンクを作成した後に、 それを伝える前"
5673 "に死んだ場合には返り値が不正な場合がある。 リンクが作成できたかどうか見つける"
5674 "ためには B<stat>(2) を使用すること。"
5677 #: build/C/man2/link.2:400
5679 "B<ln>(1), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), B<unlink>(2), "
5680 "B<path_resolution>(7), B<symlink>(7)"
5682 "B<ln>(1), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), B<unlink>(2), "
5683 "B<path_resolution>(7), B<symlink>(7)"
5686 #: build/C/man2/llseek.2:28
5692 #: build/C/man2/llseek.2:28
5698 #: build/C/man2/llseek.2:31
5699 msgid "_llseek - reposition read/write file offset"
5700 msgstr "_llseek - ファイルの読み書きオフセットの位置を変える"
5703 #: build/C/man2/llseek.2:35
5706 "B<#include E<lt>sys/types.hE<gt>>\n"
5707 "B<#include E<lt>unistd.hE<gt>>\n"
5709 "B<#include E<lt>sys/types.hE<gt>>\n"
5710 "B<#include E<lt>unistd.hE<gt>>\n"
5713 #: build/C/man2/llseek.2:39
5716 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
5717 "B< unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
5718 "B< unsigned int >I<whence>B<);>\n"
5720 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
5721 "B< unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
5722 "B< unsigned int >I<whence>B<);>\n"
5725 #: build/C/man2/llseek.2:43
5726 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
5728 "I<注>: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節"
5732 #: build/C/man2/llseek.2:62
5734 "The B<_llseek>() function repositions the offset of the open file "
5735 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
5736 "offset_low> bytes relative to the beginning of the file, the current "
5737 "position in the file, or the end of the file, depending on whether I<whence> "
5738 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively. It returns the "
5739 "resulting file position in the argument I<result>."
5741 "B<_llseek>() 関数は、ファイルディスクリプタ (descriptor) I<fd> に関連づけら"
5742 "れたオープンされたファイルのオフセットの位置を、相対的に "
5743 "I<(offset_highE<lt>E<lt>32) | offset_low> バイトだけ変更する。 基準となる位置"
5744 "を表す I<whence> には B<SEEK_SET>, B<SEEK_CUR>, B<SEEK_END> のいずれかを指定"
5745 "し、それぞれ ファイルの先頭、ファイルの現在位置、 ファイルの最後を表す。 結果"
5746 "のファイル位置を I<result> 引き数に返す。"
5749 #: build/C/man2/llseek.2:69
5751 "Upon successful completion, B<_llseek>() returns 0. Otherwise, a value of "
5752 "-1 is returned and I<errno> is set to indicate the error."
5754 "成功した場合は、 B<_llseek>() は 0 を返す。 そうでなれば -1 という値が返り、"
5755 "エラーを示す I<errno> が設定される。"
5758 #: build/C/man2/llseek.2:74 build/C/man2/lseek.2:192
5759 msgid "I<fd> is not an open file descriptor."
5760 msgstr "I<fd> がオープンされたファイルディスクリプタでない。"
5763 #: build/C/man2/llseek.2:77
5764 msgid "Problem with copying results to user space."
5765 msgstr "結果をユーザ空間にコピーするときに問題があった。"
5768 #: build/C/man2/llseek.2:81
5769 msgid "I<whence> is invalid."
5770 msgstr "I<whence> が不正である。"
5773 #: build/C/man2/llseek.2:84
5775 "This function is Linux-specific, and should not be used in programs intended "
5778 "この関数は Linux 特有であり、移植性の必要なプログラムでは使用してはいけない。"
5781 #: build/C/man2/llseek.2:87
5783 "Glibc does not provide a wrapper for this system call; call it using "
5786 "glibc はこのシステムコールに対するラッパー関数を提供していない。 "
5787 "B<syscall>(2) を使って呼び出すこと。"
5790 #: build/C/man2/llseek.2:90
5791 msgid "B<lseek>(2), B<lseek64>(3)"
5792 msgstr "B<lseek>(2), B<lseek64>(3)"
5795 #: build/C/man2/lseek.2:47
5801 #: build/C/man2/lseek.2:47
5807 #: build/C/man2/lseek.2:50
5808 msgid "lseek - reposition read/write file offset"
5809 msgstr "lseek - ファイルの読み書きオフセットの位置を変える"
5812 #: build/C/man2/lseek.2:52 build/C/man3/lseek64.3:32
5813 msgid "B<#include E<lt>sys/types.hE<gt>>"
5814 msgstr "B<#include E<lt>sys/types.hE<gt>>"
5817 #: build/C/man2/lseek.2:54 build/C/man3/lseek64.3:34 build/C/man2/rmdir.2:35
5818 #: build/C/man2/write.2:44
5819 msgid "B<#include E<lt>unistd.hE<gt>>"
5820 msgstr "B<#include E<lt>unistd.hE<gt>>"
5823 #: build/C/man2/lseek.2:56
5824 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
5825 msgstr "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
5828 #: build/C/man2/lseek.2:67
5830 "The B<lseek>() function repositions the offset of the open file associated "
5831 "with the file descriptor I<fd> to the argument I<offset> according to the "
5832 "directive I<whence> as follows:"
5834 "B<lseek>() 関数は、ファイルディスクリプタ (descriptor) I<fd> に対応するオー"
5835 "プンされたファイルのオフセットを、 I<whence> に基づき I<offset> 引き数の位置"
5839 #: build/C/man2/lseek.2:72
5840 msgid "The offset is set to I<offset> bytes."
5841 msgstr "オフセットは I<offset> バイトに設定される。"
5844 #: build/C/man2/lseek.2:77
5845 msgid "The offset is set to its current location plus I<offset> bytes."
5846 msgstr "オフセットは現在位置に I<offset> バイトを足した位置になる。"
5849 #: build/C/man2/lseek.2:82
5850 msgid "The offset is set to the size of the file plus I<offset> bytes."
5851 msgstr "オフセットはファイルのサイズに I<offset> バイトを足した位置になる。"
5854 #: build/C/man2/lseek.2:90
5856 "The B<lseek>() function allows the file offset to be set beyond the end of "
5857 "the file (but this does not change the size of the file). If data is later "
5858 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
5859 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
5862 "B<lseek>() 関数は、オフセットをファイルの末尾を越えた位置に設定できる (但"
5863 "し、これによりファイルのサイズが変わらない)。 もしデータがこのオフセット位置"
5864 "以降に書き込まれた場合、 間の空隙の部分 (\"穴 (hole)\") の読み出しがあると、 "
5865 "実際にそこにデータを書き込まれるまではヌルバイト (\\(aq\\e0\\(aq) の列が返さ"
5869 #: build/C/man2/lseek.2:90
5871 msgid "Seeking file data and holes"
5872 msgstr "ファイルのデータとホールの探索"
5875 #: build/C/man2/lseek.2:93
5877 "Since version 3.1, Linux supports the following additional values for "
5880 "Linux バージョン 3.1 以降では、 I<whence> に以下の値も指定することができる。"
5883 #: build/C/man2/lseek.2:93
5885 msgid "B<SEEK_DATA>"
5886 msgstr "B<SEEK_DATA>"
5889 #: build/C/man2/lseek.2:104
5891 "Adjust the file offset to the next location in the file greater than or "
5892 "equal to I<offset> containing data. If I<offset> points to data, then the "
5893 "file offset is set to I<offset>."
5895 "ファイルオフセットを I<offset> 以上で次にデータがある位置に設定する。 "
5896 "I<offset> がデータを指している場合には、 ファイルオフセットは I<offset> に設"
5900 #: build/C/man2/lseek.2:104
5902 msgid "B<SEEK_HOLE>"
5903 msgstr "B<SEEK_HOLE>"
5906 #: build/C/man2/lseek.2:118
5908 "Adjust the file offset to the next hole in the file greater than or equal to "
5909 "I<offset>. If I<offset> points into the middle of a hole, then the file "
5910 "offset is set to I<offset>. If there is no hole past I<offset>, then the "
5911 "file offset is adjusted to the end of the file (i.e., there is an implicit "
5912 "hole at the end of any file)."
5914 "ファイルオフセットを、 位置が I<offset> 以上の次のホール (hole) に設定する。 "
5915 "I<offset> がホールの内部にある場合は、ファイルシステムは I<offset> に設定され"
5916 "る。 I<offset> 以降にホールがない場合は、 ファイルオフセットはファイル末尾に"
5917 "設定される (つまり、 どのファイルの末尾にも暗黙のホールが存在するということ"
5921 #: build/C/man2/lseek.2:124
5923 "In both of the above cases, B<lseek>() fails if I<offset> points past the "
5926 "上記のどちらの場合も、 I<offset> がファイル末尾よりも先を指している場合には "
5930 #: build/C/man2/lseek.2:130
5932 "These operations allow applications to map holes in a sparsely allocated "
5933 "file. This can be useful for applications such as file backup tools, which "
5934 "can save space when creating backups and preserve holes, if they have a "
5935 "mechanism for discovering holes."
5937 "これらの操作を使うことで、 アプリケーションが、 まばら (sparse ) にページが割"
5938 "り当てられたファイルでホールをマップすることができる。 この機能はファイルバッ"
5939 "クアップツールなどのアプリケーションで有用である。 ホールを見つける仕組みがあ"
5940 "れば、 ファイルバックアップツールで、 バックアップを作成する際に保存領域を節"
5941 "約し、ホールを保持することができる。"
5943 #. https://lkml.org/lkml/2011/4/22/79
5944 #. http://lwn.net/Articles/440255/
5945 #. http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
5947 #: build/C/man2/lseek.2:153
5949 "For the purposes of these operations, a hole is a sequence of zeros that "
5950 "(normally) has not been allocated in the underlying file storage. However, "
5951 "a filesystem is not obliged to report holes, so these operations are not a "
5952 "guaranteed mechanism for mapping the storage space actually allocated to a "
5953 "file. (Furthermore, a sequence of zeros that actually has been written to "
5954 "the underlying storage may not be reported as a hole.) In the simplest "
5955 "implementation, a filesystem can support the operations by making "
5956 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
5957 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
5958 "by I<offset> is a hole, it can be considered to consist of data that is a "
5959 "sequence of zeros)."
5961 "これらの操作の目的としては、 ホールは (通常は) バックエンドのファイルストレー"
5962 "ジには割り当てられていない連続する 0 の列である。 しかし、ファイルシステムに"
5963 "はホールを報告する義務はなく、 そのため、 これらの操作は、 ファイルに実際に割"
5964 "り当てられたストレージ領域をマッピングする方法としては確実性のある仕組みでは"
5965 "ない。 (また、バックエンドのストレージに実際に書き込まれた連続する 0 の列は"
5966 "ホールとして報告されないこともある。) 最も単純な実装としては、 B<SEEK_HOLE> "
5967 "は常にファイル末尾のオフセットを返すようにし、 B<SEEK_DATA> は常に I<offset> "
5968 "を返すようにすることで、 ファイルシステムはこれらの操作をサポートすることがで"
5969 "きる (B<SEEK_DATA> は常に I<offset> を返すというのは、 I<offset> が参照する場"
5970 "所がホールであったとしても、 連続する 0 の列のデータで構成されているとみなす"
5974 #: build/C/man2/lseek.2:162
5976 "The B<_GNU_SOURCE> feature test macro must be defined in order to obtain the "
5977 "definitions of B<SEEK_DATA> and B<SEEK_HOLE> from I<E<lt>unistd.hE<gt>>."
5979 "I<E<lt>unistd.hE<gt>> から B<SEEK_DATA> と B<SEEK_HOLE> の定義を得るには、 機"
5980 "能検査マクロ B<_GNU_SOURCE> を定義しなければならない。"
5983 #: build/C/man2/lseek.2:168
5985 "The B<SEEK_HOLE> and B<SEEK_DATA> operations are supported for the following "
5988 "B<SEEK_HOLE>, B<SEEK_DATA> 操作に対応しているのは以下のファイルシステムであ"
5992 #: build/C/man2/lseek.2:170
5993 msgid "Btrfs (since Linux 3.1)"
5994 msgstr "Btrfs (Linux 3.1 以降)"
5996 #. commit 93862d5e1ab875664c6cc95254fc365028a48bb1
5998 #: build/C/man2/lseek.2:173
5999 msgid "OCFS (since Linux 3.2)"
6000 msgstr "OCFS (Linux 3.2 以降)"
6003 #: build/C/man2/lseek.2:175
6004 msgid "XFS (since Linux 3.5)"
6005 msgstr "XFS (Linux 3.5 以降)"
6008 #: build/C/man2/lseek.2:177
6009 msgid "ext4 (since Linux 3.8)"
6010 msgstr "ext4 (Linux 3.8 以降)"
6013 #: build/C/man2/lseek.2:179
6014 msgid "tmpfs (since Linux 3.8)"
6015 msgstr "tmpfs (Linux 3.8 以降)"
6018 #: build/C/man2/lseek.2:187
6020 "Upon successful completion, B<lseek>() returns the resulting offset "
6021 "location as measured in bytes from the beginning of the file. On error, the "
6022 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
6024 "成功した場合、 B<lseek>() は結果のファイル位置をファイルの先頭からのバイト数"
6025 "で返す。 エラーの場合、値 I<(off_t)\\ -1> が返され、 I<errno> にエラーが指示"
6028 #. Some systems may allow negative offsets for character devices
6029 #. and/or for remote filesystems.
6031 #: build/C/man2/lseek.2:200
6033 "I<whence> is not valid. Or: the resulting file offset would be negative, or "
6034 "beyond the end of a seekable device."
6036 "I<whence> が有効な値ではない。または、seek の結果、ファイルオフセットが負に\n"
6037 "なってしまうか、 seek 可能なデバイスの末尾を越えてしまう。"
6040 #: build/C/man2/lseek.2:200 build/C/man2/open.2:957
6041 #: build/C/man2/open_by_handle_at.2:304
6043 msgid "B<EOVERFLOW>"
6044 msgstr "B<EOVERFLOW>"
6046 #. HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
6048 #: build/C/man2/lseek.2:205
6049 msgid "The resulting file offset cannot be represented in an I<off_t>."
6050 msgstr "結果のファイルオフセットを I<off_t> 型で表現することができない。"
6053 #: build/C/man2/lseek.2:205
6059 #: build/C/man2/lseek.2:209
6060 msgid "I<fd> is associated with a pipe, socket, or FIFO."
6061 msgstr "I<fd> がパイプ、ソケット、FIFO を参照している。"
6064 #: build/C/man2/lseek.2:209 build/C/man2/open.2:945
6070 #: build/C/man2/lseek.2:217
6072 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
6073 "beyond the end of the file."
6075 "I<whence> が B<SEEK_DATA> か B<SEEK_HOLE> で、\n"
6076 "現在のファイルオフセットがファイルの末尾を超えた位置である。"
6078 #. SVr4 documents additional error
6079 #. conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
6081 #: build/C/man2/lseek.2:219 build/C/man2/read.2:175 build/C/man2/rmdir.2:129
6082 #: build/C/man2/write.2:189
6083 msgid "SVr4, 4.3BSD, POSIX.1-2001."
6084 msgstr "SVr4, 4.3BSD, POSIX.1-2001."
6086 #. FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
6088 #: build/C/man2/lseek.2:227
6090 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
6091 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
6092 "next POSIX revision (Issue 8)."
6094 "B<SEEK_DATA> と B<SEEK_HOLE> は非標準の拡張で、 Solaris, FreeBSD, DragonFly "
6095 "BSD にも存在する。 これらは POSIX の次の版 (Issue 8) に入れるよう提案されてい"
6099 #: build/C/man2/lseek.2:231
6101 "Some devices are incapable of seeking and POSIX does not specify which "
6102 "devices must support B<lseek>()."
6104 "いくつかのデバイスでは seek ができない。 POSIX はどのデバイスが B<lseek>() "
6107 #. Other systems return the number of written characters,
6108 #. using SEEK_SET to set the counter. (Of written characters.)
6110 #: build/C/man2/lseek.2:238
6111 msgid "On Linux, using B<lseek>() on a terminal device returns B<ESPIPE>."
6113 "Linux では、端末 (terminal) デバイスに B<lseek>() を使用すると B<ESPIPE> が返"
6117 #: build/C/man2/lseek.2:241
6119 "When converting old code, substitute values for I<whence> with the following "
6121 msgstr "古いコードを変換する時は I<whence> の値を以下のマクロに置き換えること:"
6124 #: build/C/man2/lseek.2:244
6127 msgstr "old \tnew\n"
6130 #: build/C/man2/lseek.2:245
6132 msgid "0\tSEEK_SET\n"
6133 msgstr "0\tSEEK_SET\n"
6136 #: build/C/man2/lseek.2:246
6138 msgid "1\tSEEK_CUR\n"
6139 msgstr "1\tSEEK_CUR\n"
6142 #: build/C/man2/lseek.2:247
6144 msgid "2\tSEEK_END\n"
6145 msgstr "2\tSEEK_END\n"
6148 #: build/C/man2/lseek.2:248
6150 msgid "L_SET\tSEEK_SET\n"
6151 msgstr "L_SET\tSEEK_SET\n"
6154 #: build/C/man2/lseek.2:249
6156 msgid "L_INCR\tSEEK_CUR\n"
6157 msgstr "L_INCR\tSEEK_CUR\n"
6160 #: build/C/man2/lseek.2:250
6162 msgid "L_XTND\tSEEK_END\n"
6163 msgstr "L_XTND\tSEEK_END\n"
6166 #: build/C/man2/lseek.2:262
6168 "Note that file descriptors created by B<dup>(2) or B<fork>(2) share the "
6169 "current file position pointer, so seeking on such files may be subject to "
6172 "B<dup>(2) や B<fork>(2) で作成されたファイルディスクリプタは、現在のファイ"
6173 "ル位置ポインタ (current file position pointer) を共有しているので、 このよう"
6174 "なファイルで移動を行うと競合状態を引き起こす可能性がある。"
6177 #: build/C/man2/lseek.2:269
6179 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
6180 "B<posix_fallocate>(3)"
6182 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
6183 "B<posix_fallocate>(3)"
6186 #: build/C/man3/lseek64.3:25
6192 #: build/C/man3/lseek64.3:25
6198 #: build/C/man3/lseek64.3:28
6199 msgid "lseek64 - reposition 64-bit read/write file offset"
6200 msgstr "lseek64 - ファイルの 64 ビットの読み書きオフセットの位置を変える"
6203 #: build/C/man3/lseek64.3:30
6204 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
6205 msgstr "B<#define _LARGEFILE64_SOURCE> /* feature_test_macros(7) 参照 */"
6208 #: build/C/man3/lseek64.3:36
6210 "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
6212 "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
6215 #: build/C/man3/lseek64.3:53
6217 "The B<lseek>(2) family of functions reposition the offset of the open file "
6218 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
6219 "start, current position, or end of the file, when I<whence> has the value "
6220 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
6222 "B<lseek>(2) 関数ファミリーは、ファイルディスクリプタ I<fd> に関連するオープ"
6223 "ンされたファイルのオフセットを、 ファイルの開始位置・現在位置・終端から "
6224 "I<offset> の位置へ変更する。 これは I<whence> がそれぞれ B<SEEK_SET>, "
6225 "B<SEEK_CUR>, B<SEEK_END> の場合に対応する。"
6228 #: build/C/man3/lseek64.3:56
6229 msgid "For more details, return value, and errors, see B<lseek>(2)."
6230 msgstr "更に詳しい説明・返り値・エラーは、 B<lseek>(2) を参照すること。"
6233 #: build/C/man3/lseek64.3:63
6235 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
6236 "the raw system call B<_llseek>(2)."
6238 "4 つのインタフェースが使用可能である: B<lseek>(2), B<lseek64>(), "
6239 "B<llseek>(2) と元となるシステムコール B<_llseek>(2) である。"
6242 #: build/C/man3/lseek64.3:63
6248 #: build/C/man3/lseek64.3:65 build/C/man3/lseek64.3:87
6249 #: build/C/man3/lseek64.3:116
6254 #: build/C/man3/lseek64.3:69
6256 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
6257 msgstr "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
6260 #: build/C/man3/lseek64.3:77
6262 "B<lseek>(2) uses the type I<off_t>. This is a 32-bit signed type on 32-bit "
6263 "architectures, unless one compiles with"
6265 "B<lseek>(2) は型 I<off_t> を使う。 これは 32 ビットアーキテクチャ上では 32 "
6269 #: build/C/man3/lseek64.3:85
6270 msgid "in which case it is a 64-bit signed type."
6271 msgstr "を定義してコンパイルした場合は 64 ビット符号付き型である。"
6274 #: build/C/man3/lseek64.3:85
6280 #: build/C/man3/lseek64.3:91
6282 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
6283 msgstr "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
6286 #: build/C/man3/lseek64.3:102
6288 "The library routine B<lseek64>() uses a 64-bit type even when I<off_t> is a "
6289 "32-bit type. Its prototype (and the type I<off64_t>) is available only "
6290 "when one compiles with"
6292 "ライブラリルーチン B<lseek64>() は I<off_t> が 32 ビット型であっても 64 ビッ"
6293 "ト型を使う。 このプロトタイプ (と型 I<off64_t>) は、以下の定義をしてコンパイ"
6297 #: build/C/man3/lseek64.3:106
6299 msgid "#define _LARGEFILE64_SOURCE\n"
6300 msgstr "#define _LARGEFILE64_SOURCE\n"
6302 #. in glibc 2.0.94, not in 2.0.6
6304 #: build/C/man3/lseek64.3:114
6306 "The function B<lseek64>() is available since glibc 2.1, and is defined to "
6307 "be an alias for B<llseek>()."
6309 "関数 B<lseek64>() は glibc 2.1 以降で使用可能であり、 B<llseek>() のエイリ"
6313 #: build/C/man3/lseek64.3:114
6319 #: build/C/man3/lseek64.3:120
6321 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
6322 msgstr "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
6324 #. in libc 5.0.9, not in 4.7.6
6326 #: build/C/man3/lseek64.3:139
6328 "The type I<loff_t> is a 64-bit signed type. The library routine "
6329 "B<llseek>() is available in libc5 and glibc and works without special "
6330 "defines. Its prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but "
6331 "glibc does not provide a prototype. This is bad, since a prototype is "
6332 "needed. Users should add the above prototype, or something equivalent, to "
6333 "their own source. When users complained about data loss caused by a "
6334 "miscompilation of B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
6336 "型 I<loff_t> は 64 ビット符号付き型である。 ライブラリルーチン B<llseek>() "
6337 "は libc5 と glibc で使用可能であり、特別な定義なしに動作する。 このプロトタイ"
6338 "プは、libc5 では I<E<lt>unistd.hE<gt>> で与えられるが、glibc はプロトタイプを"
6339 "提供しない。 これはプロトタイプが必要になるので良くない。 ユーザは上記のプロ"
6340 "トタイプまたはそれと同等のものを、 自身のソースに追加しなければならない。 こ"
6341 "のデータがないことによって B<e2fsck>(8) のコンパイルが失敗するという苦情が"
6342 "ユーザから出たので、 glibc 2.1.3 では以下のようなリンク時の警告が追加された。"
6345 #: build/C/man3/lseek64.3:142
6346 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
6347 msgstr "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
6350 #: build/C/man3/lseek64.3:146
6352 "This makes this function unusable if one desires a warning-free compilation."
6354 "これにより、警告なしでコンパイルしたい場合には、この関数を使用不可にできる。"
6357 #: build/C/man3/lseek64.3:146
6363 #: build/C/man3/lseek64.3:149
6365 "All the above functions are implemented in terms of this system call. The "
6368 "上記の全ての関数は、このシステムコールに基づいて実装される。 プロトタイプは以"
6372 #: build/C/man3/lseek64.3:154
6375 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
6376 "B< loff_t *>I<result>B<, int >I<whence>B<);>\n"
6378 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
6379 "B< loff_t *>I<result>B<, int >I<whence>B<);>\n"
6382 #: build/C/man3/lseek64.3:159
6383 msgid "For more details, see B<llseek>(2)."
6384 msgstr "更に詳しい情報は、 B<llseek>(2) を参照すること。"
6387 #: build/C/man3/lseek64.3:164
6388 msgid "The B<lseek64>() function is thread-safe."
6389 msgstr "関数 B<lseek64>() はスレッドセーフである。"
6392 #: build/C/man3/lseek64.3:167
6393 msgid "B<llseek>(2), B<lseek>(2)"
6394 msgstr "B<llseek>(2), B<lseek>(2)"
6397 #: build/C/man2/open.2:51
6403 #: build/C/man2/open.2:54
6404 msgid "open, openat, creat - open and possibly create a file"
6405 msgstr "open, openat, creat - ファイルのオープン、作成を行う"
6408 #: build/C/man2/open.2:59
6411 "B<#include E<lt>sys/types.hE<gt>>\n"
6412 "B<#include E<lt>sys/stat.hE<gt>>\n"
6413 "B<#include E<lt>fcntl.hE<gt>>\n"
6415 "B<#include E<lt>sys/types.hE<gt>>\n"
6416 "B<#include E<lt>sys/stat.hE<gt>>\n"
6417 "B<#include E<lt>fcntl.hE<gt>>\n"
6420 #: build/C/man2/open.2:62
6423 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
6424 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t >I<mode>B<);>\n"
6426 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
6427 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t >I<mode>B<);>\n"
6430 #: build/C/man2/open.2:64
6432 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
6433 msgstr "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
6436 #: build/C/man2/open.2:68
6439 "B<int openat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<);>\n"
6440 "B<int openat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<, mode_t >I<mode>B<);>\n"
6442 "B<int openat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<);>\n"
6443 "B<int openat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<, mode_t >I<mode>B<);>\n"
6446 #: build/C/man2/open.2:76
6447 msgid "B<openat>():"
6448 msgstr "B<openat>():"
6451 #: build/C/man2/open.2:98
6453 "Given a I<pathname> for a file, B<open>() returns a file descriptor, a "
6454 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
6455 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.). The file descriptor returned "
6456 "by a successful call will be the lowest-numbered file descriptor not "
6457 "currently open for the process."
6459 "ファイルの I<pathname> を与えると、 B<open>() はファイルディスクリプタを返"
6460 "す。 ファイルディスクリプタは、この後に続くシステムコール (B<read>(2), "
6461 "B<write>(2), B<lseek>(2), B<fcntl>(2) など) で使用される小さな非負の整数であ"
6462 "る。 このシステムコールが成功した場合に返されるファイルディスクリプタは その"
6463 "プロセスがその時点でオープンしていないファイルディスクリプタの うち最小の数字"
6467 #: build/C/man2/open.2:110
6469 "By default, the new file descriptor is set to remain open across an "
6470 "B<execve>(2) (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
6471 "B<fcntl>(2)) is initially disabled; the B<O_CLOEXEC> flag, described below, "
6472 "can be used to change this default. The file offset is set to the beginning "
6473 "of the file (see B<lseek>(2))."
6475 "デフォルトでは、新しいファイルディスクリプタは B<execve>(2) を実行した後も\n"
6476 "オープンされたままとなる (つまり、 B<fcntl>(2) に説明がある B<FD_CLOEXEC> \n"
6477 "ファイルディスクリプタフラグは最初は無効である; 後述の B<O_CLOEXEC> フラグ\n"
6478 "を使うとこのデフォルトを変更することができる)。 ファイルオフセット \n"
6479 "(file offset) はファイルの先頭に設定される (B<lseek>(2) 参照)。"
6482 #: build/C/man2/open.2:131
6485 #| "A call to B<open>() creates a new I<open file description>, an entry in "
6486 #| "the system-wide table of open files. This entry records the file offset "
6487 #| "and the file status flags (modifiable via the B<fcntl>(2) B<F_SETFL> "
6488 #| "operation). A file descriptor is a reference to one of these entries; "
6489 #| "this reference is unaffected if I<pathname> is subsequently removed or "
6490 #| "modified to refer to a different file. The new open file description is "
6491 #| "initially not shared with any other process, but sharing may arise via "
6494 "A call to B<open>() creates a new I<open file description>, an entry in the "
6495 "system-wide table of open files. (This object is variously also called an "
6496 "\"open file object\", a \"file handle\", an \"open file table entry\", or"
6497 "\\(emin kernel-developer parlance\\(ema I<struct file>. The term \"open "
6498 "file description\" is used by POSIX.) The open file description records the "
6499 "file offset and the file status flags (see below). A file descriptor is a "
6500 "reference to an open file description; this reference is unaffected if "
6501 "I<pathname> is subsequently removed or modified to refer to a different "
6502 "file. The new open file description is initially not shared with any other "
6503 "process, but sharing may arise via B<fork>(2)."
6505 "B<open>() を呼び出すと、「オープンファイル記述」 I<(open file description)> "
6506 "が作成される。ファイル記述とは、システム全体の オープン中のファイルのテーブル"
6507 "のエントリである。 このエントリは、ファイルオフセットとファイル状態フラグ "
6508 "(B<fcntl>(2) B<F_SETFL> 操作により変更可能) が保持する。 ファイルディスクリ"
6509 "プタはこれらのエントリの一つへの参照である。 この後で I<pathname> が削除され"
6510 "たり、他のファイルを参照するように変更されたりしても、 この参照は影響を受けな"
6511 "い。 新しいオープンファイル記述は最初は他のどのプロセスとも 共有されていない"
6512 "が、 B<fork>(2) で共有が起こる場合がある。"
6515 #: build/C/man2/open.2:139
6517 "The argument I<flags> must include one of the following I<access modes>: "
6518 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>. These request opening the file read-"
6519 "only, write-only, or read/write, respectively."
6521 "引き数 I<flags> には、アクセスモード B<O_RDONLY>, B<O_WRONLY>, B<O_RDWR> のど"
6522 "れかひとつが入っていなければならない。 これらはそれぞれ読み込み専用、書き込み"
6523 "専用、読み書き用に ファイルをオープンすることを要求するものである。"
6525 #. SUSv4 divides the flags into:
6529 #. * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
6530 #. though it's not clear what the difference between "other" and
6531 #. "File creation" flags is. I raised an Aardvark to see if this
6532 #. can be clarified in SUSv4; 10 Oct 2008.
6533 #. http://thread.gmane.org/gmane.comp.standards.posix.austin.general/64/focus=67
6534 #. TC1 (balloted in 2013), resolved this, so that those three constants
6535 #. are also categorized" as file status flags.
6537 #: build/C/man2/open.2:178
6539 "In addition, zero or more file creation flags and file status flags can be "
6540 "bitwise-I<or>'d in I<flags>. The I<file creation flags> are B<O_CLOEXEC>, "
6541 "B<O_CREAT>, B<O_DIRECTORY>, B<O_EXCL>, B<O_NOCTTY>, B<O_NOFOLLOW>, "
6542 "B<O_TMPFILE>, B<O_TRUNC>, and B<O_TTY_INIT>. The I<file status flags> are "
6543 "all of the remaining flags listed below. The distinction between these two "
6544 "groups of flags is that the file status flags can be retrieved and (in some "
6545 "cases) modified; see B<fcntl>(2) for details."
6547 "さらに、 I<flags> には、ファイル作成フラグ (file creation flag) とファイル状"
6548 "態フラグ (file status flag) を 0 個以上「ビット単位の OR (bitwise-or)」で 指"
6549 "定することができる。 I<ファイル作成フラグ> は B<O_CLOEXEC>, B<O_CREAT>, "
6550 "B<O_DIRECTORY>, B<O_EXCL>, B<O_NOCTTY>, B<O_NOFOLLOW>, B<O_TMPFILE>, "
6551 "B<O_TRUNC>, B<O_TTY_INIT> である。 I<ファイル状態フラグ> は以下のリストのうち"
6552 "上記以外の残りのものである。 二種類のフラグの違いは、ファイル状態フラグの方は"
6553 "その内容を取得したり (場合によっては) 変更したりできる点にある。詳細は "
6557 #: build/C/man2/open.2:180
6559 "The full list of file creation flags and file status flags is as follows:"
6560 msgstr "すべてのファイル作成フラグとファイル状態フラグを以下のリストに示す。"
6563 #: build/C/man2/open.2:180
6566 msgstr "B<O_APPEND>"
6568 #. For more background, see
6569 #. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
6570 #. http://nfs.sourceforge.net/
6572 #: build/C/man2/open.2:197
6574 "The file is opened in append mode. Before each B<write>(2), the file offset "
6575 "is positioned at the end of the file, as if with B<lseek>(2). B<O_APPEND> "
6576 "may lead to corrupted files on NFS filesystems if more than one process "
6577 "appends data to a file at once. This is because NFS does not support "
6578 "appending to a file, so the client kernel has to simulate it, which can't be "
6579 "done without a race condition."
6581 "ファイルを追加 (append) モードでオープンする。 毎回の B<write>(2) の前に "
6582 "B<lseek>(2) を行ったかのように、ファイルポインタをファイルの最後に移動す"
6583 "る。 NFS ファイルシステムで、 B<O_APPEND> を使用すると、複数のプロセスがひと"
6584 "つのファイルに同時にデータを追加した場合、 ファイルが壊れてしまうことがあ"
6585 "る。 これは NFS が追加モードをサポートしていないため、 クライアントのカーネ"
6586 "ル (kernel) がそれをシミュレートしなければならないのだが、 競合状態を避けるこ"
6590 #: build/C/man2/open.2:197
6596 #: build/C/man2/open.2:211
6598 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
6599 "can be changed via B<fcntl>(2)) when input or output becomes possible on "
6600 "this file descriptor. This feature is available only for terminals, "
6601 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs. See "
6602 "B<fcntl>(2) for further details. See also BUGS, below."
6604 "シグナル駆動 I/O (signal-driven I/O) を有効にする: このファイルディスクリプタ"
6605 "への 入力または出力が可能になった場合に、シグナルを生成する (デフォルトは "
6606 "B<SIGIO> であるが、 B<fcntl>(2) によって変更可能である)。 この機能が使用可能"
6607 "なのは端末、疑似端末、ソケットのみであり、 (Linux 2.6 以降では) パイプと "
6608 "FIFO に対しても使用できる。 さらに詳しい説明は B<fcntl>(2) を参照すること。 "
6612 #: build/C/man2/open.2:211
6614 msgid "B<O_CLOEXEC> (since Linux 2.6.23)"
6615 msgstr "B<O_CLOEXEC> (Linux 2.6.23 以降)"
6617 #. NOTE! several other man pages refer to this text
6619 #: build/C/man2/open.2:221
6621 "Enable the close-on-exec flag for the new file descriptor. Specifying this "
6622 "flag permits a program to avoid additional B<fcntl>(2) B<F_SETFD> "
6623 "operations to set the B<FD_CLOEXEC> flag."
6625 "新しいファイルディスクリプタに対して close-on-exec フラグを有効にする。 この"
6626 "フラグを指定することで、 プログラムは B<FD_CLOEXEC> フラグをセットするために "
6627 "B<fcntl>(2) B<F_SETFD> 操作を別途呼び出す必要がなくなる。"
6629 #. This flag fixes only one form of the race condition;
6630 #. The race can also occur with, for example, descriptors
6631 #. returned by accept(), pipe(), etc.
6633 #: build/C/man2/open.2:250
6635 "Note that the use of this flag is essential in some multithreaded programs, "
6636 "because using a separate B<fcntl>(2) B<F_SETFD> operation to set the "
6637 "B<FD_CLOEXEC> flag does not suffice to avoid race conditions where one "
6638 "thread opens a file descriptor and attempts to set its close-on-exec flag "
6639 "using B<fcntl>(2) at the same time as another thread does a B<fork>(2) "
6640 "plus B<execve>(2). Depending on the order of execution, the race may lead "
6641 "to the file descriptor returned by B<open>() being unintentionally leaked "
6642 "to the program executed by the child process created by B<fork>(2). (This "
6643 "kind of race is in principle possible for any system call that creates a "
6644 "file descriptor whose close-on-exec flag should be set, and various other "
6645 "Linux system calls provide an equivalent of the B<O_CLOEXEC> flag to deal "
6646 "with this problem.)"
6648 "ある種のマルチスレッドのプログラムはこのフラグの使用は不可欠である点に注意す"
6649 "ること。 なぜなら、個別に B<FD_CLOEXEC> フラグを設定する B<fcntl>(2) "
6650 "B<F_SETFD> 操作を呼び出したとしても、あるスレッドがファイルディスクリプタを "
6651 "オープンするのと同時に別のスレッドが B<fork>(2) と B<execve>(2) を実行すると"
6652 "いう競合条件を避けるのには十分ではないからである。 実行の順序に依存して、この"
6653 "競合条件の結果、 B<open>() が返したファイルディスクリプタが B<fork>(2) で作成"
6654 "された子プロセスにより実行されるプログラムに意図せず見えてしまう可能性があ"
6655 "る。 (この種の競合は、 本質的に、 close-on-exec フラグをセットすべきファイル"
6656 "ディスクリプタを作成するどのシステムコールでも起こり得るものであり、 他のいろ"
6657 "いろな Linux システムコールでこの問題に対処するために B<O_CLOEXEC> と同等の機"
6661 #: build/C/man2/open.2:250
6666 #. As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
6667 #. XFS (since 2.6.14).
6669 #: build/C/man2/open.2:266
6671 "If the file does not exist, it will be created. The owner (user ID) of the "
6672 "file is set to the effective user ID of the process. The group ownership "
6673 "(group ID) is set either to the effective group ID of the process or to the "
6674 "group ID of the parent directory (depending on filesystem type and mount "
6675 "options, and the mode of the parent directory; see the mount options "
6676 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
6678 "ファイルが存在しなかった場合は作成 (create) する。 ファイルの所有者 (ユー"
6679 "ザー ID) は、プロセスの実効ユーザー ID に設定される。 グループ所有権 (グルー"
6680 "プ ID) は、プロセスの実効グループ ID または親ディレクトリのグループ ID に設定"
6681 "される (これは、ファイルシステムタイプ、マウントオプション、 親ディレクトリの"
6682 "モードに依存する。 B<mount>(8) で説明されているマウントオプション "
6683 "I<bsdgroups> と I<sysvgroups> を参照)。"
6686 #: build/C/man2/open.2:293
6688 "I<mode> specifies the permissions to use in case a new file is created. "
6689 "This argument must be supplied when B<O_CREAT> or B<O_TMPFILE> is specified "
6690 "in I<flags>; if neither B<O_CREAT> nor B<O_TMPFILE> is specified, then "
6691 "I<mode> is ignored. The effective permissions are modified by the process's "
6692 "I<umask> in the usual way: The permissions of the created file are I<(mode\\ "
6693 "&\\ ~umask)>. Note that this mode applies only to future accesses of the "
6694 "newly created file; the B<open>() call that creates a read-only file may "
6695 "well return a read/write file descriptor."
6697 "I<mode> は新しいファイルを作成する場合に使用するアクセス許可 (permission) を"
6698 "指定する。 I<flags> に B<O_CREAT> か B<O_TMPFILE> が指定されている場合、 "
6699 "I<mode> を指定しなければならない。 B<O_CREAT> も B<O_TMPFILE> も指定されてい"
6700 "ない場合、 I<mode> は無視される。 有効なアクセス許可は、普段と同じようにプロ"
6701 "セスの I<umask> によって修正され、作成されたファイルの許可は I<(mode\\ &\\ "
6702 "~umask)> となる。 このモードは、新しく作成されたファイルに対するそれ以降のア"
6703 "クセス にのみ適用される点に注意すること。 読み取り専用のファイルを作成する "
6704 "B<open>() コールであっても、 読み書き可能なファイルディスクリプタを返すこと"
6708 #: build/C/man2/open.2:296
6709 msgid "The following symbolic constants are provided for I<mode>:"
6710 msgstr "I<mode> のために以下のシンボル定数が提供されている :"
6713 #: build/C/man2/open.2:296
6719 #: build/C/man2/open.2:299
6720 msgid "00700 user (file owner) has read, write and execute permission"
6722 "00700 ユーザー (ファイルの所有者) に読み込み、書き込み、 実行の許可がある。"
6725 #: build/C/man2/open.2:299
6731 #: build/C/man2/open.2:302
6732 msgid "00400 user has read permission"
6733 msgstr "00400 ユーザーに読み込みの許可がある。"
6736 #: build/C/man2/open.2:302
6742 #: build/C/man2/open.2:305
6743 msgid "00200 user has write permission"
6744 msgstr "00200 ユーザーに書き込みの許可がある。"
6747 #: build/C/man2/open.2:305
6753 #: build/C/man2/open.2:308
6754 msgid "00100 user has execute permission"
6755 msgstr "00100 ユーザーに実行の許可がある。"
6758 #: build/C/man2/open.2:308
6764 #: build/C/man2/open.2:311
6765 msgid "00070 group has read, write and execute permission"
6766 msgstr "00070 グループに読み込み、書き込み、実行の許可がある。"
6769 #: build/C/man2/open.2:311
6775 #: build/C/man2/open.2:314
6776 msgid "00040 group has read permission"
6777 msgstr "00040 グループに読み込みの許可がある。"
6780 #: build/C/man2/open.2:314
6786 #: build/C/man2/open.2:317
6787 msgid "00020 group has write permission"
6788 msgstr "00020 グループに書き込みの許可がある。"
6791 #: build/C/man2/open.2:317
6797 #: build/C/man2/open.2:320
6798 msgid "00010 group has execute permission"
6799 msgstr "00010 グループに実行の許可がある。"
6802 #: build/C/man2/open.2:320
6808 #: build/C/man2/open.2:323
6809 msgid "00007 others have read, write and execute permission"
6810 msgstr "00007 他人 (others) に読み込み、書き込み、実行の許可がある。"
6813 #: build/C/man2/open.2:323
6819 #: build/C/man2/open.2:326
6820 msgid "00004 others have read permission"
6821 msgstr "00004 他人に読み込みの許可がある。"
6824 #: build/C/man2/open.2:326
6830 #: build/C/man2/open.2:329
6831 msgid "00002 others have write permission"
6832 msgstr "00002 他人に書き込みの許可がある。"
6835 #: build/C/man2/open.2:329
6841 #: build/C/man2/open.2:332
6842 msgid "00001 others have execute permission"
6843 msgstr "00001 他人に実行の許可がある。"
6846 #: build/C/man2/open.2:333
6848 msgid "B<O_DIRECT> (since Linux 2.4.10)"
6849 msgstr "B<O_DIRECT> (Linux 2.4.10 以降)"
6852 #: build/C/man2/open.2:350
6854 "Try to minimize cache effects of the I/O to and from this file. In general "
6855 "this will degrade performance, but it is useful in special situations, such "
6856 "as when applications do their own caching. File I/O is done directly to/"
6857 "from user-space buffers. The B<O_DIRECT> flag on its own makes an effort to "
6858 "transfer data synchronously, but does not give the guarantees of the "
6859 "B<O_SYNC> flag that data and necessary metadata are transferred. To "
6860 "guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
6861 "B<O_DIRECT>. See NOTES below for further discussion."
6863 "このファイルに対する I/O のキャッシュの効果を最小化しようとする。このフラグを"
6864 "使うと、一般的に性能が低下する。 しかしアプリケーションが独自にキャッシングを"
6865 "行っているような 特別な場合には役に立つ。 ファイルの I/O はユーザー空間バッ"
6866 "ファに対して直接行われる。 B<O_DIRECT> フラグ自身はデータを同期で転送しようと"
6867 "はするが、 B<O_SYNC> フラグのようにデータと必要なメタデータの転送が保証される"
6868 "わけではない。同期 I/O を保証するためには、 B<O_DIRECT> に加えて B<O_SYNC> を"
6869 "使用しなければならない。下記の「注意」の節の議論も参照。"
6872 #: build/C/man2/open.2:354
6874 "A semantically similar (but deprecated) interface for block devices is "
6875 "described in B<raw>(8)."
6877 "ブロックデバイスに対する似通った意味のインターフェースが B<raw>(8) で説明さ"
6878 "れている (但し、このインタフェースは非推奨である)。"
6881 #: build/C/man2/open.2:354
6883 msgid "B<O_DIRECTORY>"
6884 msgstr "B<O_DIRECTORY>"
6886 #. But see the following and its replies:
6887 #. http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
6888 #. [PATCH] open: O_DIRECTORY and O_CREAT together should fail
6889 #. O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
6891 #: build/C/man2/open.2:366
6893 "If I<pathname> is not a directory, cause the open to fail. This flag was "
6894 "added in kernel version 2.1.126, to avoid denial-of-service problems if "
6895 "B<opendir>(3) is called on a FIFO or tape device."
6897 "I<pathname> がディレクトリでなければオープンは失敗する。 このフラグは、 "
6898 "B<opendir>(3) が FIFO やテープデバイスに対してコールされた場合の サービス不"
6899 "能 (denial-of-service) 攻撃を避けるために カーネル 2.1.126 で追加された。"
6902 #: build/C/man2/open.2:366
6908 #: build/C/man2/open.2:372
6910 "Write operations on the file will complete according to the requirements of "
6911 "synchronized I/O I<data> integrity completion."
6913 "ファイルに対する書き込み操作は、同期 I/O のI<データ>完全性完了の要件に基づい"
6917 #: build/C/man2/open.2:384
6919 "By the time B<write>(2) (and similar) return, the output data has been "
6920 "transferred to the underlying hardware, along with any file metadata that "
6921 "would be required to retrieve that data (i.e., as though each B<write>(2) "
6922 "was followed by a call to B<fdatasync>(2)). I<See NOTES below>."
6924 "B<write>(2) (や同様のコール) が返るまでに、 書き込まれたデータおよびデータを"
6925 "取得するのに必要なファイルメタデータが裏で利用されているハードウェアに転送さ"
6926 "れる (つまり、B<write>(2) の後に B<fdatasync>(2) を呼び出したのと同じようにな"
6927 "る)。 I<下記の「注意」も参照のこと>。"
6930 #: build/C/man2/open.2:384
6936 #: build/C/man2/open.2:394
6938 "Ensure that this call creates the file: if this flag is specified in "
6939 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>() "
6942 "この呼び出しでファイルが作成されることを保証する。このフラグが B<O_CREAT> "
6944 "一緒に指定され、 I<pathname> のファイルが既に存在した場合、 B<open>() は失"
6948 #. POSIX.1-2001 explicitly requires this behavior.
6950 #: build/C/man2/open.2:402
6952 "When these two flags are specified, symbolic links are not followed: if "
6953 "I<pathname> is a symbolic link, then B<open>() fails regardless of where "
6954 "the symbolic link points to."
6956 "これら二つのフラグが指定された際、シンボリックリンクは辿られない。 "
6957 "I<pathname> がシンボリックリンクの場合、 シンボリックリンクがどこを指している"
6958 "かに関わらず B<open>() は失敗する。"
6961 #: build/C/man2/open.2:418
6963 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
6964 "B<O_CREAT>. There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
6965 "be used without B<O_CREAT> if I<pathname> refers to a block device. If the "
6966 "block device is in use by the system (e.g., mounted), B<open>() fails with "
6967 "the error B<EBUSY>."
6969 "一般的には、 B<O_CREAT> を指定せずに B<O_EXCL> を使用した場合の\n"
6970 "B<O_EXCL> の動作は規定されていない。\n"
6971 "これには一つ例外があり、Linux 2.6 以降では、\n"
6972 "I<pathname> がブロックデバイスを参照している場合、\n"
6973 "B<O_CREAT> なしで B<O_EXCL> を使用することができる。\n"
6974 "システムがそのブロックデバイスを使用中の場合 (例えば、\n"
6975 "マウントされているなど)、 B<open>() はエラー B<EBUSY> で失敗する。"
6978 #: build/C/man2/open.2:440
6980 "On NFS, B<O_EXCL> is supported only when using NFSv3 or later on kernel 2.6 "
6981 "or later. In NFS environments where B<O_EXCL> support is not provided, "
6982 "programs that rely on it for performing locking tasks will contain a race "
6983 "condition. Portable programs that want to perform atomic file locking using "
6984 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
6985 "create a unique file on the same filesystem (e.g., incorporating hostname "
6986 "and PID), and use B<link>(2) to make a link to the lockfile. If "
6987 "B<link>(2) returns 0, the lock is successful. Otherwise, use B<stat>(2) "
6988 "on the unique file to check if its link count has increased to 2, in which "
6989 "case the lock is also successful."
6991 "NFS では、 B<O_EXCL> は、Linux 2.6 以降で NFSv3 以降を使っている場合でのみサ"
6992 "ポートされる。 B<O_EXCL> サポートが提供されていない NFS 環境では、このフラグ"
6993 "に頼って ロック処理を実行するプログラムは競合状態 (race condition) に出会う "
6994 "可能性がある。 ロックファイルを使用して不可分 (atomic) なファイルロックを実現"
6995 "し、 NFS が B<O_EXCL> をサポートしているかに依存しないようにしたい場合、 移植"
6996 "性のある方法は、同じファイルシステム上に他と名前の重ならない ファイル (例えば"
6997 "ホスト名と PID を組み合わせた名前) を作成し、 B<link>(2) を使用してそのロッ"
6998 "クファイルへのリンクを作成することである。 B<link>(2) コールの返り値が 0 な"
6999 "らばロックに成功している。 あるいは、そのファイルに B<stat>(2) を使用してリ"
7000 "ンク数 (link count) が 2 になっているかをチェックする。 そうなっていれば、同"
7001 "じくロックに成功しているということである。"
7004 #: build/C/man2/open.2:440
7006 msgid "B<O_LARGEFILE>"
7007 msgstr "B<O_LARGEFILE>"
7010 #: build/C/man2/open.2:462
7012 "(LFS) Allow files whose sizes cannot be represented in an I<off_t> (but can "
7013 "be represented in an I<off64_t>) to be opened. The B<_LARGEFILE64_SOURCE> "
7014 "macro must be defined (before including I<any> header files) in order to "
7015 "obtain this definition. Setting the B<_FILE_OFFSET_BITS> feature test macro "
7016 "to 64 (rather than using B<O_LARGEFILE>) is the preferred method of "
7017 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
7019 "(LFS) I<off_t> ではサイズを表せない (だだし I<off64_t> ではサイズを表せる)"
7021 "イルをオープン可能にする。この定義を有効にするためには、(I<どの>ヘッダファ"
7023 "ルをインクルードするよりも前に) B<_LARGEFILE64_SOURCE> マクロを定義しなけれ"
7026 "32 ビットシステムにおいて大きなファイルにアクセスしたい場合、\n"
7027 "(B<O_LARGEFILE> を使うよりも) B<_FILE_OFFSET_BITS> 機能検査マクロを 64 に\n"
7028 "セットする方が望ましい方法である (B<feature_test_macros>(7) を参照)。"
7031 #: build/C/man2/open.2:462
7033 msgid "B<O_NOATIME> (since Linux 2.6.8)"
7034 msgstr "B<O_NOATIME> (Linux 2.6.8 以降)"
7036 #. The O_NOATIME flag also affects the treatment of st_atime
7037 #. by mmap() and readdir(2), MTK, Dec 04.
7039 #: build/C/man2/open.2:475
7041 "Do not update the file last access time (I<st_atime> in the inode) when the "
7042 "file is B<read>(2). This flag is intended for use by indexing or backup "
7043 "programs, where its use can significantly reduce the amount of disk "
7044 "activity. This flag may not be effective on all filesystems. One example "
7045 "is NFS, where the server maintains the access time."
7047 "ファイルに対して B<read>(2) が実行されたときに、最終アクセス時刻 (inode の "
7048 "I<st_atime>) を更新しない。 このフラグはインデックス作成やバックアッププログ"
7049 "ラムで使うことを意図している。 これを使うとディスクに対する操作を大幅に減らす"
7050 "ことができる。 このフラグは全てのファイルシステムに対して有効であるわけではな"
7051 "い。 その一例が NFS であり、サーバがアクセス時刻を管理している。"
7054 #: build/C/man2/open.2:475
7057 msgstr "B<O_NOCTTY>"
7060 #: build/C/man2/open.2:483
7062 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(emit will not "
7063 "become the process's controlling terminal even if the process does not have "
7066 "I<pathname> が端末 (terminal) デバイス \\(em B<tty>(4) 参照 \\(em を指してい"
7068 "場合に、たとえそのプロセスが制御端末を持っていなくても、オープンしたファイ"
7073 #: build/C/man2/open.2:483
7075 msgid "B<O_NOFOLLOW>"
7076 msgstr "B<O_NOFOLLOW>"
7078 #. The headers from glibc 2.0.100 and later include a
7079 #. definition of this flag; \fIkernels before 2.1.126 will ignore it if
7082 #: build/C/man2/open.2:495
7084 "If I<pathname> is a symbolic link, then the open fails. This is a FreeBSD "
7085 "extension, which was added to Linux in version 2.1.126. Symbolic links in "
7086 "earlier components of the pathname will still be followed. See also "
7089 "I<pathname> がシンボリックリンクだった場合、オープンは失敗する。 これは "
7090 "FreeBSD の拡張で、Linux には バージョン 2.1.126 で追加された。 このフラグが指"
7091 "定された場合でも I<pathname> の前の方の要素 (最後のディレクトリセパレータより"
7092 "前の部分) にあるシンボリックリンクについてはリンクが辿られる。 下記の "
7096 #: build/C/man2/open.2:495
7098 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
7099 msgstr "B<O_NONBLOCK> または B<O_NDELAY>"
7102 #: build/C/man2/open.2:508
7104 "When possible, the file is opened in nonblocking mode. Neither the "
7105 "B<open>() nor any subsequent operations on the file descriptor which is "
7106 "returned will cause the calling process to wait. For the handling of FIFOs "
7107 "(named pipes), see also B<fifo>(7). For a discussion of the effect of "
7108 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
7111 "可能ならば、ファイルは非停止 (nonblocking) モードでオープンされる。\n"
7112 "B<open>() も、返したファイルディスクリプタに対する以後のすべての操作も呼び"
7114 "したプロセスを待たせることはない。 FIFO (名前付きパイプ) を扱う場合には\n"
7115 "B<fifo>(7) も参照すること。 強制ファイルロック (mandatory file lock) やファ"
7117 "ルリース (file lease) と組み合わせた場合の、 B<O_NONBLOCK> の効果についての\n"
7118 "議論は、 B<fcntl>(2) を参照すること。"
7121 #: build/C/man2/open.2:508
7123 msgid "B<O_PATH> (since Linux 2.6.39)"
7124 msgstr "B<O_PATH> (Linux 2.6.39 以降)"
7127 #. commit 1abf0c718f15a56a0a435588d1b104c7a37dc9bd
7128 #. commit 326be7b484843988afe57566b627fb7a70beac56
7129 #. commit 65cfc6722361570bfe255698d9cd4dccaf47570d
7130 #. http://thread.gmane.org/gmane.linux.man/2790/focus=3496
7131 #. Subject: Re: [PATCH] open(2): document O_PATH
7132 #. Newsgroups: gmane.linux.man, gmane.linux.kernel
7134 #: build/C/man2/open.2:530
7136 "Obtain a file descriptor that can be used for two purposes: to indicate a "
7137 "location in the filesystem tree and to perform operations that act purely at "
7138 "the file descriptor level. The file itself is not opened, and other file "
7139 "operations (e.g., B<read>(2), B<write>(2), B<fchmod>(2), B<fchown>(2), "
7140 "B<fgetxattr>(2), B<mmap>(2)) fail with the error B<EBADF>."
7142 "このフラグを指定して取得したファイルディスクリプタは、 ファイルシステムツリー"
7143 "内での場所を示すため、 純粋にファイルディスクリプタレベルでの作用する操作を実"
7144 "行するため、 の二つの目的で使用することができる。 ファイル自身はオープンされ"
7145 "ず、 他のファイル操作 (例えば B<read>(2), B<write>(2), B<fchmod>(2), "
7146 "B<fchown>(2), B<fgetxattr>(2), B<mmap>(2)) はエラー B<EBADF> で失敗する。"
7149 #: build/C/man2/open.2:534
7151 "The following operations I<can> be performed on the resulting file "
7154 "取得したファイルディスクリプタに対して以下の操作を行うことが「できる」。"
7156 #. commit 332a2e1244bd08b9e3ecd378028513396a004a24
7157 #. fstat(): commit 55815f70147dcfa3ead5738fd56d3574e2e3c1c2
7159 #: build/C/man2/open.2:543
7161 "B<close>(2); B<fchdir>(2) (since Linux 3.5); B<fstat>(2) (since Linux 3.6)."
7163 "B<close>(2); B<fchdir>(2) (Linux 3.5 以降); B<fstat>(2) (Linux 3.6 以降)"
7166 #: build/C/man2/open.2:549
7168 "Duplicating the file descriptor (B<dup>(2), B<fcntl>(2) B<F_DUPFD>, etc.)."
7169 msgstr "ファイルディスクリプタの複製 (B<dup>(2), B<fcntl>(2) B<F_DUPFD> など)"
7172 #: build/C/man2/open.2:555
7174 "Getting and setting file descriptor flags (B<fcntl>(2) B<F_GETFD> and "
7177 "ファイルディスクリプタフラグの取得と設定 (B<fcntl>(2) の B<F_GETFD> と "
7181 #: build/C/man2/open.2:561
7183 "Retrieving open file status flags using the B<fcntl>(2) B<F_GETFL> "
7184 "operation: the returned flags will include the bit B<O_PATH>."
7186 "B<fcntl>(2) の B<F_GETFL> 操作を使ったオープンされたファイルの状態フラグの取"
7187 "得。 返されるフラグには B<O_PATH> ビットが含まれる。"
7190 #: build/C/man2/open.2:574
7193 #| "Passing the file descriptor as the I<dirfd> argument of B<openat>(2) and "
7194 #| "the other \"*at()\" system calls."
7196 "Passing the file descriptor as the I<dirfd> argument of B<openat>(2) and "
7197 "the other \"*at()\" system calls. This includes B<linkat>(2) with "
7198 "B<AT_EMPTY_PATH> (or via procfs using B<AT_SYMLINK_FOLLOW>) even if the "
7199 "file is not a directory."
7201 "B<openat>(2) や他の \"*at()\" 系のシステムコールの I<dirfd> 引数としてその"
7205 #: build/C/man2/open.2:580
7207 "Passing the file descriptor to another process via a UNIX domain socket (see "
7208 "B<SCM_RIGHTS> in B<unix>(7))."
7210 "そのファイルディスクリプタを別のプロセスに UNIX ドメインソケット経由で渡す。 "
7211 "(B<unix>(7) の B<SCM_RIGHTS> を参照)"
7214 #: build/C/man2/open.2:591
7216 "When B<O_PATH> is specified in I<flags>, flag bits other than B<O_DIRECTORY> "
7217 "and B<O_NOFOLLOW> are ignored."
7219 "I<flags> に B<O_PATH> が指定された場合、 B<O_DIRECTORY> と B<O_NOFOLLOW> 以外"
7223 #: build/C/man2/open.2:607
7225 "If I<pathname> is a symbolic link and the B<O_NOFOLLOW> flag is also "
7226 "specified, then the call returns a file descriptor referring to the symbolic "
7227 "link. This file descriptor can be used as the I<dirfd> argument in calls to "
7228 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), and B<readlinkat>(2) with an "
7229 "empty pathname to have the calls operate on the symbolic link."
7231 "I<pathname> がシンボリックリンクで B<O_NOFOLLOW> フラグも合わせて指定された場"
7232 "合、 この呼び出しではシンボリックリンクを参照するファイルディスクリプタを返"
7233 "す。 このファイルディスクリプタは、 空のパス名を指定した B<fchownat>(2), "
7234 "B<fstatat>(2), B<linkat>(2), B<readlinkat>(2) の呼び出しで I<dirfd> 引数とし"
7235 "て使うことで、 そのシンボリックリンクに対して操作を行うことができる。"
7238 #: build/C/man2/open.2:607
7244 #: build/C/man2/open.2:619
7246 "Write operations on the file will complete according to the requirements of "
7247 "synchronized I/O I<file> integrity completion (by contrast with contrast "
7248 "with the synchronized I/O I<data> integrity completion provided by "
7251 "ファイルに対する書き込み操作は、同期 I/O のI<ファイル>完全性完了の要件に基づ"
7252 "いて行われる (これに対し B<O_DSYNC> では同期 I/O のI<データ>完全性完了が提供"
7256 #: build/C/man2/open.2:630
7258 "By the time B<write>(2) (and similar) return, the output data and "
7259 "associated file metadata have been transferred to the underlying hardware (i."
7260 "e., as though each B<write>(2) was followed by a call to B<fsync>(2)). "
7261 "I<See NOTES below>."
7263 "B<write>(2) (や同様のコール) が返るまでに、 書き込まれたデータと関連するファ"
7264 "イルメタデータが裏で利用されているハードウェアに転送される (つまり、"
7265 "B<write>(2) の後に B<fsync>(2) を呼び出したのと同じようになる)。 I<下記の「注"
7269 #: build/C/man2/open.2:630
7271 msgid "B<O_TMPFILE> (since Linux 3.11)"
7272 msgstr "B<O_TMPFILE> (Linux 3.11 以降)"
7274 #. commit 60545d0d4610b02e55f65d141c95b18ccf855b6e
7275 #. commit f4e0c30c191f87851c4a53454abb55ee276f4a7e
7276 #. commit bb458c644a59dbba3a1fe59b27106c5e68e1c4bd
7278 #: build/C/man2/open.2:642
7280 "Create an unnamed temporary file. The I<pathname> argument specifies a "
7281 "directory; an unnamed inode will be created in that directory's filesystem. "
7282 "Anything written to the resulting file will be lost when the last file "
7283 "descriptor is closed, unless the file is given a name."
7285 "名前なしの一時ファイルを作成する。 I<pathname> 引き数はディレクトリを指定す"
7286 "る。 名前なしの inode がそのディレクトリが存在するファイルシステムに作成され"
7287 "る。 そのファイルに名前を付与しない限り、 作成されたファイルに書き込まれた内"
7288 "容は、 最後のファイルディスクリプタがクローズされる際に失われる。"
7291 #: build/C/man2/open.2:656
7293 "B<O_TMPFILE> must be specified with one of B<O_RDWR> or B<O_WRONLY> and, "
7294 "optionally, B<O_EXCL>. If B<O_EXCL> is not specified, then B<linkat>(2) "
7295 "can be used to link the temporary file into the filesystem, making it "
7296 "permanent, using code like the following:"
7298 "B<O_TMPFILE> は必ず B<O_RDWR> か B<O_WRONLY> のいずれかと一緒に使わなければな"
7299 "らない。 B<O_EXCL> も指定することができる。 B<O_EXCL> が指定されなかった場"
7300 "合、 B<linkat>(2) を使って、そのファイルシステムにこの一時ファイルへのリンク"
7301 "を作成し、ファイルを永続化することができる。 以下のコードのようにすればよい。"
7304 #: build/C/man2/open.2:662
7307 "char path[PATH_MAX];\n"
7308 "fd = open(\"/path/to/dir\", O_TMPFILE | O_RDWR,\n"
7309 " S_IRUSR | S_IWUSR);\n"
7311 "char path[PATH_MAX];\n"
7312 "fd = open(\"/path/to/dir\", O_TMPFILE | O_RDWR,\n"
7313 " S_IRUSR | S_IWUSR);\n"
7316 #: build/C/man2/open.2:664
7318 msgid "/* File I/O on 'fd'... */\n"
7319 msgstr "/* 'fd' に対するファイル I/O ... */\n"
7322 #: build/C/man2/open.2:668
7325 "snprintf(path, PATH_MAX, \"/proc/self/fd/%d\", fd);\n"
7326 "linkat(AT_FDCWD, path, AT_FDCWD, \"/path/for/file\",\n"
7327 " AT_SYMLINK_FOLLOW);\n"
7329 "snprintf(path, PATH_MAX, \"/proc/self/fd/%d\", fd);\n"
7330 "linkat(AT_FDCWD, path, AT_FDCWD, \"/path/for/file\",\n"
7331 " AT_SYMLINK_FOLLOW);\n"
7334 #: build/C/man2/open.2:677
7336 "In this case, the B<open>() I<mode> argument determines the file permission "
7337 "mode, as with B<O_CREAT>."
7339 "この場合、 B<open>() の I<mode> 引き数は B<O_CREAT> と同様にファイルのアクセ"
7343 #: build/C/man2/open.2:689
7345 "Specifying B<O_EXCL> in conjunction with B<O_TMPFILE> prevents a temporary "
7346 "file from being linked into the filesystem in the above manner. (Note that "
7347 "the meaning of B<O_EXCL> in this case is different from the meaning of "
7348 "B<O_EXCL> otherwise.)"
7350 "B<O_TMPFILE> とともに B<O_EXCL> を指定すると、 一時ファイルに対して上記の方法"
7351 "でファイルシステムへのリンクを行うことができなくなる (この場合の B<O_EXCL> の"
7352 "意味は他の場合の B<O_EXCL> の意味とは異なる点に注意)。"
7354 #. Inspired by http://lwn.net/Articles/559147/
7356 #: build/C/man2/open.2:694
7357 msgid "There are two main use cases for B<O_TMPFILE>:"
7358 msgstr "B<O_TMPFILE> には主に二つの用途がある。"
7361 #: build/C/man2/open.2:703
7363 "Improved B<tmpfile>(3) functionality: race-free creation of temporary files "
7364 "that (1) are automatically deleted when closed; (2) can never be reached via "
7365 "any pathname; (3) are not subject to symlink attacks; and (4) do not require "
7366 "the caller to devise unique names."
7368 "改善された B<tmpfile>(3) の機能: (1) クローズ時に自動的に削除される、 (2) パ"
7369 "ス名では決して参照できない、 (3) シンボリックリンク攻撃ができない、 (4) 呼び"
7370 "出し元が一意な名前を考える必要がない、 という特長を持つ競合のない一時ファイル"
7374 #: build/C/man2/open.2:714
7376 "Creating a file that is initially invisible, which is then populated with "
7377 "data and adjusted to have appropriate filesystem attributes (B<chown>(2), "
7378 "B<chmod>(2), B<fsetxattr>(2), etc.) before being atomically linked into the "
7379 "filesystem in a fully formed state (using B<linkat>(2) as described above)."
7381 "最初は見えないファイルを作成し、 それからデータを書き込んだり、適切なファイル"
7382 "システム属性を持つように調整したり (B<chown>(2), B<chmod>(2), "
7383 "B<fsetxattr>(2) など) した後、 準備が全て整った状態で (上述の B<linkat>(2) を"
7384 "使って) ファイルシステム内にアトミックにリンクを行う。"
7386 #. commit 99b6436bc29e4f10e4388c27a3e4810191cc4788
7387 #. commit ab29743117f9f4c22ac44c13c1647fb24fb2bafe
7389 #: build/C/man2/open.2:725
7391 "B<O_TMPFILE> requires support by the underlying filesystem; only a subset of "
7392 "Linux filesystems provide that support. In the initial implementation, "
7393 "support was provided in the ext2, ext3, ext4, UDF, Minix, and shmem "
7394 "filesystems. XFS support was added in Linux 3.15."
7396 "B<O_TMPFILE> は、 裏で利用されるファイルシステムによるサポートが必要である。 "
7397 "一部の Linux ファイルシステムだけがこの機能をサポートしている。 最初の実装で"
7398 "は、 ext2, ext3, ext4, UDF, Minix, shmem ファイルシステムがサポートしてい"
7399 "た。 XFS でのサポートが Linux 3.15 で追加された。"
7402 #: build/C/man2/open.2:725
7408 #: build/C/man2/open.2:739
7410 "If the file already exists and is a regular file and the access mode allows "
7411 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>) it will be truncated to length "
7412 "0. If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
7413 "ignored. Otherwise, the effect of B<O_TRUNC> is unspecified."
7415 "ファイルが既に存在し、通常ファイルであり、 アクセスモードで書き込みが許可され"
7416 "ている (つまり、 B<O_RDWR> または B<O_WRONLY> の) 場合、長さ 0 に切り詰め "
7417 "(truncate) られる。 ファイルが FIFO または端末デバイスファイルの場合、 "
7418 "B<O_TRUNC> フラグは無視される。 それ以外の場合、 B<O_TRUNC> の効果は未定義で"
7422 #: build/C/man2/open.2:739
7428 #: build/C/man2/open.2:747
7430 "B<creat>() is equivalent to B<open>() with I<flags> equal to B<O_CREAT|"
7431 "O_WRONLY|O_TRUNC>."
7433 "B<creat>() は I<flags> に B<O_CREAT|O_WRONLY|O_TRUNC> を指定して B<open>() "
7437 #: build/C/man2/open.2:747
7443 #: build/C/man2/open.2:753
7445 "The B<openat>() system call operates in exactly the same way as B<open>(), "
7446 "except for the differences described here."
7448 "B<openat>() システムコールは B<open>() と全く同様に動作するが、以下で説明する"
7452 #: build/C/man2/open.2:763
7454 "If the pathname given in I<pathname> is relative, then it is interpreted "
7455 "relative to the directory referred to by the file descriptor I<dirfd> "
7456 "(rather than relative to the current working directory of the calling "
7457 "process, as is done by B<open>() for a relative pathname)."
7459 "I<pathname> で指定されたパス名が相対パスの場合、このパス名はファイルディスク"
7460 "リプター I<dirfd> が参照するディレクトリに対する相対パスと解釈される "
7461 "(B<open>() に相対パス名を渡した場合のように、呼び出したプロセスのカレントワー"
7462 "キングディレクトリに対する相対パスではない)。"
7465 #: build/C/man2/open.2:775
7467 "If I<pathname> is relative and I<dirfd> is the special value B<AT_FDCWD>, "
7468 "then I<pathname> is interpreted relative to the current working directory of "
7469 "the calling process (like B<open>())."
7471 "I<pathname> で指定されたパス名が相対パスで、 I<dirfd> が特別な値 B<AT_FDCWD> "
7472 "の場合、 (B<open>() と同様に) I<pathname> は呼び出したプロセスのカレントワー"
7473 "キングディレクトリに対する相対パスと解釈される。"
7476 #: build/C/man2/open.2:781 build/C/man2/readlink.2:134
7477 msgid "If I<pathname> is absolute, then I<dirfd> is ignored."
7479 "I<pathname> で指定されたパス名が絶対パスの場合、 I<dirfd> は無視される。"
7482 #: build/C/man2/open.2:790
7484 "B<open>(), B<openat>(), and B<creat>() return the new file descriptor, or "
7485 "-1 if an error occurred (in which case, I<errno> is set appropriately)."
7487 "B<open>(), B<openat>(), B<creat>() は新しいファイルディスクリプタを返す。 エ"
7488 "ラーが発生した場合は -1 を返す (その場合は I<errno> が適切に設定される)。"
7491 #: build/C/man2/open.2:796
7493 "B<open>(), B<openat>(), and B<creat>() can fail with the following errors:"
7494 msgstr "B<open>(), B<openat>(), B<creat>() は以下のエラーで失敗する。"
7497 #: build/C/man2/open.2:805
7499 "The requested access to the file is not allowed, or search permission is "
7500 "denied for one of the directories in the path prefix of I<pathname>, or the "
7501 "file did not exist yet and write access to the parent directory is not "
7502 "allowed. (See also B<path_resolution>(7).)"
7504 "ファイルに対する要求されたアクセスが許されていないか、 I<pathname> のディレク"
7505 "トリ部分の何れかのディレクトリに検索許可がなかった。 またはファイルが存在せ"
7506 "ず、親ディレクトリへの書き込み許可がなかった。 (B<path_resolution>(7) も参照"
7510 #: build/C/man2/open.2:811
7512 "Where B<O_CREAT> is specified, the file does not exist, and the user's quota "
7513 "of disk blocks or inodes on the filesystem has been exhausted."
7515 "B<O_CREAT> が指定された場合で、そのファイルが存在せず、ディスクブロックか "
7516 "inode がそのファイルシステムのユーザクォータに達していた。"
7519 #: build/C/man2/open.2:817
7520 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
7521 msgstr "I<pathname> は既に存在し、 B<O_CREAT> と B<O_EXCL> が使用された。"
7524 #: build/C/man2/open.2:821 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:182
7525 msgid "I<pathname> points outside your accessible address space."
7526 msgstr "I<pathname> がアクセス可能なアドレス空間の外を指している。"
7529 #: build/C/man2/open.2:821 build/C/man2/write.2:145
7535 #: build/C/man2/open.2:825
7536 msgid "See B<EOVERFLOW>."
7537 msgstr "B<EOVERFLOW> 参照。"
7540 #: build/C/man2/open.2:825 build/C/man2/read.2:122 build/C/man3/scanf.3:561
7541 #: build/C/man3/tmpfile.3:63 build/C/man2/write.2:150
7547 #: build/C/man2/open.2:832
7549 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
7550 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
7553 "遅いデバイス (例えば FIFO、 B<fifo>(7) 参照) のオープンが完了するのを待って"
7554 "停止している間に システムコールがシグナルハンドラにより割り込まれた。 "
7558 #: build/C/man2/open.2:840
7560 "The filesystem does not support the B<O_DIRECT> flag. See B<NOTES> for more "
7563 "ファイルシステムが B<O_DIRECT> フラグをサポートしていない。 詳細はB<注意>を参"
7566 #. In particular, __O_TMPFILE instead of O_TMPFILE
7568 #: build/C/man2/open.2:845
7569 msgid "Invalid value in I<flags>."
7570 msgstr "I<flags> に無効な値が入っている。"
7573 #: build/C/man2/open.2:855
7575 "B<O_TMPFILE> was specified in I<flags>, but neither B<O_WRONLY> nor "
7576 "B<O_RDWR> was specified."
7578 "I<flags> に B<O_TMPFILE> が指定されたが、 B<O_WRONLY> も B<O_RDWR> も指定され"
7582 #: build/C/man2/open.2:855 build/C/man2/open.2:864 build/C/man2/read.2:158
7583 #: build/C/man2/rename.2:255 build/C/man2/unlink.2:185
7584 #: build/C/man2/unlink.2:256
7590 #: build/C/man2/open.2:864
7592 "I<pathname> refers to a directory and the access requested involved writing "
7593 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
7595 "I<pathname> はディレクトリを参照しており、書き込み要求が含まれていた (つまり "
7596 "B<O_WRONLY> または B<O_RDWR> が設定されている)。"
7599 #: build/C/man2/open.2:878
7601 "I<pathname> refers to an existing directory, B<O_TMPFILE> and one of "
7602 "B<O_WRONLY> or B<O_RDWR> were specified in I<flags>, but this kernel version "
7603 "does not provide the B<O_TMPFILE> functionality."
7605 "I<pathname> が存在するディレクトリを参照していて、 B<O_TMPFILE> および "
7606 "B<O_WRONLY> と B<O_RDWR> の一方が I<flags> に指定されていたが、 このカーネル"
7607 "バージョンでは B<O_TMPFILE> 機能が提供されていない。"
7610 #: build/C/man2/open.2:882 build/C/man2/rmdir.2:77
7611 msgid "Too many symbolic links were encountered in resolving I<pathname>."
7612 msgstr "I<pathname> を解決する際に遭遇したシンボリックリンクが多過ぎる。"
7615 #: build/C/man2/open.2:891
7617 "I<pathname> was a symbolic link, and I<flags> specified B<O_NOFOLLOW> but "
7620 "I<pathname> がシンボリックリンクで、 I<flags> に B<O_NOFOLLOW> が指定された"
7621 "が、 B<O_PATH> が指定されていなかった。"
7624 #: build/C/man2/open.2:891 build/C/man2/pipe.2:144 build/C/man3/tmpfile.3:66
7630 #: build/C/man2/open.2:894
7631 msgid "The process already has the maximum number of files open."
7632 msgstr "プロセスがオープンしているファイル数がすでに最大数に達している。"
7635 #: build/C/man2/open.2:898 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:197
7636 msgid "I<pathname> was too long."
7637 msgstr "I<pathname> が長過ぎる。"
7640 #: build/C/man2/open.2:898 build/C/man2/pipe.2:147 build/C/man3/tmpfile.3:69
7646 #: build/C/man2/open.2:901 build/C/man2/pipe.2:150
7647 msgid "The system limit on the total number of open files has been reached."
7648 msgstr "オープンされているファイルの総数がシステムの制限に達している。"
7651 #: build/C/man2/open.2:901
7657 #: build/C/man2/open.2:908
7659 "I<pathname> refers to a device special file and no corresponding device "
7660 "exists. (This is a Linux kernel bug; in this situation B<ENXIO> must be "
7663 "I<pathname> がデバイススペシャルファイルを参照しており、対応するデバイスが存"
7664 "在しない。 (これは Linux カーネルのバグであり、この場合には B<ENXIO> が返され"
7668 #: build/C/man2/open.2:915
7670 "B<O_CREAT> is not set and the named file does not exist. Or, a directory "
7671 "component in I<pathname> does not exist or is a dangling symbolic link."
7673 "B<O_CREAT> が設定されておらず、かつ指定されたファイルが存在しない。 または、 "
7674 "I<pathname> のディレクトリ部分が存在しないか壊れた (dangling) シンボリックリ"
7678 #: build/C/man2/open.2:929
7680 "I<pathname> refers to a nonexistent directory, B<O_TMPFILE> and one of "
7681 "B<O_WRONLY> or B<O_RDWR> were specified in I<flags>, but this kernel version "
7682 "does not provide the B<O_TMPFILE> functionality."
7684 "I<pathname> が存在しないディレクトリを参照していて、 B<O_TMPFILE> および "
7685 "B<O_WRONLY> と B<O_RDWR> の一方が I<flags> に指定されていたが、 このカーネル"
7686 "バージョンでは B<O_TMPFILE> 機能が提供されていない。"
7689 #: build/C/man2/open.2:938
7691 "I<pathname> was to be created but the device containing I<pathname> has no "
7692 "room for the new file."
7694 "I<pathname> を作成する必要があるが、 I<pathname> を含んでいるデバイスに新しい"
7698 #: build/C/man2/open.2:945
7700 "A component used as a directory in I<pathname> is not, in fact, a directory, "
7701 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
7703 "I<pathname> に含まれるディレクトリ部分のどれかが実際にはディレクトリでない。 "
7704 "または B<O_DIRECTORY> が指定されており、 I<pathname> がディレクトリでない。"
7707 #: build/C/man2/open.2:951
7709 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO, and no process "
7710 "has the FIFO open for reading. Or, the file is a device special file and no "
7711 "corresponding device exists."
7713 "B<O_NONBLOCK> | B<O_WRONLY> が設定されており、指定したファイルが FIFO で その"
7714 "ファイルを読み込み用でオープンしている FIFO が存在しない。 または、ファイルが"
7715 "デバイススペシャルファイルで 対応するデバイスが存在しない。"
7718 #: build/C/man2/open.2:951 build/C/man2/open_by_handle_at.2:301
7720 msgid "B<EOPNOTSUPP>"
7721 msgstr "B<EOPNOTSUPP>"
7724 #: build/C/man2/open.2:957
7725 msgid "The filesystem containing I<pathname> does not support B<O_TMPFILE>."
7727 "I<pathname> を含んでいるファイルシステムが B<O_TMPFILE> をサポートしていな"
7730 #. See http://bugzilla.kernel.org/show_bug.cgi?id=7253
7731 #. "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
7732 #. Reported 2006-10-03
7734 #: build/C/man2/open.2:977
7736 "I<pathname> refers to a regular file that is too large to be opened. The "
7737 "usual scenario here is that an application compiled on a 32-bit platform "
7738 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
7739 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above. This is the error "
7740 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
7741 "B<EFBIG> for this case."
7743 "I<pathname> が参照しているのが、大き過ぎてオープンできない通常のファイルであ"
7744 "る。 通常、このエラーが発生するは、32 ビットプラットフォーム上で I<-"
7745 "D_FILE_OFFSET_BITS=64> を指定せずにコンパイルされたアプリケーションが、ファイ"
7746 "ルサイズが I<(2E<lt>31)-1> ビットを超えるファイルを開こうとした場合である。 "
7747 "上記の B<O_LARGEFILE> も参照。 これは POSIX.1-2001 で規定されているエラーであ"
7748 "る。 2.6.24 より前のカーネルでは、Linux はこの場合にエラー B<EFBIG> を返して"
7751 #. Strictly speaking, it's the filesystem UID... (MTK)
7753 #: build/C/man2/open.2:985
7755 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
7756 "did not match the owner of the file and the caller was not privileged "
7759 "B<O_NOATIME> フラグが指定されたが、呼び出し元の実効ユーザー ID が ファイルの"
7760 "所有者と一致せず、かつ呼び出し元に特権 (B<CAP_FOWNER>) がない。"
7763 #: build/C/man2/open.2:990
7765 "I<pathname> refers to a file on a read-only filesystem and write access was "
7768 "I<pathname> が読み込み専用のファイルシステム上のファイルを参照しており、 書き"
7772 #: build/C/man2/open.2:990
7778 #: build/C/man2/open.2:995
7780 "I<pathname> refers to an executable image which is currently being executed "
7781 "and write access was requested."
7783 "I<pathname> が現在実行中の実行イメージを参照しており、書き込みが要求された。"
7786 #: build/C/man2/open.2:995
7788 msgid "B<EWOULDBLOCK>"
7789 msgstr "B<EWOULDBLOCK>"
7792 #: build/C/man2/open.2:1002
7794 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
7795 "the file (see B<fcntl>(2))."
7797 "B<O_NONBLOCK> フラグが指定されたが、そのファイルには矛盾するリースが設定され"
7798 "ていた (B<fcntl>(2) 参照)。"
7801 #: build/C/man2/open.2:1005
7802 msgid "The following additional errors can occur for B<openat>():"
7803 msgstr "B<openat>() では以下のエラーも発生する。"
7806 #: build/C/man2/open.2:1009 build/C/man2/readlink.2:206
7807 #: build/C/man2/unlink.2:252
7808 msgid "I<dirfd> is not a valid file descriptor."
7809 msgstr "I<dirfd> が有効なファイルディスクリプタではない。"
7812 #: build/C/man2/open.2:1015
7814 "I<pathname> is a relative pathname and I<dirfd> is a file descriptor "
7815 "referring to a file other than a directory."
7817 "I<pathname> が相対パス名で、 I<dirfd> がディレクトリ以外のファイルを参照して"
7821 #: build/C/man2/open.2:1019
7823 "B<openat>() was added to Linux in kernel 2.6.16; library support was added "
7824 "to glibc in version 2.4."
7826 "B<openat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサポー"
7827 "トはバージョン 2.4 で glibc に追加された。"
7830 #: build/C/man2/open.2:1023
7831 msgid "B<open>(), B<creat>() SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
7832 msgstr "B<open>(), B<creat>() SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
7835 #: build/C/man2/open.2:1026
7836 msgid "B<openat>(): POSIX.1-2008."
7837 msgstr "B<openat>(): POSIX.1-2008."
7840 #: build/C/man2/open.2:1037
7842 "The B<O_DIRECT>, B<O_NOATIME>, B<O_PATH>, and B<O_TMPFILE> flags are Linux-"
7843 "specific. One must define B<_GNU_SOURCE> to obtain their definitions."
7845 "フラグ B<O_DIRECT>, B<O_NOATIME>, B<O_PATH>, B<O_TMPFILE> は Linux 特有のもの"
7846 "である。 これらのフラグの定義を得るためには B<_GNU_SOURCE> を定義しなければな"
7850 #: build/C/man2/open.2:1052
7852 "The B<O_CLOEXEC>, B<O_DIRECTORY>, and B<O_NOFOLLOW> flags are not specified "
7853 "in POSIX.1-2001, but are specified in POSIX.1-2008. Since glibc 2.12, one "
7854 "can obtain their definitions by defining either B<_POSIX_C_SOURCE> with a "
7855 "value greater than or equal to 200809L or B<_XOPEN_SOURCE> with a value "
7856 "greater than or equal to 700. In glibc 2.11 and earlier, one obtains the "
7857 "definitions by defining B<_GNU_SOURCE>."
7859 "フラグ B<O_CLOEXEC>, B<O_DIRECTORY>, B<O_NOFOLLOW> は POSIX.1-2001 では規定さ"
7860 "れていないが、 POSIX.1-2008 では規定されている。 glibc 2.12 以降では、これら"
7861 "の定義を得るには、 B<_POSIX_C_SOURCE> を 200809L 以上の値で定義するか、 "
7862 "B<_XOPEN_SOURCE> を 700 以上の値で定義する。 glibc 2.11 以前では、 これらの定"
7863 "義を得るには B<_GNU_SOURCE> を定義する。"
7866 #: build/C/man2/open.2:1063
7868 "As noted in B<feature_test_macros>(7), feature test macros such as "
7869 "B<_POSIX_C_SOURCE>, B<_XOPEN_SOURCE>, and B<_GNU_SOURCE> must be defined "
7870 "before including I<any> header files."
7872 "B<feature_test_macros>(7) に注意書きがあるように、 B<_POSIX_C_SOURCE>, "
7873 "B<_XOPEN_SOURCE>, B<_GNU_SOURCE> などの機能検査マクロはI<どの>ヘッダーファイ"
7874 "ルをインクルードするより前に定義しなければならない。"
7877 #: build/C/man2/open.2:1071
7879 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
7880 "does not necessarily have the intention to read or write. This is typically "
7881 "used to open devices in order to get a file descriptor for use with "
7884 "Linux では、 B<O_NONBLOCK> フラグは、 open を実行したいが read または write "
7885 "を実行する意図は 必ずしもないことを意味する。 これは B<ioctl>(2) のための"
7886 "ファイルディスクリプタを取得するために、 デバイスをオープンするときによく用い"
7889 #. Linux 2.0, 2.5: truncate
7890 #. Solaris 5.7, 5.8: truncate
7891 #. Irix 6.5: truncate
7892 #. Tru64 5.1B: truncate
7893 #. HP-UX 11.22: truncate
7894 #. FreeBSD 4.7: truncate
7896 #: build/C/man2/open.2:1083
7898 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
7899 "implementations. On many systems the file is actually truncated."
7901 "B<O_RDONLY | O_TRUNC> の影響は未定義であり、その動作は実装によって異なる。 多"
7902 "くのシステムではファイルは実際に切り詰められる。"
7905 #: build/C/man2/open.2:1091
7907 "Note that B<open>() can open device special files, but B<creat>() cannot "
7908 "create them; use B<mknod>(2) instead."
7910 "B<open>() はスペシャルファイルをオープンすることができるが、 B<creat>() で"
7911 "スペシャルファイルを作成できない点に注意すること。 代わりに B<mknod>(2) を使"
7915 #: build/C/man2/open.2:1112
7917 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
7918 "fields (respectively, time of last access, time of last status change, and "
7919 "time of last modification; see B<stat>(2)) are set to the current time, and "
7920 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory. "
7921 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
7922 "st_ctime and st_mtime fields are set to the current time."
7924 "ファイルが新しく作成されると、 ファイルの I<st_atime>, I<st_ctime>, "
7925 "I<st_mtime> フィールド (それぞれ最終アクセス時刻、最終状態変更時刻、最終修正"
7926 "時刻である。 B<stat>(2) 参照) が現在時刻に設定される。 さらに親ディレクトリ"
7927 "の I<st_ctime> と I<st_mtime> も現在時刻に設定される。 それ以外の場合で、"
7928 "O_TRUNC フラグでファイルが修正されたときは、 ファイルの I<st_ctime> と "
7929 "I<st_mtime> フィールドが現在時刻に設定される。"
7932 #: build/C/man2/open.2:1112
7934 msgid "Synchronized I/O"
7938 #: build/C/man2/open.2:1127
7940 "The POSIX.1-2008 \"synchronized I/O\" option specifies different variants of "
7941 "synchronized I/O, and specifies the B<open>() flags B<O_SYNC>, B<O_DSYNC>, "
7942 "and B<O_RSYNC> for controlling the behavior. Regardless of whether an "
7943 "implementation supports this option, it must at least support the use of "
7944 "B<O_SYNC> for regular files."
7946 "POSIX.1-2008 の「同期 I/O」の選択肢として複数種類が規定されており、 動作を制"
7947 "御するために B<open>() フラグとして B<O_SYNC>, B<O_DSYNC>, B<O_RSYNC> が規定"
7948 "されている。 この選択肢を実装がサポートしているかに関わらず、 各実装では少な"
7949 "くとも通常のファイルに対して B<O_SYNC> が利用できなければならない。"
7952 #: build/C/man2/open.2:1138
7954 "Linux implements B<O_SYNC> and B<O_DSYNC>, but not B<O_RSYNC>. (Somewhat "
7955 "incorrectly, glibc defines B<O_RSYNC> to have the same value as B<O_SYNC>.)"
7957 "Linux は B<O_SYNC> と B<O_DSYNC> を実装しているが、 B<O_RSYNC> は実装していな"
7958 "い (少し間違っているのだが、 glibc では B<O_RSYNC> が B<O_SYNC> と同じ値で定"
7962 #: build/C/man2/open.2:1156
7964 "B<O_SYNC> provides synchronized I/O I<file> integrity completion, meaning "
7965 "write operations will flush data and all associated metadata to the "
7966 "underlying hardware. B<O_DSYNC> provides synchronized I/O I<data> integrity "
7967 "completion, meaning write operations will flush data to the underlying "
7968 "hardware, but will only flush metadata updates that are required to allow a "
7969 "subsequent read operation to complete successfully. Data integrity "
7970 "completion can reduce the number of disk operations that are required for "
7971 "applications that don't need the guarantees of file integrity completion."
7973 "B<O_SYNC> は、 同期 I/O でのI<ファイル>完全性完了を提供する。 つまり、 書き込"
7974 "み操作はデータとすべての関連メタデータを裏で利用されているハードウェアにフ"
7975 "ラッシュすることを意味する。 B<O_DSYNC> は、 同期 I/O でのI<データ>完全性完了"
7976 "を提供する。 つまり、 書き込み操作はデータを裏で利用されているハードウェアに"
7977 "フラッシュするが、 それ以降の読み出し操作が正常に完了するのに必要なメタデータ"
7978 "の更新のみをフラッシュする。 データ完全性完了は、 ファイル完全性完了を必要と"
7979 "しないアプリケーションで、 ディスク操作の数を減らすことができる。"
7982 #: build/C/man2/open.2:1173
7984 "To understand the difference between the the two types of completion, "
7985 "consider two pieces of file metadata: the file last modification timestamp "
7986 "(I<st_mtime>) and the file length. All write operations will update the "
7987 "last file modification timestamp, but only writes that add data to the end "
7988 "of the file will change the file length. The last modification timestamp is "
7989 "not needed to ensure that a read completes successfully, but the file length "
7990 "is. Thus, B<O_DSYNC> would only guarantee to flush updates to the file "
7991 "length metadata (whereas B<O_SYNC> would also always flush the last "
7992 "modification timestamp metadata)."
7994 "2 種類の完了の違いを理解するために、 ファイルメタデータの 2 つの要素、 ファイ"
7995 "ルの最終修正時刻 (I<st_mtime>) とファイル長、を考える。 すべての書き込み操作"
7996 "は最終修正時刻を更新するが、 ファイルの末尾にデータを追加する書き込み操作のみ"
7997 "がファイル長を変更する。 最終修正時刻は、 読み出しが正常に完了するのに必要で"
7998 "はないが、 ファイル長は必要である。 したがって、 B<O_DSYNC> はファイル長のメ"
7999 "タデータの更新がフラッシュされることだけを保証する (これに対して B<O_SYNC> で"
8000 "は最終修正時刻のメタデータも常にフラッシュされる)。"
8003 #: build/C/man2/open.2:1185
8005 "Before Linux 2.6.33, Linux implemented only the B<O_SYNC> flag for "
8006 "B<open>(). However, when that flag was specified, most filesystems actually "
8007 "provided the equivalent of synchronized I/O I<data> integrity completion (i."
8008 "e., B<O_SYNC> was actually implemented as the equivalent of B<O_DSYNC>)."
8010 "Linux 2.6.33 より前では、 Linux は B<open>() では B<O_SYNC> フラグのみを実装"
8011 "していた。 しかしながら、 このフラグが指定された場合、 ほとんどのファイルシス"
8012 "テムで提供されていたのは実際には同期 I/O でのI<データ>完全性完了と等価なもの"
8013 "であった (つまり、 B<O_SYNC> は実際には B<O_DSYNC> と等価なものとして実装され"
8017 #: build/C/man2/open.2:1204
8019 "Since Linux 2.6.33, proper B<O_SYNC> support is provided. However, to "
8020 "ensure backward binary compatibility, B<O_DSYNC> was defined with the same "
8021 "value as the historical B<O_SYNC>, and B<O_SYNC> was defined as a new (two-"
8022 "bit) flag value that includes the B<O_DSYNC> flag value. This ensures that "
8023 "applications compiled against new headers get at least B<O_DSYNC> semantics "
8024 "on pre-2.6.33 kernels."
8026 "Linux 2.6.33 行こう では、 正しい B<O_SYNC> のサポートが提供されている。 しか"
8027 "しながら、 バイナリレベルの後方互換性を保証するため、 B<O_DSYNC> は以前の "
8028 "B<O_SYNC> と同じ値で定義されており、 B<O_SYNC> は B<O_DSYNC> フラグの値を含む"
8029 "新しい (2 ビットの) フラグ値として定義されている。 これにより、 新しいヘッダ"
8030 "を使ってコンパイルされたアプリケーションで、 2.6.33 より前のカーネルで少なく"
8031 "とも B<O_DSYNC> の動作は同じになることが保証される。"
8034 #: build/C/man2/open.2:1204
8040 #: build/C/man2/open.2:1208
8042 "There are many infelicities in the protocol underlying NFS, affecting "
8043 "amongst others B<O_SYNC> and B<O_NDELAY>."
8045 "NFS を実現しているプロトコルには多くの不備があり、特に B<O_SYNC> と "
8046 "B<O_NDELAY> に影響する。"
8049 #: build/C/man2/open.2:1223
8051 "On NFS filesystems with UID mapping enabled, B<open>() may return a file "
8052 "descriptor but, for example, B<read>(2) requests are denied with "
8053 "B<EACCES>. This is because the client performs B<open>() by checking the "
8054 "permissions, but UID mapping is performed by the server upon read and write "
8057 "UID マッピングを使用している NFS ファイルシステムでは、 B<open>() がファイル"
8058 "ディスクリプタを返した場合でも B<read>(2) が B<EACCES> で拒否される場合があ"
8059 "る。 これはクライアントがアクセス許可のチェックを行って B<open>() を実行する"
8060 "が、読み込みや書き込みの際には サーバーで UID マッピングが行われるためであ"
8064 #: build/C/man2/open.2:1223
8066 msgid "File access mode"
8067 msgstr "ファイルアクセスモード"
8070 #: build/C/man2/open.2:1238
8072 "Unlike the other values that can be specified in I<flags>, the I<access "
8073 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR> do not specify "
8074 "individual bits. Rather, they define the low order two bits of I<flags>, "
8075 "and are defined respectively as 0, 1, and 2. In other words, the "
8076 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
8077 "not have the same meaning as B<O_RDWR>."
8079 "「アクセスモード」の値 B<O_RDONLY>, B<O_WRONLY>, B<O_RDWR> は、 I<flags> に指"
8080 "定できる他の値と違い、個々のビットを指定するものではなく、 これらの値は "
8081 "I<flags> の下位 2 ビットを定義する。 B<O_RDONLY>, B<O_WRONLY>, B<O_RDWR> はそ"
8082 "れぞれ 0, 1, 2 に定義されている。 言い換えると、 B<O_RDONLY | O_WRONLY> の組"
8083 "み合わせは論理的に間違いであり、確かに B<O_RDWR> と同じ意味ではない。"
8085 #. See for example util-linux's disk-utils/setfdprm.c
8086 #. For some background on access mode 3, see
8087 #. http://thread.gmane.org/gmane.linux.kernel/653123
8088 #. "[RFC] correct flags to f_mode conversion in __dentry_open"
8089 #. LKML, 12 Mar 2008
8091 #: build/C/man2/open.2:1255
8093 "Linux reserves the special, nonstandard access mode 3 (binary 11) in "
8094 "I<flags> to mean: check for read and write permission on the file and return "
8095 "a descriptor that can't be used for reading or writing. This nonstandard "
8096 "access mode is used by some Linux drivers to return a descriptor that is to "
8097 "be used only for device-specific B<ioctl>(2) operations."
8099 "Linux では、特別な、非標準なアクセスモードとして 3 (バイナリでは 11) が 予約"
8100 "されており I<flags> に指定できる。 このアクセスモードを指定すると、ファイルの"
8101 "読み出し/書き込み許可をチェックし、 読み出しにも書き込みにも使用できないディ"
8102 "スクリプタを返す。 この非標準のアクセスモードはいくつかの Linux ドライバで、"
8103 "デバイス固有の B<ioctl>(2) 操作にのみ使用されるディスクリプタを返すために使わ"
8107 #: build/C/man2/open.2:1255
8109 msgid "Rationale for openat() and other directory file descriptor APIs"
8110 msgstr "openat() や他のディレクトリファイルディスクリプタ API の基本原理"
8113 #: build/C/man2/open.2:1283
8115 "B<openat>() and the other system calls and library functions that take a "
8116 "directory file descriptor argument (i.e., B<faccessat>(2), "
8117 "B<fanotify_mark>(2), B<fchmodat>(2), B<fchownat>(2), B<fstatat>(2), "
8118 "B<futimesat>(2), B<linkat>(2), B<mkdirat>(2), B<mknodat>(2), "
8119 "B<name_to_handle_at>(2), B<readlinkat>(2), B<renameat>(2), B<symlinkat>(2), "
8120 "B<unlinkat>(2), B<utimensat>(2) B<mkfifoat>(3), and B<scandirat>(3)) are "
8121 "supported for two reasons. Here, the explanation is in terms of the "
8122 "B<openat>() call, but the rationale is analogous for the other interfaces."
8124 "B<openat>() やディレクトリファイルディスクリプタを引き数を取る他のシステム"
8125 "コールやライブラリ関数 (B<faccessat>(2), B<fanotify_mark>(2), "
8126 "B<fchmodat>(2), B<fchownat>(2), B<fstatat>(2), B<futimesat>(2), "
8127 "B<linkat>(2), B<mkdirat>(2), B<mknodat>(2), B<name_to_handle_at>(2), "
8128 "B<readlinkat>(2), B<renameat>(2), B<symlinkat>(2), B<unlinkat>(2), "
8129 "B<utimensat>(2) B<mkfifoat>(3), B<scandirat>(3)) は二つの理由から用意されてい"
8130 "る。 ここでは、 B<openat> コールに関して説明するが、この基本原理は他のイン"
8134 #: build/C/man2/open.2:1301
8136 "First, B<openat>() allows an application to avoid race conditions that "
8137 "could occur when using B<open>() to open files in directories other than "
8138 "the current working directory. These race conditions result from the fact "
8139 "that some component of the directory prefix given to B<open>() could be "
8140 "changed in parallel with the call to B<open>(). Such races can be avoided "
8141 "by opening a file descriptor for the target directory, and then specifying "
8142 "that file descriptor as the I<dirfd> argument of B<openat>()."
8144 "最初の理由として、 B<openat>() を使うと、 アプリケーションは、 カレントワーキ"
8145 "ングディレクトリ以外のディレクトリで B<open>() を使ってファイルをオープンする"
8146 "際に起こり得る競合条件を避けることができる。 これらの競合条件は、 B<open>() "
8147 "に渡されたディレクトリプレフィックスの構成要素が B<open>() の呼び出しと並行し"
8148 "て変化する可能性があるという点に由来している。 このような競合条件は、 対象の"
8149 "ディレクトリに対するファイルディスクリプタをオープンし、 それから "
8150 "B<openat>() の I<dirfd> 引き数としてそのファイルディスクリプタを指定すること"
8154 #: build/C/man2/open.2:1312
8156 "Second, B<openat>() allows the implementation of a per-thread \"current "
8157 "working directory\", via file descriptor(s) maintained by the application. "
8158 "(This functionality can also be obtained by tricks based on the use of I</"
8159 "proc/self/fd/>dirfd, but less efficiently.)"
8161 "二つ目として、 B<openat>() を使うと、アプリケーションが管理するファイルディス"
8162 "クリプタにより、 スレッド単位の「カレントワーキングディレクトリ」を実装するこ"
8163 "とができる (この機能は、 I</proc/self/fd/dirfd> を使った方法でも実現すること"
8167 #: build/C/man2/open.2:1312
8173 #: build/C/man2/open.2:1329
8175 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
8176 "address of user-space buffers and the file offset of I/Os. In Linux "
8177 "alignment restrictions vary by filesystem and kernel version and might be "
8178 "absent entirely. However there is currently no filesystem-independent "
8179 "interface for an application to discover these restrictions for a given file "
8180 "or filesystem. Some filesystems provide their own interfaces for doing so, "
8181 "for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
8183 "B<O_DIRECT> フラグを使用する場合、ユーザ空間バッファの長さやアドレス、 I/O の"
8184 "ファイルオフセットに関してアラインメントの制限が課されることがある。 Linux で"
8185 "は、アラインメントの制限はファイルシステムやカーネルのバージョンに よって異な"
8186 "り、全く制限が存在しない場合もある。 しかしながら、現在のところ、指定された"
8187 "ファイルやファイルシステムに対して こうした制限があるかを見つけるための、アプ"
8188 "リケーション向けのインタフェースで ファイルシステム非依存のものは存在しな"
8189 "い。 いくつかのファイルシステムでは、制限を確認するための独自のインタフェース"
8190 "が 提供されている。例えば、 B<xfsctl>(3) の B<XFS_IOC_DIOINFO> 命令である。"
8193 #: build/C/man2/open.2:1339
8196 #| "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
8197 #| "the file offset must all be multiples of the logical block size of the "
8198 #| "filesystem. Under Linux 2.6, alignment to 512-byte boundaries suffices."
8200 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
8201 "the file offset must all be multiples of the logical block size of the "
8202 "filesystem. Since Linux 2.6.0, alignment to the logical block size of the "
8203 "underlying storage (typically 512 bytes) suffices. The logical block size "
8204 "can be determined using the B<ioctl>(2) B<BLKSSZGET> operation or from the "
8205 "shell using the command:"
8207 "Linux 2.4 では、転送サイズ、 ユーザーバッファのアラインメント、ファイルオフ"
8208 "セットは、 ファイルシステムの論理ブロックサイズの倍数でなければならない。 "
8209 "Linux 2.6 では、512 バイトごとの境界に配置されていれば充分である。"
8212 #: build/C/man2/open.2:1341
8214 msgid " blockdev --getss\n"
8218 #: build/C/man2/open.2:1375
8220 "B<O_DIRECT> I/Os should never be run concurrently with the B<fork>(2) "
8221 "system call, if the memory buffer is a private mapping (i.e., any mapping "
8222 "created with the B<mmap>(2) B<MAP_PRIVATE> flag; this includes memory "
8223 "allocated on the heap and statically allocated buffers). Any such I/Os, "
8224 "whether submitted via an asynchronous I/O interface or from another thread "
8225 "in the process, should be completed before B<fork>(2) is called. Failure "
8226 "to do so can result in data corruption and undefined behavior in parent and "
8227 "child processes. This restriction does not apply when the memory buffer for "
8228 "the B<O_DIRECT> I/Os was created using B<shmat>(2) or B<mmap>(2) with the "
8229 "B<MAP_SHARED> flag. Nor does this restriction apply when the memory buffer "
8230 "has been advised as B<MADV_DONTFORK> with B<madvise>(2), ensuring that it "
8231 "will not be available to the child after B<fork>(2)."
8233 "メモリバッファがプライベートマッピング (B<mmap>(2) の B<MAP_PRIVATE>\n"
8234 "フラグで作成されたマッピング) の場合には、B<O_DIRECT> I/O は\n"
8235 "B<fork>(2) システムコールと同時に決して実行すべきではない \n"
8236 "(プライベートマッピングには、ヒープ領域に割り当てられたメモリや静的に\n"
8237 "割り当てたバッファも含まれる)。非同期 I/O インターフェース (AIO) 経由\n"
8238 "やプロセス内の他のスレッドから発行された、このような I/O は、\n"
8239 "B<fork>(2) が呼び出される前に完了されるべきである。\n"
8240 "そうしなかった場合、データ破壊や、親プロセスや子プロセスでの予期しない\n"
8242 "B<O_DIRECT> I/O 用のメモリバッファが B<shmat>(2) やB<MAP_SHARED> フラグ\n"
8243 "付きの B<mmap>(2) で作成された場合には、この制限はあてはまらない。\n"
8244 "B<madvise>(2) でメモリバッファにアドバイス B<MADV_DONTFORK> が設定され\n"
8245 "ている場合にも、この制限はあてはまらない(B<MADV_DONTFORK> はそのメモリ\n"
8246 "バッファが B<fork>(2) 後に子プロセスからは利用できないことを保証するも\n"
8250 #: build/C/man2/open.2:1385
8252 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
8253 "restrictions similar to those of Linux 2.4. IRIX has also a B<fcntl>(2) "
8254 "call to query appropriate alignments, and sizes. FreeBSD 4.x introduced a "
8255 "flag of the same name, but without alignment restrictions."
8257 "B<O_DIRECT> フラグは SGI IRIX で導入された。SGI IRIX にも Linux 2.4 と同様の "
8258 "(ユーザーバッファの) アラインメントの制限がある。 また、IRIX には適切な配置と"
8259 "サイズを取得するための B<fcntl>(2) コールがある。 FreeBSD 4.x も同じ名前のフ"
8260 "ラグを導入したが、アラインメントの制限はない。"
8263 #: build/C/man2/open.2:1394
8265 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10. Older "
8266 "Linux kernels simply ignore this flag. Some filesystems may not implement "
8267 "the flag and B<open>() will fail with B<EINVAL> if it is used."
8269 "B<O_DIRECT> が Linux でサポートされたのは、カーネルバージョン 2.4.10 であ"
8270 "る。 古い Linux カーネルは、このフラグを単に無視する。 B<O_DIRECT> フラグをサ"
8271 "ポートしていないファイルシステムもあり、その場合は、 B<O_DIRECT> を使用する"
8272 "と B<open>() は B<EINVAL> で失敗する。"
8275 #: build/C/man2/open.2:1405
8277 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
8278 "file, and especially to overlapping byte regions in the same file. Even "
8279 "when the filesystem correctly handles the coherency issues in this "
8280 "situation, overall I/O throughput is likely to be slower than using either "
8281 "mode alone. Likewise, applications should avoid mixing B<mmap>(2) of files "
8282 "with direct I/O to the same files."
8284 "アプリケーションは、同じファイル、 特に同じファイルの重複するバイト領域に対し"
8285 "て、 B<O_DIRECT> と通常の I/O を混ぜて使うのは避けるべきである。 ファイルシス"
8286 "テムがこのような状況において一貫性の問題を正しく 扱うことができる場合であって"
8287 "も、全体の I/O スループットは どちらか一方を使用するときと比べて低速になるで"
8288 "あろう。 同様に、アプリケーションは、同じファイルに対して B<mmap>(2) と直接 "
8289 "I/O (B<O_DIRECT>) を混ぜて使うのも避けるべきである。"
8292 #: build/C/man2/open.2:1427
8294 "The behaviour of B<O_DIRECT> with NFS will differ from local filesystems. "
8295 "Older kernels, or kernels configured in certain ways, may not support this "
8296 "combination. The NFS protocol does not support passing the flag to the "
8297 "server, so B<O_DIRECT> I/O will bypass the page cache only on the client; "
8298 "the server may still cache the I/O. The client asks the server to make the "
8299 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>. Some "
8300 "servers will perform poorly under these circumstances, especially if the I/O "
8301 "size is small. Some servers may also be configured to lie to clients about "
8302 "the I/O having reached stable storage; this will avoid the performance "
8303 "penalty at some risk to data integrity in the event of server power "
8304 "failure. The Linux NFS client places no alignment restrictions on "
8307 "NFS で B<O_DIRECT> を使った場合の動作はローカルのファイルシステムの場合と違"
8308 "う。 古いカーネルや、ある種の設定でコンパイルされたカーネルは、 B<O_DIRECT> "
8309 "と NFS の組み合わせをサポートしていないかもしれない。 NFS プロトコル自体は"
8310 "サーバにフラグを渡す機能は持っていないので、 B<O_DIRECT> I/O はクライアント上"
8311 "のページキャッシュをバイパスするだけになり、 サーバは I/O をキャッシュしてい"
8312 "るかもしれない。 クライアントは、 B<O_DIRECT> の同期機構を保持するため、サー"
8313 "バに対して I/O を同期して行うように依頼する。 サーバによっては、こうした状況"
8314 "下、特に I/O サイズが小さい場合に 性能が大きく劣化する。 また、サーバによって"
8315 "は、I/O が安定したストレージにまで行われたと、 クライアントに対して嘘をつくも"
8316 "のもある。 これは、サーバの電源故障が起こった際にデータの完全性が保たれない "
8317 "危険は少しあるが、性能面での不利な条件を回避するために行われている。 Linux "
8318 "の NFS クライアントでは B<O_DIRECT> I/O でのアラインメントの制限はない。"
8321 #: build/C/man2/open.2:1434
8323 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
8324 "with caution. It is recommended that applications treat use of B<O_DIRECT> "
8325 "as a performance option which is disabled by default."
8327 "まとめると、 B<O_DIRECT> は、注意して使うべきであるが、強力なツールとなる可能"
8328 "性を持っている。 アプリケーションは B<O_DIRECT> をデフォルトでは無効になって"
8329 "いる性能向上のためのオプションと 考えておくのがよいであろう。"
8332 #: build/C/man2/open.2:1439
8334 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
8335 "interface is just stupid, and was probably designed by a deranged monkey on "
8336 "some serious mind-controlling substances.\"\\(emLinus"
8338 "「O_DIRECT でいつも困るのは、インタフェース全部が本当にお馬鹿な点だ。 たぶん"
8339 "危ないマインドコントロール剤で 頭がおかしくなったサルが設計したんじゃないか"
8342 #. FIXME . Check bugzilla report on open(O_ASYNC)
8343 #. See http://bugzilla.kernel.org/show_bug.cgi?id=5993
8345 #: build/C/man2/open.2:1451
8347 "Currently, it is not possible to enable signal-driven I/O by specifying "
8348 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2) to enable this flag."
8350 "現在のところ、 B<open>() の呼び出し時に B<O_ASYNC> を指定してシグナル駆動 I/"
8351 "O を有効にすることはできない。 このフラグを有効にするには B<fcntl>(2) を使用"
8355 #: build/C/man2/open.2:1459
8357 "One must check for two different error codes, B<EISDIR> and B<ENOENT>, when "
8358 "trying to determine whether the kernel supports B<O_TMPFILE> functionality."
8360 "カーネルが B<O_TMPFILE> 機能をサポートしているかを判定する際に、 B<EISDIR> "
8361 "と B<ENOENT> の 2 つのエラーコードをチェックしなければならない。"
8364 #: build/C/man2/open.2:1481
8366 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
8367 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<open_by_handle_at>(2), "
8368 "B<read>(2), B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), "
8369 "B<write>(2), B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
8371 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
8372 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<open_by_handle_at>(2), "
8373 "B<read>(2), B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), "
8374 "B<write>(2), B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
8377 #: build/C/man2/open_by_handle_at.2:25
8379 msgid "OPEN_BY_HANDLE_AT"
8380 msgstr "OPEN_BY_HANDLE_AT"
8383 #: build/C/man2/open_by_handle_at.2:25 build/C/man2/rename.2:33
8389 #: build/C/man2/open_by_handle_at.2:29
8391 "name_to_handle_at, open_by_handle_at - obtain handle for a pathname and open "
8396 #: build/C/man2/open_by_handle_at.2:35
8399 "B<#define _GNU_SOURCE>\n"
8400 "B<#include E<lt>sys/types.hE<gt>>\n"
8401 "B<#include E<lt>sys/stat.hE<gt>>\n"
8402 "B<#include E<lt>fcntl.hE<gt>>\n"
8404 "B<#define _GNU_SOURCE>\n"
8405 "B<#include E<lt>sys/types.hE<gt>>\n"
8406 "B<#include E<lt>sys/stat.hE<gt>>\n"
8407 "B<#include E<lt>fcntl.hE<gt>>\n"
8410 #: build/C/man2/open_by_handle_at.2:39
8413 "B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
8414 "B< struct file_handle *>I<handle>B<,>\n"
8415 "B< int *>I<mount_id>B<, int >I<flags>B<);>\n"
8417 "B<int name_to_handle_at(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
8418 "B< struct file_handle *>I<handle>B<,>\n"
8419 "B< int *>I<mount_id>B<, int >I<flags>B<);>\n"
8422 #: build/C/man2/open_by_handle_at.2:42
8425 "B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n"
8426 "B< int >I<flags>B<);>\n"
8428 "B<int open_by_handle_at(int >I<mount_fd>B<, struct file_handle *>I<handle>B<,>\n"
8429 "B< int >I<flags>B<);>\n"
8432 #: build/C/man2/open_by_handle_at.2:59
8434 "The B<name_to_handle_at>() and B<open_by_handle_at>() system calls split "
8435 "the functionality of B<openat>(2) into two parts: B<name_to_handle_at>() "
8436 "returns an opaque handle that corresponds to a specified file; "
8437 "B<open_by_handle_at>() opens the file corresponding to a handle returned by "
8438 "a previous call to B<name_to_handle_at>() and returns an open file "
8443 #: build/C/man2/open_by_handle_at.2:59
8445 msgid "name_to_handle_at()"
8449 #: build/C/man2/open_by_handle_at.2:71
8451 "The B<name_to_handle_at>() system call returns a file handle and a mount ID "
8452 "corresponding to the file specified by the I<dirfd> and I<pathname> "
8453 "arguments. The file handle is returned via the argument I<handle>, which is "
8454 "a pointer to a structure of the following form:"
8458 #: build/C/man2/open_by_handle_at.2:80
8461 "struct file_handle {\n"
8462 " unsigned int handle_bytes; /* Size of f_handle [in, out] */\n"
8463 " int handle_type; /* Handle type [out] */\n"
8464 " unsigned char f_handle[0]; /* File identifier (sized by\n"
8465 " caller) [out] */\n"
8470 #: build/C/man2/open_by_handle_at.2:99
8472 "It is the caller's responsibility to allocate the structure with a size "
8473 "large enough to hold the handle returned in I<f_handle>. Before the call, "
8474 "the I<handle_bytes> field should be initialized to contain the allocated "
8475 "size for I<f_handle>. (The constant B<MAX_HANDLE_SZ>, defined in "
8476 "I<E<lt>fcntl.hE<gt>>, specifies the maximum possible size for a file "
8477 "handle.) Upon successful return, the I<handle_bytes> field is updated to "
8478 "contain the number of bytes actually written to I<f_handle>."
8482 #: build/C/man2/open_by_handle_at.2:112
8484 "The caller can discover the required size for the I<file_handle> structure "
8485 "by making a call in which I<handle-E<gt>handle_bytes> is zero; in this case, "
8486 "the call fails with the error B<EOVERFLOW> and I<handle-E<gt>handle_bytes> "
8487 "is set to indicate the required size; the caller can then use this "
8488 "information to allocate a structure of the correct size (see EXAMPLE below)."
8492 #: build/C/man2/open_by_handle_at.2:123
8494 "Other than the use of the I<handle_bytes> field, the caller should treat the "
8495 "I<file_handle> structure as an opaque data type: the I<handle_type> and "
8496 "I<f_handle> fields are needed only by a subsequent call to "
8497 "B<open_by_handle_at>()."
8501 #: build/C/man2/open_by_handle_at.2:131
8503 "The I<flags> argument is a bit mask constructed by ORing together zero or "
8504 "more of B<AT_EMPTY_PATH> and B<AT_SYMLINK_FOLLOW>, described below."
8508 #: build/C/man2/open_by_handle_at.2:138
8510 "Together, the I<pathname> and I<dirfd> arguments identify the file for which "
8511 "a handle is to be obtained. There are four distinct cases:"
8515 #: build/C/man2/open_by_handle_at.2:146
8517 "If I<pathname> is a nonempty string containing an absolute pathname, then a "
8518 "handle is returned for the file referred to by that pathname. In this case, "
8519 "I<dirfd> is ignored."
8523 #: build/C/man2/open_by_handle_at.2:157
8525 "If I<pathname> is a nonempty string containing a relative pathname and "
8526 "I<dirfd> has the special value B<AT_FDCWD>, then I<pathname> is interpreted "
8527 "relative to the current working directory of the caller, and a handle is "
8528 "returned for the file to which it refers."
8530 "I<pathname> が相対パスが入った空でない文字列で、 I<dirfd> が特別な値 "
8531 "B<AT_FDCWD> の場合、 I<pathname> は呼び出し元のカレントワーキングディレクトリ"
8532 "に対する相対パスと解釈され、 そのファイルを参照するハンドルが返される。"
8535 #: build/C/man2/open_by_handle_at.2:170
8537 "If I<pathname> is a nonempty string containing a relative pathname and "
8538 "I<dirfd> is a file descriptor referring to a directory, then I<pathname> is "
8539 "interpreted relative to the directory referred to by I<dirfd>, and a handle "
8540 "is returned for the file to which it refers. (See B<openat>(3) for an "
8541 "explanation of why \"directory file descriptors\" are useful.)"
8545 #: build/C/man2/open_by_handle_at.2:184
8547 "If I<pathname> is an empty string and I<flags> specifies the value "
8548 "B<AT_EMPTY_PATH>, then I<dirfd> can be an open file descriptor referring to "
8549 "any type of file, or B<AT_FDCWD>, meaning the current working directory, and "
8550 "a handle is returned for the file to which it refers."
8554 #: build/C/man2/open_by_handle_at.2:196
8556 "The I<mount_id> argument returns an identifier for the filesystem mount that "
8557 "corresponds to I<pathname>. This corresponds to the first field in one of "
8558 "the records in I</proc/self/mountinfo>. Opening the pathname in the fifth "
8559 "field of that record yields a file descriptor for the mount point; that file "
8560 "descriptor can be used in a subsequent call to B<open_by_handle_at>()."
8564 #: build/C/man2/open_by_handle_at.2:209
8566 "By default, B<name_to_handle_at>() does not dereference I<pathname> if it "
8567 "is a symbolic link, and thus returns a handle for the link itself. If "
8568 "B<AT_SYMLINK_FOLLOW> is specified in I<flags>, I<pathname> is dereferenced "
8569 "if it is a symbolic link (so that the call returns a handle for the file "
8570 "referred to by the link)."
8574 #: build/C/man2/open_by_handle_at.2:209
8576 msgid "open_by_handle_at()"
8580 #: build/C/man2/open_by_handle_at.2:216
8582 "The B<open_by_handle_at>() system call opens the file referred to by "
8583 "I<handle>, a file handle returned by a previous call to "
8584 "B<name_to_handle_at>()."
8588 #: build/C/man2/open_by_handle_at.2:226
8590 "The I<mount_fd> argument is a file descriptor for any object (file, "
8591 "directory, etc.) in the mounted filesystem with respect to which I<handle> "
8592 "should be interpreted. The special value B<AT_FDCWD> can be specified, "
8593 "meaning the current working directory of the caller."
8597 #: build/C/man2/open_by_handle_at.2:239
8599 "The I<flags> argument is as for B<open>(2). If I<handle> refers to a "
8600 "symbolic link, the caller must specify the B<O_PATH> flag, and the symbolic "
8601 "link is not dereferenced; the B<O_NOFOLLOW> flag, if specified, is ignored."
8605 #: build/C/man2/open_by_handle_at.2:245
8607 "The caller must have the B<CAP_DAC_READ_SEARCH> capability to invoke "
8608 "B<open_by_handle_at>()."
8612 #: build/C/man2/open_by_handle_at.2:252
8614 "On success, B<name_to_handle_at>() returns 0, and B<open_by_handle_at>() "
8615 "returns a nonnegative file descriptor."
8619 #: build/C/man2/open_by_handle_at.2:256
8621 "In the event of an error, both system calls return -1 and set I<errno> to "
8622 "indicate the cause of the error."
8626 #: build/C/man2/open_by_handle_at.2:263
8628 "B<name_to_handle_at>() and B<open_by_handle_at>() can fail for the same "
8629 "errors as B<openat>(2). In addition, they can fail with the errors noted "
8634 #: build/C/man2/open_by_handle_at.2:266
8635 msgid "B<name_to_handle_at>() can fail with the following errors:"
8639 #: build/C/man2/open_by_handle_at.2:273
8641 "I<pathname>, I<mount_id>, or I<handle> points outside your accessible "
8644 "I<pathname>, I<mount_id>, I<handle> のどれかがアクセス可能なアドレス空間の外"
8648 #: build/C/man2/open_by_handle_at.2:277
8649 msgid "I<flags> includes an invalid bit value."
8653 #: build/C/man2/open_by_handle_at.2:282
8654 msgid "I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ>."
8658 #: build/C/man2/open_by_handle_at.2:289
8660 "I<pathname> is an empty string, but B<AT_EMPTY_PATH> was not specified in "
8663 "I<pathname> が空文字列だが、 I<flags> に B<AT_EMPTY_PATH> がされていなかっ"
8667 #: build/C/man2/open_by_handle_at.2:301
8669 "The file descriptor supplied in I<dirfd> does not refer to a directory, and "
8670 "it is not the case that both I<flags> includes B<AT_EMPTY_PATH> and "
8671 "I<pathname> is an empty string."
8675 #: build/C/man2/open_by_handle_at.2:304
8677 "The filesystem does not support decoding of a pathname to a file handle."
8681 #: build/C/man2/open_by_handle_at.2:314
8683 "The I<handle-E<gt>handle_bytes> value passed into the call was too small. "
8684 "When this error occurs, I<handle-E<gt>handle_bytes> is updated to indicate "
8685 "the required size for the handle."
8689 #: build/C/man2/open_by_handle_at.2:317
8690 msgid "B<open_by_handle_at>() can fail with the following errors:"
8694 #: build/C/man2/open_by_handle_at.2:321
8695 msgid "I<mount_fd> is not an open file descriptor."
8696 msgstr "I<mount_fd> がオープンされたファイルディスクリプタでない。"
8699 #: build/C/man2/open_by_handle_at.2:325
8700 msgid "I<handle> points outside your accessible address space."
8701 msgstr "I<handle> がアクセス可能なアドレス空間の外を指している。"
8704 #: build/C/man2/open_by_handle_at.2:331
8706 "I<handle-E<gt>handle_bytes> is greater than B<MAX_HANDLE_SZ> or is equal to "
8711 #: build/C/man2/open_by_handle_at.2:338
8713 "I<handle> refers to a symbolic link, but B<O_PATH> was not specified in "
8716 "I<handle> がシンボリックリンクを参照しているが、 I<flags> に B<O_PATH> がされ"
8720 #: build/C/man2/open_by_handle_at.2:343
8721 msgid "The caller does not have the B<CAP_DAC_READ_SEARCH> capability."
8722 msgstr "呼び出し元が B<CAP_DAC_READ_SEARCH> ケーパビリティを持っていない。"
8725 #: build/C/man2/open_by_handle_at.2:343
8731 #: build/C/man2/open_by_handle_at.2:349
8733 "The specified I<handle> is not valid. This error will occur if, for "
8734 "example, the file has been deleted."
8738 #: build/C/man2/open_by_handle_at.2:352
8740 "These system calls first appeared in Linux 2.6.39. Library support is "
8741 "provided in glibc since version 2.14."
8743 "これらのシステムコールは Linux 2.6.39 で初めて登場した。ライブラリによるサ"
8744 "ポートはバージョン 2.14 以降の glibc で提供されている。"
8747 #: build/C/man2/open_by_handle_at.2:354
8748 msgid "These system calls are nonstandard Linux extensions."
8752 #: build/C/man2/open_by_handle_at.2:359
8754 "FreeBSD has a broadly similar pair of system calls in the form of "
8755 "B<getfh>() and B<openfh>()."
8759 #: build/C/man2/open_by_handle_at.2:364
8761 "A file handle can be generated in one process using B<name_to_handle_at>() "
8762 "and later used in a different process that calls B<open_by_handle_at>()."
8766 #: build/C/man2/open_by_handle_at.2:370
8768 "Some filesystem don't support the translation of pathnames to file handles, "
8769 "for example, I</proc>, I</sys>, and various network filesystems."
8773 #: build/C/man2/open_by_handle_at.2:377
8775 "A file handle may become invalid (\"stale\") if a file is deleted, or for "
8776 "other filesystem-specific reasons. Invalid handles are notified by an "
8777 "B<ESTALE> error from B<open_by_handle_at>()."
8780 #. https://lwn.net/Articles/375888/
8781 #. "Open by handle" - Jonathan Corbet, 2010-02-23
8783 #: build/C/man2/open_by_handle_at.2:387
8785 "These system calls are designed for use by user-space file servers. For "
8786 "example, a user-space NFS server might generate a file handle and pass it to "
8787 "an NFS client. Later, when the client wants to open the file, it could pass "
8788 "the handle back to the server. This sort of functionality allows a user-"
8789 "space file server to operate in a stateless fashion with respect to the "
8793 #. commit bcda76524cd1fa32af748536f27f674a13e56700
8795 #: build/C/man2/open_by_handle_at.2:409
8797 "If I<pathname> refers to a symbolic link and I<flags> does not specify "
8798 "B<AT_SYMLINK_FOLLOW>, then B<name_to_handle_at>() returns a handle for the "
8799 "link (rather than the file to which it refers). The process receiving the "
8800 "handle can later perform operations on the symbolic link by converting the "
8801 "handle to a file descriptor using B<open_by_handle_at>() with the B<O_PATH> "
8802 "flag, and then passing the file descriptor as the I<dirfd> argument in "
8803 "system calls such as B<readlinkat>(2) and B<fchownat>(2)."
8807 #: build/C/man2/open_by_handle_at.2:409
8809 msgid "Obtaining a persistent filesystem ID"
8813 #: build/C/man2/open_by_handle_at.2:423
8815 "The mount IDs in I</proc/self/mountinfo> can be reused as filesystems are "
8816 "unmounted and mounted. Therefore, the mount ID returned by "
8817 "B<name_to_handle_at>() (in I<*mount_id>) should not be treated as a "
8818 "persistent identifier for the corresponding mounted filesystem. However, an "
8819 "application can use the information in the I<mountinfo> record that "
8820 "corresponds to the mount ID to derive a persistent identifier."
8823 #. e.g., http://stackoverflow.com/questions/6748429/using-libblkid-to-find-uuid-of-a-partition
8825 #: build/C/man2/open_by_handle_at.2:439
8827 "For example, one can use the device name in the fifth field of the "
8828 "I<mountinfo> record to search for the corresponding device UUID via the "
8829 "symbolic links in I</dev/disks/by-uuid>. (A more comfortable way of "
8830 "obtaining the UUID is to use the B<libblkid>(3) library.) That process can "
8831 "then be reversed, using the UUID to look up the device name, and then "
8832 "obtaining the corresponding mount point, in order to produce the I<mount_fd> "
8833 "argument used by B<open_by_handle_at>()."
8837 #: build/C/man2/open_by_handle_at.2:451
8839 "The two programs below demonstrate the use of B<name_to_handle_at>() and "
8840 "B<open_by_handle_at>(). The first program (I<t_name_to_handle_at.c>) uses "
8841 "B<name_to_handle_at>() to obtain the file handle and mount ID for the file "
8842 "specified in its command-line argument; the handle and mount ID are written "
8843 "to standard output."
8847 #: build/C/man2/open_by_handle_at.2:471
8849 "The second program (I<t_open_by_handle_at.c>) reads a mount ID and file "
8850 "handle from standard input. The program then employs "
8851 "B<open_by_handle_at>() to open the file using that handle. If an optional "
8852 "command-line argument is supplied, then the I<mount_fd> argument for "
8853 "B<open_by_handle_at>() is obtained by opening the directory named in that "
8854 "argument. Otherwise, I<mount_fd> is obtained by scanning I</proc/self/"
8855 "mountinfo> to find a record whose mount ID matches the mount ID read from "
8856 "standard input, and the mount directory specified in that record is opened. "
8857 "(These programs do not deal with the fact that mount IDs are not persistent.)"
8861 #: build/C/man2/open_by_handle_at.2:473
8862 msgid "The following shell session demonstrates the use of these two programs:"
8863 msgstr "以下のシェルセッションは、これら 2 つのプログラムの使用例である。"
8866 #: build/C/man2/open_by_handle_at.2:483
8869 "$ B<echo 'Can you please think about it?' E<gt> cecilia.txt>\n"
8870 "$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n"
8871 "$ B<./t_open_by_handle_at E<lt> fh>\n"
8872 "open_by_handle_at: Operation not permitted\n"
8873 "$ B<sudo ./t_open_by_handle_at E<lt> fh> # Need CAP_SYS_ADMIN\n"
8875 "$ B<rm cecilia.txt>\n"
8877 "$ B<echo 'Can you please think about it?' E<gt> cecilia.txt>\n"
8878 "$ B<./t_name_to_handle_at cecilia.txt E<gt> fh>\n"
8879 "$ B<./t_open_by_handle_at E<lt> fh>\n"
8880 "open_by_handle_at: Operation not permitted\n"
8881 "$ B<sudo ./t_open_by_handle_at E<lt> fh> # Need CAP_SYS_ADMIN\n"
8883 "$ B<rm cecilia.txt>\n"
8885 #. Christoph Hellwig: That's why the file handles contain a generation
8886 #. counter that gets incremented in this case.
8888 #: build/C/man2/open_by_handle_at.2:494
8890 "Now we delete and (quickly) re-create the file so that it has the same "
8891 "content and (by chance) the same inode. Nevertheless, "
8892 "B<open_by_handle_at>() recognizes that the original file referred to by the "
8893 "file handle no longer exists."
8897 #: build/C/man2/open_by_handle_at.2:505
8900 "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Display inode number\n"
8902 "$ B<rm cecilia.txt>\n"
8903 "$ B<echo 'Can you please think about it?' E<gt> cecilia.txt>\n"
8904 "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Check inode number\n"
8906 "$ B<sudo ./t_open_by_handle_at E<lt> fh>\n"
8907 "open_by_handle_at: Stale NFS file handle\n"
8909 "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Display inode number\n"
8911 "$ B<rm cecilia.txt>\n"
8912 "$ B<echo 'Can you please think about it?' E<gt> cecilia.txt>\n"
8913 "$ B<stat --printf=\"%i\\en\" cecilia.txt> # Check inode number\n"
8915 "$ B<sudo ./t_open_by_handle_at E<lt> fh>\n"
8916 "open_by_handle_at: Stale NFS file handle\n"
8919 #: build/C/man2/open_by_handle_at.2:507
8921 msgid "Program source: t_name_to_handle_at.c"
8925 #: build/C/man2/open_by_handle_at.2:519
8928 "#define _GNU_SOURCE\n"
8929 "#include E<lt>sys/types.hE<gt>\n"
8930 "#include E<lt>sys/stat.hE<gt>\n"
8931 "#include E<lt>fcntl.hE<gt>\n"
8932 "#include E<lt>stdio.hE<gt>\n"
8933 "#include E<lt>stdlib.hE<gt>\n"
8934 "#include E<lt>unistd.hE<gt>\n"
8935 "#include E<lt>errno.hE<gt>\n"
8936 "#include E<lt>string.hE<gt>\n"
8938 "#define _GNU_SOURCE\n"
8939 "#include E<lt>sys/types.hE<gt>\n"
8940 "#include E<lt>sys/stat.hE<gt>\n"
8941 "#include E<lt>fcntl.hE<gt>\n"
8942 "#include E<lt>stdio.hE<gt>\n"
8943 "#include E<lt>stdlib.hE<gt>\n"
8944 "#include E<lt>unistd.hE<gt>\n"
8945 "#include E<lt>errno.hE<gt>\n"
8946 "#include E<lt>string.hE<gt>\n"
8949 #: build/C/man2/open_by_handle_at.2:522 build/C/man2/open_by_handle_at.2:595
8952 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
8955 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
8959 #: build/C/man2/open_by_handle_at.2:529
8963 "main(int argc, char *argv[])\n"
8965 " struct file_handle *fhp;\n"
8966 " int mount_id, fhsize, flags, dirfd, j;\n"
8967 " char *pathname;\n"
8970 "main(int argc, char *argv[])\n"
8972 " struct file_handle *fhp;\n"
8973 " int mount_id, fhsize, flags, dirfd, j;\n"
8974 " char *pathname;\n"
8977 #: build/C/man2/open_by_handle_at.2:534
8980 " if (argc != 2) {\n"
8981 " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n"
8982 " exit(EXIT_FAILURE);\n"
8985 " if (argc != 2) {\n"
8986 " fprintf(stderr, \"Usage: %s pathname\\en\", argv[0]);\n"
8987 " exit(EXIT_FAILURE);\n"
8991 #: build/C/man2/open_by_handle_at.2:536
8993 msgid " pathname = argv[1];\n"
8994 msgstr " pathname = argv[1];\n"
8997 #: build/C/man2/open_by_handle_at.2:538
8999 msgid " /* Allocate file_handle structure */\n"
9000 msgstr " /* Allocate file_handle structure */\n"
9003 #: build/C/man2/open_by_handle_at.2:543
9006 " fhsize = sizeof(*fhp);\n"
9007 " fhp = malloc(fhsize);\n"
9008 " if (fhp == NULL)\n"
9009 " errExit(\"malloc\");\n"
9011 " fhsize = sizeof(*fhp);\n"
9012 " fhp = malloc(fhsize);\n"
9013 " if (fhp == NULL)\n"
9014 " errExit(\"malloc\");\n"
9017 #: build/C/man2/open_by_handle_at.2:546
9020 " /* Make an initial call to name_to_handle_at() to discover\n"
9021 " the size required for file handle */\n"
9023 " /* Make an initial call to name_to_handle_at() to discover\n"
9024 " the size required for file handle */\n"
9027 #: build/C/man2/open_by_handle_at.2:555
9030 " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n"
9031 " flags = 0; /* For name_to_handle_at() calls */\n"
9032 " fhp-E<gt>handle_bytes = 0;\n"
9033 " if (name_to_handle_at(dirfd, pathname, fhp,\n"
9034 " &mount_id, flags) != -1 || errno != EOVERFLOW) {\n"
9035 " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
9036 " exit(EXIT_FAILURE);\n"
9039 " dirfd = AT_FDCWD; /* For name_to_handle_at() calls */\n"
9040 " flags = 0; /* For name_to_handle_at() calls */\n"
9041 " fhp-E<gt>handle_bytes = 0;\n"
9042 " if (name_to_handle_at(dirfd, pathname, fhp,\n"
9043 " &mount_id, flags) != -1 || errno != EOVERFLOW) {\n"
9044 " fprintf(stderr, \"Unexpected result from name_to_handle_at()\\en\");\n"
9045 " exit(EXIT_FAILURE);\n"
9049 #: build/C/man2/open_by_handle_at.2:557
9051 msgid " /* Reallocate file_handle structure with correct size */\n"
9052 msgstr " /* Reallocate file_handle structure with correct size */\n"
9055 #: build/C/man2/open_by_handle_at.2:562
9058 " fhsize = sizeof(struct file_handle) + fhp-E<gt>handle_bytes;\n"
9059 " fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n"
9060 " if (fhp == NULL)\n"
9061 " errExit(\"realloc\");\n"
9063 " fhsize = sizeof(struct file_handle) + fhp-E<gt>handle_bytes;\n"
9064 " fhp = realloc(fhp, fhsize); /* Copies fhp-E<gt>handle_bytes */\n"
9065 " if (fhp == NULL)\n"
9066 " errExit(\"realloc\");\n"
9069 #: build/C/man2/open_by_handle_at.2:564
9071 msgid " /* Get file handle from pathname supplied on command line */\n"
9072 msgstr " /* Get file handle from pathname supplied on command line */\n"
9075 #: build/C/man2/open_by_handle_at.2:567
9078 " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n"
9079 " errExit(\"name_to_handle_at\");\n"
9081 " if (name_to_handle_at(dirfd, pathname, fhp, &mount_id, flags) == -1)\n"
9082 " errExit(\"name_to_handle_at\");\n"
9085 #: build/C/man2/open_by_handle_at.2:570
9088 " /* Write mount ID, file handle size, and file handle to stdout,\n"
9089 " for later reuse by t_open_by_handle_at.c */\n"
9091 " /* Write mount ID, file handle size, and file handle to stdout,\n"
9092 " for later reuse by t_open_by_handle_at.c */\n"
9095 #: build/C/man2/open_by_handle_at.2:576
9098 " printf(\"%d\\en\", mount_id);\n"
9099 " printf(\"%d %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n"
9100 " for (j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
9101 " printf(\" %02x\", fhp-E<gt>f_handle[j]);\n"
9102 " printf(\"\\en\");\n"
9104 " printf(\"%d\\en\", mount_id);\n"
9105 " printf(\"%d %d \", fhp-E<gt>handle_bytes, fhp-E<gt>handle_type);\n"
9106 " for (j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
9107 " printf(\" %02x\", fhp-E<gt>f_handle[j]);\n"
9108 " printf(\"\\en\");\n"
9111 #: build/C/man2/open_by_handle_at.2:580
9113 msgid "Program source: t_open_by_handle_at.c"
9117 #: build/C/man2/open_by_handle_at.2:592
9120 "#define _GNU_SOURCE\n"
9121 "#include E<lt>sys/types.hE<gt>\n"
9122 "#include E<lt>sys/stat.hE<gt>\n"
9123 "#include E<lt>fcntl.hE<gt>\n"
9124 "#include E<lt>limits.hE<gt>\n"
9125 "#include E<lt>stdio.hE<gt>\n"
9126 "#include E<lt>stdlib.hE<gt>\n"
9127 "#include E<lt>unistd.hE<gt>\n"
9128 "#include E<lt>string.hE<gt>\n"
9130 "#define _GNU_SOURCE\n"
9131 "#include E<lt>sys/types.hE<gt>\n"
9132 "#include E<lt>sys/stat.hE<gt>\n"
9133 "#include E<lt>fcntl.hE<gt>\n"
9134 "#include E<lt>limits.hE<gt>\n"
9135 "#include E<lt>stdio.hE<gt>\n"
9136 "#include E<lt>stdlib.hE<gt>\n"
9137 "#include E<lt>unistd.hE<gt>\n"
9138 "#include E<lt>string.hE<gt>\n"
9141 #: build/C/man2/open_by_handle_at.2:601
9144 "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
9145 " \\(aqmount_id\\(aq. (An easier way to do this is to install and use the\n"
9146 " \\(aqlibmount\\(aq library provided by the \\(aqutil-linux\\(aq project.)\n"
9147 " Open the corresponding mount path and return the resulting file\n"
9150 "/* Scan /proc/self/mountinfo to find the line whose mount ID matches\n"
9151 " \\(aqmount_id\\(aq. (An easier way to do this is to install and use the\n"
9152 " \\(aqlibmount\\(aq library provided by the \\(aqutil-linux\\(aq project.)\n"
9153 " Open the corresponding mount path and return the resulting file\n"
9157 #: build/C/man2/open_by_handle_at.2:611
9161 "open_mount_path_by_id(int mount_id)\n"
9165 " char mount_path[PATH_MAX];\n"
9166 " int mi_mount_id, found;\n"
9171 "open_mount_path_by_id(int mount_id)\n"
9175 " char mount_path[PATH_MAX];\n"
9176 " int mi_mount_id, found;\n"
9181 #: build/C/man2/open_by_handle_at.2:615
9184 " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
9185 " if (fp == NULL)\n"
9186 " errExit(\"fopen\");\n"
9188 " fp = fopen(\"/proc/self/mountinfo\", \"r\");\n"
9189 " if (fp == NULL)\n"
9190 " errExit(\"fopen\");\n"
9193 #: build/C/man2/open_by_handle_at.2:622
9198 " while (!found) {\n"
9199 " nread = getline(&linep, &lsize, fp);\n"
9200 " if (nread == -1)\n"
9205 " while (!found) {\n"
9206 " nread = getline(&linep, &lsize, fp);\n"
9207 " if (nread == -1)\n"
9211 #: build/C/man2/open_by_handle_at.2:629
9214 " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
9215 " &mi_mount_id, mount_path);\n"
9216 " if (nread != 2) {\n"
9217 " fprintf(stderr, \"Bad sscanf()\\en\");\n"
9218 " exit(EXIT_FAILURE);\n"
9221 " nread = sscanf(linep, \"%d %*d %*s %*s %s\",\n"
9222 " &mi_mount_id, mount_path);\n"
9223 " if (nread != 2) {\n"
9224 " fprintf(stderr, \"Bad sscanf()\\en\");\n"
9225 " exit(EXIT_FAILURE);\n"
9229 #: build/C/man2/open_by_handle_at.2:634
9232 " if (mi_mount_id == mount_id)\n"
9237 " if (mi_mount_id == mount_id)\n"
9243 #: build/C/man2/open_by_handle_at.2:636
9245 msgid " fclose(fp);\n"
9246 msgstr " fclose(fp);\n"
9249 #: build/C/man2/open_by_handle_at.2:641
9253 " fprintf(stderr, \"Could not find mount point\\en\");\n"
9254 " exit(EXIT_FAILURE);\n"
9258 " fprintf(stderr, \"Could not find mount point\\en\");\n"
9259 " exit(EXIT_FAILURE);\n"
9263 #: build/C/man2/open_by_handle_at.2:644
9266 " return open(mount_path, O_RDONLY);\n"
9269 " return open(mount_path, O_RDONLY);\n"
9273 #: build/C/man2/open_by_handle_at.2:655
9277 "main(int argc, char *argv[])\n"
9279 " struct file_handle *fhp;\n"
9280 " int mount_id, fd, mount_fd, handle_bytes, j;\n"
9282 " char buf[1000];\n"
9283 "#define LINE_SIZE 100\n"
9284 " char line1[LINE_SIZE], line2[LINE_SIZE];\n"
9288 "main(int argc, char *argv[])\n"
9290 " struct file_handle *fhp;\n"
9291 " int mount_id, fd, mount_fd, handle_bytes, j;\n"
9293 " char buf[1000];\n"
9294 "#define LINE_SIZE 100\n"
9295 " char line1[LINE_SIZE], line2[LINE_SIZE];\n"
9299 #: build/C/man2/open_by_handle_at.2:660
9302 " if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
9303 " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n"
9304 " exit(EXIT_FAILURE);\n"
9307 " if ((argc E<gt> 1 && strcmp(argv[1], \"--help\") == 0) || argc E<gt> 2) {\n"
9308 " fprintf(stderr, \"Usage: %s [mount-path]\\en\", argv[0]);\n"
9309 " exit(EXIT_FAILURE);\n"
9313 #: build/C/man2/open_by_handle_at.2:662
9315 msgid " /* Standard input contains mount ID and file handle information:\n"
9316 msgstr " /* Standard input contains mount ID and file handle information:\n"
9319 #: build/C/man2/open_by_handle_at.2:666
9322 " Line 1: E<lt>mount_idE<gt>\n"
9323 " Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n"
9326 " Line 1: E<lt>mount_idE<gt>\n"
9327 " Line 2: E<lt>handle_bytesE<gt> E<lt>handle_typeE<gt> E<lt>bytes of handle in hexE<gt>\n"
9331 #: build/C/man2/open_by_handle_at.2:672
9334 " if ((fgets(line1, sizeof(line1), stdin) == NULL) ||\n"
9335 " (fgets(line2, sizeof(line2), stdin) == NULL)) {\n"
9336 " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
9337 " exit(EXIT_FAILURE);\n"
9340 " if ((fgets(line1, sizeof(line1), stdin) == NULL) ||\n"
9341 " (fgets(line2, sizeof(line2), stdin) == NULL)) {\n"
9342 " fprintf(stderr, \"Missing mount_id / file handle\\en\");\n"
9343 " exit(EXIT_FAILURE);\n"
9347 #: build/C/man2/open_by_handle_at.2:674
9349 msgid " mount_id = atoi(line1);\n"
9350 msgstr " mount_id = atoi(line1);\n"
9353 #: build/C/man2/open_by_handle_at.2:676
9355 msgid " handle_bytes = strtoul(line2, &nextp, 0);\n"
9356 msgstr " handle_bytes = strtoul(line2, &nextp, 0);\n"
9359 #: build/C/man2/open_by_handle_at.2:678
9361 msgid " /* Given handle_bytes, we can now allocate file_handle structure */\n"
9362 msgstr " /* Given handle_bytes, we can now allocate file_handle structure */\n"
9365 #: build/C/man2/open_by_handle_at.2:682
9368 " fhp = malloc(sizeof(struct file_handle) + handle_bytes);\n"
9369 " if (fhp == NULL)\n"
9370 " errExit(\"malloc\");\n"
9372 " fhp = malloc(sizeof(struct file_handle) + handle_bytes);\n"
9373 " if (fhp == NULL)\n"
9374 " errExit(\"malloc\");\n"
9377 #: build/C/man2/open_by_handle_at.2:684
9379 msgid " fhp-E<gt>handle_bytes = handle_bytes;\n"
9380 msgstr " fhp-E<gt>handle_bytes = handle_bytes;\n"
9383 #: build/C/man2/open_by_handle_at.2:686
9385 msgid " fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"
9386 msgstr " fhp-E<gt>handle_type = strtoul(nextp, &nextp, 0);\n"
9389 #: build/C/man2/open_by_handle_at.2:689
9392 " for (j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
9393 " fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"
9395 " for (j = 0; j E<lt> fhp-E<gt>handle_bytes; j++)\n"
9396 " fhp-E<gt>f_handle[j] = strtoul(nextp, &nextp, 16);\n"
9399 #: build/C/man2/open_by_handle_at.2:694
9402 " /* Obtain file descriptor for mount point, either by opening\n"
9403 " the pathname specified on the command line, or by scanning\n"
9404 " /proc/self/mounts to find a mount that matches the \\(aqmount_id\\(aq\n"
9405 " that we received from stdin. */\n"
9407 " /* Obtain file descriptor for mount point, either by opening\n"
9408 " the pathname specified on the command line, or by scanning\n"
9409 " /proc/self/mounts to find a mount that matches the \\(aqmount_id\\(aq\n"
9410 " that we received from stdin. */\n"
9413 #: build/C/man2/open_by_handle_at.2:699
9416 " if (argc E<gt> 1)\n"
9417 " mount_fd = open(argv[1], O_RDONLY);\n"
9419 " mount_fd = open_mount_path_by_id(mount_id);\n"
9421 " if (argc E<gt> 1)\n"
9422 " mount_fd = open(argv[1], O_RDONLY);\n"
9424 " mount_fd = open_mount_path_by_id(mount_id);\n"
9427 #: build/C/man2/open_by_handle_at.2:702
9430 " if (mount_fd == -1)\n"
9431 " errExit(\"opening mount fd\");\n"
9433 " if (mount_fd == -1)\n"
9434 " errExit(\"opening mount fd\");\n"
9437 #: build/C/man2/open_by_handle_at.2:704
9439 msgid " /* Open file using handle and mount point */\n"
9440 msgstr " /* Open file using handle and mount point */\n"
9443 #: build/C/man2/open_by_handle_at.2:708
9446 " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
9448 " errExit(\"open_by_handle_at\");\n"
9450 " fd = open_by_handle_at(mount_fd, fhp, O_RDONLY);\n"
9452 " errExit(\"open_by_handle_at\");\n"
9455 #: build/C/man2/open_by_handle_at.2:710
9457 msgid " /* Try reading a few bytes from the file */\n"
9458 msgstr " /* Try reading a few bytes from the file */\n"
9461 #: build/C/man2/open_by_handle_at.2:714
9464 " nread = read(fd, buf, sizeof(buf));\n"
9465 " if (nread == -1)\n"
9466 " errExit(\"read\");\n"
9468 " nread = read(fd, buf, sizeof(buf));\n"
9469 " if (nread == -1)\n"
9470 " errExit(\"read\");\n"
9473 #: build/C/man2/open_by_handle_at.2:716
9475 msgid " printf(\"Read %zd bytes\\en\", nread);\n"
9476 msgstr " printf(\"Read %zd bytes\\en\", nread);\n"
9479 #: build/C/man2/open_by_handle_at.2:726
9480 msgid "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)"
9481 msgstr "B<open>(2), B<libblkid>(3), B<blkid>(8), B<findfs>(8), B<mount>(8)"
9484 #: build/C/man2/open_by_handle_at.2:736
9486 "The I<libblkid> and I<libmount> documentation in the latest I<util-linux> "
9487 "release at E<.UR https://www.kernel.org/pub/linux/utils/util-linux/> E<.UE>"
9491 #: build/C/man3/perror.3:31
9497 #: build/C/man3/perror.3:34
9498 msgid "perror - print a system error message"
9499 msgstr "perror - システムエラーメッセージを出力する"
9502 #: build/C/man3/perror.3:38
9503 msgid "B<void perror(const char *>I<s>B<);>"
9504 msgstr "B<void perror(const char *>I<s>B<);>"
9507 #: build/C/man3/perror.3:40
9508 msgid "B<#include E<lt>errno.hE<gt>>"
9509 msgstr "B<#include E<lt>errno.hE<gt>>"
9512 #: build/C/man3/perror.3:42
9514 #| msgid "B<const char *>I<sys_errlist>B<[];>"
9515 msgid "B<const char * const >I<sys_errlist>B<[];>"
9516 msgstr "B<const char *>I<sys_errlist>B<[];>"
9519 #: build/C/man3/perror.3:44
9520 msgid "B<int >I<sys_nerr>B<;>"
9521 msgstr "B<int >I<sys_nerr>B<;>"
9524 #: build/C/man3/perror.3:46
9525 msgid "B<int >I<errno>B<; /* Not really declared this way; see errno(3). */>"
9529 #: build/C/man3/perror.3:55
9530 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
9531 msgstr "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
9534 #: build/C/man3/perror.3:68
9536 "The routine B<perror>() produces a message on the standard error output, "
9537 "describing the last error encountered during a call to a system or library "
9538 "function. First (if I<s> is not NULL and I<*s> is not a null byte (\\(aq"
9539 "\\e0\\(aq)) the argument string I<s> is printed, followed by a colon and a "
9540 "blank. Then the message and a new-line."
9542 "関数 B<perror>() は、システムコールやライブラリ関数の呼び出しにおいて、最後"
9543 "に発生した エラーに関する説明メッセージを生成し、標準エラー出力に出力する。 "
9544 "(I<s> が NULL でなく、 I<*s> がヌルバイト (\\(aq\\e0\\(aq) でない場合には) 引"
9545 "き数の文字列 I<s> がまず出力され、続いてコロン、空白が出力され、 それからメッ"
9549 #: build/C/man3/perror.3:76
9551 "To be of most use, the argument string should include the name of the "
9552 "function that incurred the error. The error number is taken from the "
9553 "external variable I<errno>, which is set when errors occur but not cleared "
9554 "when successful calls are made."
9556 "このメッセージを最大限活用するためには、引き数文字列にエラーが発生した 関数名"
9557 "を入れておくとよい。 エラー番号は外部変数 I<errno> から取得される。 I<errno> "
9558 "はエラーが発生した時に設定され、 成功した呼び出しではクリアされない。"
9561 #: build/C/man3/perror.3:90
9563 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
9564 "obtain the error message without the newline. The largest message number "
9565 "provided in the table is I<sys_nerr>-1. Be careful when directly accessing "
9566 "this list because new error values may not have been added to "
9567 "I<sys_errlist>[]. The use of I<sys_errlist>[] is nowadays deprecated."
9569 "大域変数のエラーリスト I<sys_errlist>[] は I<errno> を添字とする配列で、こ"
9571 "配列から改行無しのエラーメッセージが取得される。 テーブルでの最大のメッセー"
9573 "番号は I<sys_nerr> -1 となる。 このテーブルを直接参照する際には注意するこ"
9575 "なぜなら、新しいエラー番号が I<sys_errlist>[] に追加済とは限らないからであ"
9577 "現在では、I<sys_errlist>[] の使用は非推奨となっている。"
9580 #: build/C/man3/perror.3:111
9582 "When a system call fails, it usually returns -1 and sets the variable "
9583 "I<errno> to a value describing what went wrong. (These values can be found "
9584 "in I<E<lt>errno.hE<gt>>.) Many library functions do likewise. The function "
9585 "B<perror>() serves to translate this error code into human-readable form. "
9586 "Note that I<errno> is undefined after a successful library call: this call "
9587 "may well change this variable, even though it succeeds, for example because "
9588 "it internally used some other library function that failed. Thus, if a "
9589 "failing call is not immediately followed by a call to B<perror>(), the value "
9590 "of I<errno> should be saved."
9592 "システムコールが失敗した場合、通常、返り値として -1 が返り、 I<errno> にエ"
9593 "ラーを識別する値が設定される (設定されるエラー番号は I<E<lt>errno.hE<gt>> に"
9594 "記載されている)。 多くのライブラリ関数も同様の動作となる。 関数 B<perror>() "
9595 "は、このエラーコードの可読なメッセージへの変換を行う。 I<errno> は、ライブラ"
9596 "リ呼び出しが成功した後には未定義であることに注意が必要である: その呼び出し自"
9597 "身は成功したとしても、内部で呼び出した他のライブラリ関数が 失敗して、その結果"
9598 "をこの変数に設定することがあるからだ。 よって、失敗した呼び出しの直後に "
9599 "B<perror>() を呼ばない場合には I<errno> の値を 保存しておかなければならな"
9603 #: build/C/man3/perror.3:124
9605 "The function B<perror>() and the external I<errno> (see B<errno>(3)) "
9606 "conform to C89, C99, 4.3BSD, POSIX.1-2001. The externals I<sys_nerr> and "
9607 "I<sys_errlist> conform to BSD."
9609 "関数 B<perror>() と外部変数 I<errno> (B<errno>(3) 参照) は C89, 4.3BSD, "
9610 "POSIX.1-2001 に準拠している。 外部変数 I<sys_nerr> と I<sys_errlist> は BSD "
9613 #. and only when _BSD_SOURCE is defined.
9616 #. is defined, the symbols
9622 #: build/C/man3/perror.3:139
9624 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
9625 "I<E<lt>stdio.hE<gt>>."
9627 "外部変数 I<sys_nerr> と I<sys_errlist> は glibc で定義されているが、 "
9628 "I<E<lt>stdio.hE<gt>> に含まれている。"
9631 #: build/C/man3/perror.3:144
9632 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
9633 msgstr "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
9636 #: build/C/man2/pipe.2:36
9642 #: build/C/man2/pipe.2:36
9648 #: build/C/man2/pipe.2:39
9649 msgid "pipe, pipe2 - create pipe"
9650 msgstr "pipe, pipe2 - パイプを生成する"
9653 #: build/C/man2/pipe.2:44
9655 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
9656 msgstr "B<int pipe(int >I<pipefd>B<[2]);>\n"
9659 #: build/C/man2/pipe.2:48
9662 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
9663 "B<#include E<lt>fcntl.hE<gt>> /* Obtain O_* constant definitions */\n"
9664 "B<#include E<lt>unistd.hE<gt>>\n"
9666 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
9667 "B<#include E<lt>fcntl.hE<gt>> /* O_* 定数の定義の取得 */\n"
9668 "B<#include E<lt>unistd.hE<gt>>\n"
9671 #: build/C/man2/pipe.2:50
9673 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
9674 msgstr "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
9677 #: build/C/man2/pipe.2:66
9679 "B<pipe>() creates a pipe, a unidirectional data channel that can be used "
9680 "for interprocess communication. The array I<pipefd> is used to return two "
9681 "file descriptors referring to the ends of the pipe. I<pipefd[0]> refers to "
9682 "the read end of the pipe. I<pipefd[1]> refers to the write end of the "
9683 "pipe. Data written to the write end of the pipe is buffered by the kernel "
9684 "until it is read from the read end of the pipe. For further details, see "
9687 "B<pipe>() はパイプを生成する。 パイプは、プロセス間通信に使用できる単方向の"
9688 "データチャネルである。 配列 I<pipefd> は、パイプの両端を参照する二つのファイ"
9689 "ルディスクリプタを 返すのに使用される。 I<pipefd[0]> がパイプの読み出し側、 "
9690 "I<pipefd[1]> がパイプの書き込み側である。 パイプの書き込み側に書き込まれた"
9691 "データは、 パイプの読み出し側から読み出されるまでカーネルでバッファリングされ"
9692 "る。 さらなる詳細は B<pipe>(7) を参照のこと。"
9695 #: build/C/man2/pipe.2:76
9697 "If I<flags> is 0, then B<pipe2>() is the same as B<pipe>(). The following "
9698 "values can be bitwise ORed in I<flags> to obtain different behavior:"
9700 "B<pipe2>() は I<flags> が 0 の場合には B<pipe>() と同じである。 I<flags> に"
9701 "以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることがで"
9705 #: build/C/man2/pipe.2:76
9707 msgid "B<O_CLOEXEC>"
9708 msgstr "B<O_CLOEXEC>"
9711 #: build/C/man2/pipe.2:84
9713 "Set the close-on-exec (B<FD_CLOEXEC>) flag on the two new file "
9714 "descriptors. See the description of the same flag in B<open>(2) for "
9715 "reasons why this may be useful."
9717 "新しく生成される二つのファイルディスクリプタの close-on-exec "
9718 "(B<FD_CLOEXEC>) フラグをセットする。 このフラグが役に立つ理由については、 "
9719 "B<open>(2) の B<O_CLOEXEC> フラグの説明を参照のこと。"
9722 #: build/C/man2/pipe.2:84
9724 msgid "B<O_DIRECT> (since Linux 3.4)"
9725 msgstr "B<O_DIRECT> (Linux 3.4 以降)"
9727 #. commit 9883035ae7edef3ec62ad215611cb8e17d6a1a5d
9729 #: build/C/man2/pipe.2:94
9731 "Create a pipe that performs I/O in \"packet\" mode. Each B<write>(2) to "
9732 "the pipe is dealt with as a separate packet, and B<read>(2)s from the pipe "
9733 "will read one packet at a time. Note the following points:"
9735 "「パケット」モードで入出力を行うパイプを作成する。 このパイプへの "
9736 "B<write>(2) それぞれが別のパケットとして扱われ、 このパイプからの B<read>(2) "
9737 "では一度に一つパケットが読み出される。 以下の点に注意すること。"
9740 #: build/C/man2/pipe.2:101
9742 "Writes of greater than B<PIPE_BUF> bytes (see B<pipe>(7)) will be split "
9743 "into multiple packets."
9745 "B<PIPE_BUF> バイト (B<pipe>(7) 参照) より大きいデータを書き込んだ場合、複数の"
9749 #: build/C/man2/pipe.2:111
9751 "If a B<read>(2) specifies a buffer size that is smaller than the next "
9752 "packet, then the requested number of bytes are read, and the excess bytes in "
9753 "the packet are discarded. Specifying a buffer size of B<PIPE_BUF> will be "
9754 "sufficient to read the largest possible packets (see the previous point)."
9756 "B<read>(2) で次のパケットよりも小さなバッファサイズを指定した場合、要求された"
9757 "バイト数のデータが読み出され、そのパケットの超過分のバイトは破棄される。 可能"
9758 "性のある最大サイズのパケットを読み出すには、B<PIPE_BUF> のバッファサイズを指"
9759 "定すれば十分である (上の項目を参照)。"
9762 #: build/C/man2/pipe.2:116
9764 "Zero-length packets are not supported. (A B<read>(2) that specifies a "
9765 "buffer size of zero is a no-op, and returns 0.)"
9767 "長さ 0 のパケットはサポートされていない。 (バッファサイズ 0 を指定した "
9768 "B<read>(2) は何も行わず 0 を返す)。"
9771 #: build/C/man2/pipe.2:121
9773 "Older kernels that do not support this flag will indicate this via an "
9776 "このフラグをサポートしていない古いカーネルでは、エラー B<EINVAL> が返る。これ"
9777 "によりカーネルがサポートしていないことが分かる。"
9780 #: build/C/man2/pipe.2:121
9782 msgid "B<O_NONBLOCK>"
9783 msgstr "B<O_NONBLOCK>"
9786 #: build/C/man2/pipe.2:129
9788 "Set the B<O_NONBLOCK> file status flag on the two new open file "
9789 "descriptions. Using this flag saves extra calls to B<fcntl>(2) to achieve "
9792 "新しく生成される二つのオープンファイル記述 (open file description) の "
9793 "B<O_NONBLOCK> ファイルステータスフラグをセットする。 このフラグを使うこと"
9794 "で、 B<O_NONBLOCK> をセットするために B<fcntl>(2) を追加で呼び出す必要がなく"
9798 #: build/C/man2/pipe.2:139
9799 msgid "I<pipefd> is not valid."
9800 msgstr "I<pipefd> が無効な値である。"
9803 #: build/C/man2/pipe.2:144
9804 msgid "(B<pipe2>()) Invalid value in I<flags>."
9805 msgstr "(B<pipe2>()) I<flags> に無効な値が入っている。"
9808 #: build/C/man2/pipe.2:147
9809 msgid "Too many file descriptors are in use by the process."
9810 msgstr "このプロセスで使われているファイルディスクリプタが多すぎる。"
9813 #: build/C/man2/pipe.2:155
9815 "B<pipe2>() was added to Linux in version 2.6.27; glibc support is available "
9816 "starting with version 2.9."
9818 "B<pipe2>() はバージョン 2.6.27 で Linux に追加された。 glibc によるサポート"
9819 "はバージョン 2.9 以降で利用できる。"
9822 #: build/C/man2/pipe.2:158
9823 msgid "B<pipe>(): POSIX.1-2001."
9824 msgstr "B<pipe>(): POSIX.1-2001."
9827 #: build/C/man2/pipe.2:161
9828 msgid "B<pipe2>() is Linux-specific."
9829 msgstr "B<pipe2>() は Linux 固有である。"
9831 #. fork.2 refers to this example program.
9833 #: build/C/man2/pipe.2:177
9835 "The following program creates a pipe, and then B<fork>(2)s to create a child "
9836 "process; the child inherits a duplicate set of file descriptors that refer "
9837 "to the same pipe. After the B<fork>(2), each process closes the descriptors "
9838 "that it doesn't need for the pipe (see B<pipe>(7)). The parent then writes "
9839 "the string contained in the program's command-line argument to the pipe, and "
9840 "the child reads this string a byte at a time from the pipe and echoes it on "
9843 "以下のプログラムではパイプを生成し、その後 B<fork>(2) で子プロセスを生成す"
9844 "る。 子プロセスは同じパイプを参照するファイルディスクリプタ集合のコピーを 継"
9845 "承する。 B<fork>(2) の後、各プロセスはパイプ (B<pipe>(7) を参照) に必要がな"
9846 "くなったディスクリプタをクローズする。 親プロセスはプログラムのコマンドライン"
9847 "引き数に含まれる 文字列をパイプへ書き込み、 子プロセスはこの文字列をパイプか"
9848 "ら 1 バイトずつ読み込んで標準出力にエコーする。"
9851 #: build/C/man2/pipe.2:185
9854 "#include E<lt>sys/types.hE<gt>\n"
9855 "#include E<lt>sys/wait.hE<gt>\n"
9856 "#include E<lt>stdio.hE<gt>\n"
9857 "#include E<lt>stdlib.hE<gt>\n"
9858 "#include E<lt>unistd.hE<gt>\n"
9859 "#include E<lt>string.hE<gt>\n"
9861 "#include E<lt>sys/types.hE<gt>\n"
9862 "#include E<lt>sys/wait.hE<gt>\n"
9863 "#include E<lt>stdio.hE<gt>\n"
9864 "#include E<lt>stdlib.hE<gt>\n"
9865 "#include E<lt>unistd.hE<gt>\n"
9866 "#include E<lt>string.hE<gt>\n"
9869 #: build/C/man2/pipe.2:192
9873 "main(int argc, char *argv[])\n"
9880 "main(int argc, char *argv[])\n"
9887 #: build/C/man2/pipe.2:197
9890 " if (argc != 2) {\n"
9891 " fprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
9892 " exit(EXIT_FAILURE);\n"
9895 " if (argc != 2) {\n"
9896 " fprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
9897 " exit(EXIT_FAILURE);\n"
9901 #: build/C/man2/pipe.2:202
9904 " if (pipe(pipefd) == -1) {\n"
9905 " perror(\"pipe\");\n"
9906 " exit(EXIT_FAILURE);\n"
9909 " if (pipe(pipefd) == -1) {\n"
9910 " perror(\"pipe\");\n"
9911 " exit(EXIT_FAILURE);\n"
9915 #: build/C/man2/pipe.2:208
9919 " if (cpid == -1) {\n"
9920 " perror(\"fork\");\n"
9921 " exit(EXIT_FAILURE);\n"
9925 " if (cpid == -1) {\n"
9926 " perror(\"fork\");\n"
9927 " exit(EXIT_FAILURE);\n"
9931 #: build/C/man2/pipe.2:211
9934 " if (cpid == 0) { /* Child reads from pipe */\n"
9935 " close(pipefd[1]); /* Close unused write end */\n"
9937 " if (cpid == 0) { /* 子プロセスがパイプから読み込む */\n"
9938 " close(pipefd[1]); /* 使用しない write 側はクローズする */\n"
9941 #: build/C/man2/pipe.2:214
9944 " while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
9945 " write(STDOUT_FILENO, &buf, 1);\n"
9947 " while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
9948 " write(STDOUT_FILENO, &buf, 1);\n"
9951 #: build/C/man2/pipe.2:218
9954 " write(STDOUT_FILENO, \"\\en\", 1);\n"
9955 " close(pipefd[0]);\n"
9956 " _exit(EXIT_SUCCESS);\n"
9958 " write(STDOUT_FILENO, \"\\en\", 1);\n"
9959 " close(pipefd[0]);\n"
9960 " _exit(EXIT_SUCCESS);\n"
9963 #: build/C/man2/pipe.2:227
9966 " } else { /* Parent writes argv[1] to pipe */\n"
9967 " close(pipefd[0]); /* Close unused read end */\n"
9968 " write(pipefd[1], argv[1], strlen(argv[1]));\n"
9969 " close(pipefd[1]); /* Reader will see EOF */\n"
9970 " wait(NULL); /* Wait for child */\n"
9971 " exit(EXIT_SUCCESS);\n"
9975 " } else { /* 親プロセスは argv[1] をパイプへ書き込む */\n"
9976 " close(pipefd[0]); /* 使用しない read 側はクローズする */\n"
9977 " write(pipefd[1], argv[1], strlen(argv[1]));\n"
9978 " close(pipefd[1]); /* 読み込み側が EOF に出会う */\n"
9979 " wait(NULL); /* 子プロセスを待つ */\n"
9980 " exit(EXIT_SUCCESS);\n"
9985 #: build/C/man2/pipe.2:235
9987 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
9990 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
9994 #: build/C/man3/popen.3:40
10000 #: build/C/man3/popen.3:43
10001 msgid "popen, pclose - pipe stream to or from a process"
10002 msgstr "popen, pclose - プロセスとの入力/出力用のパイプストリーム"
10004 #. type: Plain text
10005 #: build/C/man3/popen.3:48
10007 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
10008 msgstr "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
10010 #. type: Plain text
10011 #: build/C/man3/popen.3:50
10013 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
10014 msgstr "B<int pclose(FILE *>I<stream>B<);>\n"
10016 #. type: Plain text
10017 #: build/C/man3/popen.3:60
10018 msgid "B<popen>(), B<pclose>():"
10019 msgstr "B<popen>(), B<pclose>():"
10021 #. type: Plain text
10022 #: build/C/man3/popen.3:62
10024 "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
10026 "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
10028 #. type: Plain text
10029 #: build/C/man3/popen.3:73
10031 "The B<popen>() function opens a process by creating a pipe, forking, and "
10032 "invoking the shell. Since a pipe is by definition unidirectional, the "
10033 "I<type> argument may specify only reading or writing, not both; the "
10034 "resulting stream is correspondingly read-only or write-only."
10036 "B<popen>() 関数は、プロセスをオープンする。具体的には、 パイプを生成し、"
10037 "フォークを行い、シェルを起動する。 定義から分かるように、パイプは一方向なの"
10038 "で、 I<type> 引き数には読み込みか書き込みのどちらか一方だけを指定できる (両方"
10039 "は指定できない)。 生成されるストリームは、この指定に対応して、読み取り専用ま"
10040 "たは 書き込み専用のいずれかとなる。"
10042 #. type: Plain text
10043 #: build/C/man3/popen.3:97
10045 "The I<command> argument is a pointer to a null-terminated string containing "
10046 "a shell command line. This command is passed to I</bin/sh> using the B<-c> "
10047 "flag; interpretation, if any, is performed by the shell. The I<type> "
10048 "argument is a pointer to a null-terminated string which must contain either "
10049 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing. "
10050 "Since glibc 2.9, this argument can additionally include the letter \\(aqe"
10051 "\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>) to be set on the "
10052 "underlying file descriptor; see the description of the B<O_CLOEXEC> flag in "
10053 "B<open>(2) for reasons why this may be useful."
10055 "I<command> 引き数は、シェルのコマンドラインを含むヌル終端された文字列へのポイ"
10056 "ンタである。 このコマンドは B<-c> フラグを用いて I</bin/sh> に渡される。 コマ"
10057 "ンドの解釈は (もし必要ならば) シェルによって行われる。 I<type> 引き数は、ヌル"
10058 "終端された文字列へのポインタで、 読み込みを示す文字 \\(aqr\\(aq か、書き込み"
10059 "を示す文字 \\(aqw\\(aq の どちらか一方を指定しなければならない。 glibc 2.9 以"
10060 "降では、この引き数に文字 \\(aqe\\(aq を追加で指定できる。 文字 \\(aqe\\(aq を"
10061 "指定すると、 対応するファイルディスクリプタにおいて、 close-on-exec フラグ "
10062 "(B<FD_CLOEXEC>) がセットされる。 これが役に立つ理由については、 B<open>(2) "
10063 "の B<O_CLOEXEC> フラグの説明を参照のこと。"
10065 #. type: Plain text
10066 #: build/C/man3/popen.3:113
10068 "The return value from B<popen>() is a normal standard I/O stream in all "
10069 "respects save that it must be closed with B<pclose>() rather than "
10070 "B<fclose>(3). Writing to such a stream writes to the standard input of the "
10071 "command; the command's standard output is the same as that of the process "
10072 "that called B<popen>(), unless this is altered by the command itself. "
10073 "Conversely, reading from the stream reads the command's standard output, and "
10074 "the command's standard input is the same as that of the process that called "
10077 "B<popen>() からの返り値は、通常の標準 I/O ストリームと同じであるが、 "
10078 "B<fclose>(3) ではなく B<pclose>() で閉じなくてはならないことだけが異なる。 "
10079 "このストリームへ書き込んだ結果はコマンドの標準入力に書き込まれる。 そして、コ"
10080 "マンドの標準出力は、 コマンドそのものが置き換わってしまわない限り、 "
10081 "B<popen>() を呼んだプロセスの標準出力と同じことになる。 逆に、 ストリームか"
10082 "らの読み込みは、 そのコマンドの標準出力を読み込むことになる。 そして、そのコ"
10083 "マンドの標準入力は B<popen>() を呼んだプロセスの標準入力と同一である。"
10085 #. type: Plain text
10086 #: build/C/man3/popen.3:117
10087 msgid "Note that output B<popen>() streams are fully buffered by default."
10089 "デフォルトでは、 B<popen>() の出力ストリームは完全にバッファリングされること"
10092 #. type: Plain text
10093 #: build/C/man3/popen.3:123
10095 "The B<pclose>() function waits for the associated process to terminate and "
10096 "returns the exit status of the command as returned by B<wait4>(2)."
10098 "B<pclose>() 関数は、(パイプに) 関連づけられたプロセスが終了するのを待ち、 "
10099 "B<wait4>(2) によって返されたコマンドの終了状態を返す。"
10101 #. type: Plain text
10102 #: build/C/man3/popen.3:131
10104 "The B<popen>() function returns NULL if the B<fork>(2) or B<pipe>(2) "
10105 "calls fail, or if it cannot allocate memory."
10107 "B<popen>() 関数は、 B<fork>(2) または B<pipe>(2) 呼び出しが失敗した場合"
10108 "や、 メモリ割り当てができなかった場合、 NULL を返す。"
10110 #. These conditions actually give undefined results, so I commented
10113 #. is not associated with a "popen()ed" command, if
10115 #. already "pclose()d", or if
10116 #. type: Plain text
10117 #: build/C/man3/popen.3:146
10119 "The B<pclose>() function returns -1 if B<wait4>(2) returns an error, or "
10120 "some other error is detected. In the event of an error, these functions set "
10121 "I<errno> to indicate the cause of the error."
10123 "B<pclose>() 関数は、 B<wait4>(2) がエラーを返したり、何か他のエラーが見つ"
10124 "かった場合、 -1 を返す。 その場合、 I<errno> にエラーの原因を示す値が設定され"
10127 #. type: Plain text
10128 #: build/C/man3/popen.3:165
10130 "The B<popen>() function does not set I<errno> if memory allocation fails. "
10131 "If the underlying B<fork>(2) or B<pipe>(2) fails, I<errno> is set "
10132 "appropriately. If the I<type> argument is invalid, and this condition is "
10133 "detected, I<errno> is set to B<EINVAL>."
10135 "B<popen>() 関数は、メモリアロケーションに失敗しても I<errno> をセットしな"
10136 "い。 B<popen>() が中で呼び出す B<fork>(2) や B<pipe>(2) が失敗した場合に"
10137 "は、 I<errno> が適切にセットされる。 引き数 I<type> が無効であり、この状態が"
10138 "検知された場合には、 I<errno> が B<EINVAL> にセットされる。"
10140 #. type: Plain text
10141 #: build/C/man3/popen.3:172
10143 "If B<pclose>() cannot obtain the child status, I<errno> is set to B<ECHILD>."
10145 "B<pclose>() が、子プロセスの状態を取得できなかった場合、 I<errno> が "
10146 "B<ECHILD> にセットされる。"
10148 #. type: Plain text
10149 #: build/C/man3/popen.3:178
10150 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
10151 msgstr "I<type> に指定できる \\(aqe\\(aq は Linux での拡張である。"
10153 #. type: Plain text
10154 #: build/C/man3/popen.3:191
10156 "Since the standard input of a command opened for reading shares its seek "
10157 "offset with the process that called B<popen>(), if the original process has "
10158 "done a buffered read, the command's input position may not be as expected. "
10159 "Similarly, the output from a command opened for writing may become "
10160 "intermingled with that of the original process. The latter can be avoided "
10161 "by calling B<fflush>(3) before B<popen>()."
10163 "読み込みのために開かれたコマンドの標準入力は B<popen>(), を呼んだプロセスと一"
10164 "緒に、その読み取り位置を共有する。 そのため、もとのプロセスがバッファリングさ"
10165 "れた読み取りを終了したら、 そのコマンドの入力位置は予想されたものには なって"
10166 "いないかもしれない。 同様に、書き込みのために開かれたコマンドからの出力は、 "
10167 "もとのプロセスの出力と混ざり合うことになるかもしれない。 後者は B<popen>() "
10168 "の前に B<fflush>(3) を呼び出すことによって回避可能である。"
10175 #. function appeared in Version 7 AT&T UNIX.
10176 #. type: Plain text
10177 #: build/C/man3/popen.3:201
10179 "Failure to execute the shell is indistinguishable from the shell's failure "
10180 "to execute command, or an immediate exit of the command. The only hint is "
10181 "an exit status of 127."
10183 "シェルの実行の失敗は、 シェルがコマンドの実行に失敗したことや、 コマンドがす"
10184 "ぐに終了してしまったことと、区別がつかない。 唯一のヒントは終了状態が 127 に"
10187 #. type: Plain text
10188 #: build/C/man3/popen.3:211
10190 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
10191 "B<fopen>(3), B<stdio>(3), B<system>(3)"
10193 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
10194 "B<fopen>(3), B<stdio>(3), B<system>(3)"
10197 #: build/C/man3/printf.3:34
10203 #: build/C/man3/printf.3:34
10206 msgstr "2013-12-30"
10208 #. type: Plain text
10209 #: build/C/man3/printf.3:38
10211 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
10212 "formatted output conversion"
10214 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
10215 "指定された書式に変換して出力を行う"
10217 #. type: Plain text
10218 #: build/C/man3/printf.3:42
10219 msgid "B<int printf(const char *>I<format>B<, ...);>"
10220 msgstr "B<int printf(const char *>I<format>B<, ...);>"
10222 #. type: Plain text
10223 #: build/C/man3/printf.3:44
10224 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
10225 msgstr "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
10227 #. type: Plain text
10228 #: build/C/man3/printf.3:46
10229 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
10230 msgstr "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
10232 #. type: Plain text
10233 #: build/C/man3/printf.3:48
10235 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char "
10236 "*>I<format>B<, ...);>"
10238 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char "
10239 "*>I<format>B<, ...);>"
10241 #. type: Plain text
10242 #: build/C/man3/printf.3:50
10243 msgid "B<#include E<lt>stdarg.hE<gt>>"
10244 msgstr "B<#include E<lt>stdarg.hE<gt>>"
10246 #. type: Plain text
10247 #: build/C/man3/printf.3:52
10248 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
10249 msgstr "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
10251 #. type: Plain text
10252 #: build/C/man3/printf.3:54
10254 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
10257 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
10260 #. type: Plain text
10261 #: build/C/man3/printf.3:56
10263 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
10265 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
10267 #. type: Plain text
10268 #: build/C/man3/printf.3:59
10270 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
10271 "*>I<format>B<, va_list >I<ap>B<);>"
10273 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
10274 "*>I<format>B<, va_list >I<ap>B<);>"
10276 #. type: Plain text
10277 #: build/C/man3/printf.3:68
10278 msgid "B<snprintf>(), B<vsnprintf>():"
10279 msgstr "B<snprintf>(), B<vsnprintf>():"
10281 #. type: Plain text
10282 #: build/C/man3/printf.3:71
10284 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
10285 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
10287 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
10288 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
10290 #. type: Plain text
10291 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:85
10292 msgid "or I<cc -std=c99>"
10293 msgstr "または I<cc -std=c99>"
10295 #. type: Plain text
10296 #: build/C/man3/printf.3:101
10298 "The functions in the B<printf>() family produce output according to a "
10299 "I<format> as described below. The functions B<printf>() and B<vprintf>() "
10300 "write output to I<stdout>, the standard output stream; B<fprintf>() and "
10301 "B<vfprintf>() write output to the given output I<stream>; B<sprintf>(), "
10302 "B<snprintf>(), B<vsprintf>() and B<vsnprintf>() write to the character "
10305 "B<printf>() 関数グループは、以下で述べるように、 I<format> に従って出力を生"
10306 "成するものである。 B<printf>() と B<vprintf>() は出力を I<stdout> (標準出力"
10307 "ストリーム) に書き出す。 B<fprintf>() と B<vfprintf>() は出力を指定された出"
10308 "力 I<stream> に書き出す。 B<sprintf>(), B<snprintf>(), B<vsprintf>(), "
10309 "B<vsnprintf>() は出力を文字列 I<str> に書き込む。"
10311 #. type: Plain text
10312 #: build/C/man3/printf.3:110
10314 "The functions B<snprintf>() and B<vsnprintf>() write at most I<size> bytes "
10315 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
10317 "B<snprintf>() と B<vsnprintf>() は最大で I<size> バイトを I<str> に書き込"
10318 "む (I<size> には文字列を終端するヌルバイト (\\(aq\\e0\\(aq) もを含まれる)。"
10320 #. type: Plain text
10321 #: build/C/man3/printf.3:134
10323 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>() "
10324 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
10325 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
10326 "instead of a variable number of arguments. These functions do not call the "
10327 "I<va_end> macro. Because they invoke the I<va_arg> macro, the value of "
10328 "I<ap> is undefined after the call. See B<stdarg>(3)."
10330 "B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>() の各関数はそれぞ"
10331 "れ B<printf>(), B<fprintf>(), B<sprintf>(), B<snprintf>(), の各関数と等価であ"
10332 "り、可変数引き数の代わりに I<va_list> を引き数として呼び出される点だけが異な"
10333 "る。 これらの関数では I<va_end> マクロは呼び出されない。 これらの関数は "
10334 "I<va_arg> を呼び出すので、呼び出し後の I<ap> の値は未定義である。 "
10335 "B<stdarg>(3) を参照のこと。"
10337 #. type: Plain text
10338 #: build/C/man3/printf.3:141
10340 "These eight functions write the output under the control of a I<format> "
10341 "string that specifies how subsequent arguments (or arguments accessed via "
10342 "the variable-length argument facilities of B<stdarg>(3)) are converted for "
10345 "これらの 8 つの関数は I<format> 文字列の制御に従って出力を書き出す。 "
10346 "I<format> 文字列は、これに続く引き数 (または B<stdarg>(3) の可変長引き数機構"
10347 "を使ってアクセスできる引き数) をどのように変換して出力するかを指定する。"
10349 #. type: Plain text
10350 #: build/C/man3/printf.3:152
10352 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
10353 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>() would cause "
10354 "copying to take place between objects that overlap (e.g., if the target "
10355 "string array and one of the supplied input arguments refer to the same "
10356 "buffer). See NOTES."
10358 "C99 と POSIX.1-2001 では、 B<sprintf>(), B<snprintf>(), B<vsprintf>(), "
10359 "B<vsnprintf>() の呼び出しで、範囲が重複するオブジェクト間でコピーが発生する"
10360 "場合の 結果は不定であると規定されている (例えば、出力先の文字列と入力された "
10361 "引き数の一つが同じバッファを参照している場合などである)。 「注意」の節を参"
10365 #: build/C/man3/printf.3:152
10367 msgid "Return value"
10368 msgstr "Return Values"
10370 #. type: Plain text
10371 #: build/C/man3/printf.3:155
10373 "Upon successful return, these functions return the number of characters "
10374 "printed (excluding the null byte used to end output to strings)."
10376 "成功時には、上記の関数は書き込まれた文字数を返す (文字列の最後を示すために使"
10377 "用するヌルバイトは数に含まれない)。"
10379 #. type: Plain text
10380 #: build/C/man3/printf.3:171
10382 "The functions B<snprintf>() and B<vsnprintf>() do not write more than "
10383 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)). If "
10384 "the output was truncated due to this limit, then the return value is the "
10385 "number of characters (excluding the terminating null byte) which would have "
10386 "been written to the final string if enough space had been available. Thus, "
10387 "a return value of I<size> or more means that the output was truncated. (See "
10388 "also below under NOTES.)"
10390 "B<snprintf>() と B<vsnprintf>() は、 I<size> バイトを越える文字数を書き込ま"
10391 "ない (I<size> には文字列を終端するヌルバイト (\\(aq\\e0\\(aq) も含まれる)。 "
10392 "この制限によって出力が切り詰められた場合には、 もし十分なスペースがあれば書き"
10393 "込まれたであろう文字の個数 (文字列を終端するヌルバイトを除く) を返す。 従っ"
10394 "て、返り値が I<size> 以上だった場合、出力が切り詰められたことを意味する (後述"
10397 #. type: Plain text
10398 #: build/C/man3/printf.3:173
10399 msgid "If an output error is encountered, a negative value is returned."
10400 msgstr "エラーが発生した場合は、負の数を返す。"
10403 #: build/C/man3/printf.3:173
10405 msgid "Format of the format string"
10406 msgstr "フォーマット文字列のフォーマット"
10408 #. type: Plain text
10409 #: build/C/man3/printf.3:195
10411 "The format string is a character string, beginning and ending in its initial "
10412 "shift state, if any. The format string is composed of zero or more "
10413 "directives: ordinary characters (not B<%>), which are copied unchanged to "
10414 "the output stream; and conversion specifications, each of which results in "
10415 "fetching zero or more subsequent arguments. Each conversion specification "
10416 "is introduced by the character B<%>, and ends with a I<conversion "
10417 "specifier>. In between there may be (in this order) zero or more I<flags>, "
10418 "an optional minimum I<field width>, an optional I<precision> and an optional "
10419 "I<length modifier>."
10421 "フォーマット文字列は文字の列で、 (もしあるなら) 初期シフト状態で始まり、初期"
10422 "シフト状態で終わる。 フォーマット用の文字列は 0 個以上の命令 (directives) に"
10423 "よって構成される。 命令には、通常文字と変換指定 (conversion specifications) "
10424 "がある。 通常文字は B<%> 以外の文字で、出力ストリームにそのままコピーされ"
10425 "る。 変換指定は、それぞれが 0 個以上の引き数を取る。 各変換指定は文字 B<%> で"
10426 "始まり、 I<変換指定子 (conversion specifier)> で終わる。 B<%> と変換指定子の"
10427 "間には、0 個以上の I<フラグ 、> 最小 I<フィールド幅 、> I<精度 、> I<長さ修飾"
10428 "子> を (この順序で) 置くことができる。"
10430 #. type: Plain text
10431 #: build/C/man3/printf.3:208
10433 "The arguments must correspond properly (after type promotion) with the "
10434 "conversion specifier. By default, the arguments are used in the order "
10435 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
10436 "next argument (and it is an error if insufficiently many arguments are "
10437 "given). One can also specify explicitly which argument is taken, at each "
10438 "place where an argument is required, by writing \"%m$\" instead of \\(aq%"
10439 "\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
10440 "denotes the position in the argument list of the desired argument, indexed "
10441 "starting from 1. Thus,"
10443 "引き数は (型の格上げの後は) 変換指定子が表す型と正確に対応しなければならな"
10444 "い。 デフォルトでは、\\(aq*\\(aq や変換指定子が出てくる毎に次の引き数を要求さ"
10445 "れ、 引き数は指定された順序で使用されていく (指定された引き数の個数が不十分な"
10446 "らエラーとなる)。 また、引き数が必要な箇所で \\(aq%\\(aq の代わりに \"%m$"
10447 "\"、 \\(aq*\\(aqの代わりに \"*m$\" と書くことで、 明示的にどの引き数を使用す"
10448 "るかを指定することもできる。 ここで 10進の整数 m は希望の引き数の引き数リスト"
10449 "での位置を示す (最初の引き数の番号が 1 である)。 従って、"
10451 #. type: Plain text
10452 #: build/C/man3/printf.3:212
10454 msgid "printf(\"%*d\", width, num);\n"
10455 msgstr "printf(\"%*d\", width, num);\n"
10457 #. type: Plain text
10458 #: build/C/man3/printf.3:216
10462 #. type: Plain text
10463 #: build/C/man3/printf.3:220
10465 msgid "printf(\"%2$*1$d\", width, num);\n"
10466 msgstr "printf(\"%2$*1$d\", width, num);\n"
10468 #. type: Plain text
10469 #: build/C/man3/printf.3:236
10471 "are equivalent. The second style allows repeated references to the same "
10472 "argument. The C99 standard does not include the style using \\(aq$\\(aq, "
10473 "which comes from the Single UNIX Specification. If the style using \\(aq$"
10474 "\\(aq is used, it must be used throughout for all conversions taking an "
10475 "argument and all width and precision arguments, but it may be mixed with \"%%"
10476 "\" formats which do not consume an argument. There may be no gaps in the "
10477 "numbers of arguments specified using \\(aq$\\(aq; for example, if arguments "
10478 "1 and 3 are specified, argument 2 must also be specified somewhere in the "
10481 "は等価である。 二番目の書き方では同じ引き数を繰り返し参照することができる。 "
10482 "C99 標準には、 Single UNIX Specification 由来の \\(aq$\\(aq を使った書き方は"
10483 "含まれていない。 \\(aq$\\(aq を使ったスタイルを使うと、引き数を取る変換及び幅"
10484 "と精度の引き数を 全てこのスタイルで指定しなければならないが、 引き数を消費し"
10485 "ない \"%%\" フォーマットと混ざっているかもしれない。 \\(aq$\\(aq で指定される"
10486 "引き数の番号に空きがあってはならない。 例えば、もし引き数 1 と 3 が指定される"
10487 "と、引き数 2 もフォーマット文字列のどこかで 指定されなければならない。"
10489 #. type: Plain text
10490 #: build/C/man3/printf.3:246
10492 "For some numeric conversions a radix character (\"decimal point\") or "
10493 "thousands' grouping character is used. The actual character used depends on "
10494 "the B<LC_NUMERIC> part of the locale. The POSIX locale uses \\(aq.\\(aq as "
10495 "radix character, and does not have a grouping character. Thus,"
10497 "数値変換には小数点や 1000 単位の区切り文字を使うものもある。 実際にどの文字を"
10498 "使うかはロケールの B<LC_NUMERIC> による。 POSIX ロケールでは小数点に \\(aq."
10499 "\\(aq を用い、 区切り文字は使わない。 従って、"
10501 #. type: Plain text
10502 #: build/C/man3/printf.3:250
10504 msgid " printf(\"%\\(aq.2f\", 1234567.89);\n"
10505 msgstr "printf(\"%\\(aq.2f\", 1234567.89);\n"
10507 #. type: Plain text
10508 #: build/C/man3/printf.3:255
10510 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
10511 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
10513 "は、 POSIX ロケールでは \"1234567.89\" 、 nl_NL ロケールでは "
10514 "\"1234567,89\"、 da_DK ロケールでは \"1.234.567,89\" となる。"
10517 #: build/C/man3/printf.3:255
10519 msgid "The flag characters"
10522 #. type: Plain text
10523 #: build/C/man3/printf.3:257
10524 msgid "The character % is followed by zero or more of the following flags:"
10525 msgstr "% 文字の後ろには 0 個以上のフラグ文字が続く。"
10528 #: build/C/man3/printf.3:257
10533 #. type: Plain text
10534 #: build/C/man3/printf.3:291
10536 "The value should be converted to an \"alternate form\". For B<o> "
10537 "conversions, the first character of the output string is made zero (by "
10538 "prefixing a 0 if it was not zero already). For B<x> and B<X> conversions, a "
10539 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
10540 "prepended to it. For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
10541 "conversions, the result will always contain a decimal point, even if no "
10542 "digits follow it (normally, a decimal point appears in the results of those "
10543 "conversions only if a digit follows). For B<g> and B<G> conversions, "
10544 "trailing zeros are not removed from the result as they would otherwise be. "
10545 "For other conversions, the result is undefined."
10547 "値は「別の形式」に変換される。 B<o> 変換の場合、(先頭文字が 0 になっていない"
10548 "場合に先頭に 0 を追加することで) 出力文字列の最初の文字を 0 にする。 B<x> "
10549 "と B<X> 変換の場合、数値が 0 でないときには文字列 \"0x\" (B<X> 変換の場合に"
10550 "は \"0X\") が前に付与される。 B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, B<G> "
10551 "変換では、 小数点に続く数字がなくても、 出力には常に小数点が含まれる (通常"
10552 "は、小数点の後に数字が続く場合にのみ、 小数点が表示される)。 B<g> と B<G> 変"
10553 "換の場合、他の変換とは異なり、末尾のゼロが変換結果から削除されない。 その他の"
10557 #: build/C/man3/printf.3:291
10562 #. type: Plain text
10563 #: build/C/man3/printf.3:331
10565 "The value should be zero padded. For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
10566 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
10567 "converted value is padded on the left with zeros rather than blanks. If the "
10568 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored. If a "
10569 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
10570 "and B<X>), the B<\\&0> flag is ignored. For other conversions, the behavior "
10573 "値をゼロで埋める。 B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, B<a>, B<A>, B<e>, "
10574 "B<E>, B<f>, B<F>, B<g>, B<G> 変換では、変換した値の左側を空白文字の代わりにゼ"
10575 "ロで埋める。 B<\\&0> と B<-> が両方とも指定された場合は、 B<\\&0> フラグは無"
10576 "視される。 精度が数値変換 (B<d>, B<i>, B<o>, B<u>, B<x>, B<X>) と同時に指定"
10577 "された場合には、 B<\\&0> フラグは無視される。 その他の変換では、動作は未定義"
10581 #: build/C/man3/printf.3:331
10586 #. type: Plain text
10587 #: build/C/man3/printf.3:344
10589 "The converted value is to be left adjusted on the field boundary. (The "
10590 "default is right justification.) Except for B<n> conversions, the converted "
10591 "value is padded on the right with blanks, rather than on the left with "
10592 "blanks or zeros. A B<-> overrides a B<\\&0> if both are given."
10594 "変換値をフィールド境界で左揃えにする (デフォルトは右揃えである)。 B<n> 変換以"
10595 "外では、変換された値は 左側ではなく右側を空白文字やゼロで埋められる。 B<-> "
10596 "と B<\\&0> の両方が指定された場合には、 B<-> が優先される。"
10599 #: build/C/man3/printf.3:344
10601 msgid "B<\\(aq \\(aq>"
10604 #. type: Plain text
10605 #: build/C/man3/printf.3:348
10607 "(a space) A blank should be left before a positive number (or empty string) "
10608 "produced by a signed conversion."
10610 "(1個の半角スペース) 符号付き変換で生成された正の数字の前に空白 (または空文字"
10614 #: build/C/man3/printf.3:348
10619 #. type: Plain text
10620 #: build/C/man3/printf.3:356
10622 "A sign (+ or -) should always be placed before a number produced by a signed "
10623 "conversion. By default a sign is used only for negative numbers. A B<+> "
10624 "overrides a space if both are used."
10626 "符号付き変換によって出力される数字の前に、常に符号 (+ か -) が置かれる。 デ"
10627 "フォルトでは、符号は負の数字の場合のみ付与される。 B<+> と半角スペースの 両方"
10628 "が使われている場合には、 B<+> が優先される。"
10630 #. type: Plain text
10631 #: build/C/man3/printf.3:359
10633 "The five flag characters above are defined in the C standard. The SUSv2 "
10634 "specifies one further flag character."
10636 "上記の 5 つのフラグは C 標準で定義されている。 SUSv2 では、さらにもう一つフラ"
10640 #: build/C/man3/printf.3:359
10645 #. type: Plain text
10646 #: build/C/man3/printf.3:376
10648 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>) the "
10649 "output is to be grouped with thousands' grouping characters if the locale "
10650 "information indicates any. Note that many versions of B<gcc>(1) cannot "
10651 "parse this option and will issue a warning. SUSv2 does not include I<%"
10654 "10進数変換 (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>) において、ロケール情報"
10655 "に指定があれば 1000 単位の区切り文字を出力する。 B<gcc>(1) の多くのバージョ"
10656 "ンは、このオプションを解釈することができず、 警告を出力することに注意せよ。 %"
10657 "\\(aqF は SUSv2 には含まれていない。"
10659 #. type: Plain text
10660 #: build/C/man3/printf.3:378
10661 msgid "glibc 2.2 adds one further flag character."
10662 msgstr "glibc 2.2 では、さらに一つフラグ文字が追加されている。"
10665 #: build/C/man3/printf.3:378
10670 #. outdigits keyword in locale file
10671 #. type: Plain text
10672 #: build/C/man3/printf.3:388
10674 "For decimal integer conversion (B<i>, B<d>, B<u>) the output uses the "
10675 "locale's alternative output digits, if any. For example, since glibc 2.2.3 "
10676 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
10678 "10進整数変換 (B<i>, B<d>, B<u>) において、ロケールの代替出力数字があれば、そ"
10679 "れを用いて出力する。 例えば、 glibc 2.2.3 以降では、ペルシア (\"fa_IR\") ロ"
10680 "ケールで アラビア数字 (Arabic-Indic digits) を出力できる。"
10683 #: build/C/man3/printf.3:388
10685 msgid "The field width"
10688 #. type: Plain text
10689 #: build/C/man3/printf.3:404
10691 "An optional decimal digit string (with nonzero first digit) specifying a "
10692 "minimum field width. If the converted value has fewer characters than the "
10693 "field width, it will be padded with spaces on the left (or right, if the "
10694 "left-adjustment flag has been given). Instead of a decimal digit string one "
10695 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
10696 "the field width is given in the next argument, or in the I<m>-th argument, "
10697 "respectively, which must be of type I<int>. A negative field width is taken "
10698 "as a \\(aq-\\(aq flag followed by a positive field width. In no case does a "
10699 "nonexistent or small field width cause truncation of a field; if the result "
10700 "of a conversion is wider than the field width, the field is expanded to "
10701 "contain the conversion result."
10703 "最小のフィールド幅を指定する 10進数の数値文字列 (文字列の最初の文字は ゼロ以"
10704 "外)。本項目はオプションである。 変換された値の文字数がフィールド長よりも少な"
10705 "い場合、 フィールドの左側をスペースで埋める (左揃えのフラグがある場合は右側を"
10706 "埋める)。 10進数の文字列の代わりに \"*\" や \"*m$\" (I<m> は 10進整数) を書く"
10707 "こともできる。 \"*\" と \"*m$\" はそれぞれ、次の引き数と I<m> 番目の引き数を"
10708 "フィールド幅として 使うことを指定する (これらの引き数は I<int> 型でなければな"
10709 "らない)。 フィールド幅に負の数が指定された場合は、 \\(aq-\\(aq フラグと正の数"
10710 "のフィールド幅として扱われる。 フィールド幅が小さかったり指定がなかったりして"
10711 "も、フィールドが切り詰められる ことはない。もし変換結果がフィールド幅よりも広"
10712 "かった場合、 フィールドは変換結果が入る幅に広げられる。"
10715 #: build/C/man3/printf.3:404
10717 msgid "The precision"
10720 #. type: Plain text
10721 #: build/C/man3/printf.3:441
10723 "An optional precision, in the form of a period (\\(aq.\\(aq) followed by an "
10724 "optional decimal digit string. Instead of a decimal digit string one may "
10725 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
10726 "precision is given in the next argument, or in the m-th argument, "
10727 "respectively, which must be of type I<int>. If the precision is given as "
10728 "just \\(aq.\\(aq, the precision is taken to be zero. A negative precision "
10729 "is taken as if the precision were omitted. This gives the minimum number of "
10730 "digits to appear for B<d>, B<i>, B<o>, B<u>, B<x>, and B<X> conversions, the "
10731 "number of digits to appear after the radix character for B<a>, B<A>, B<e>, "
10732 "B<E>, B<f>, and B<F> conversions, the maximum number of significant digits "
10733 "for B<g> and B<G> conversions, or the maximum number of characters to be "
10734 "printed from a string for B<s> and B<S> conversions."
10736 "オプションである精度は、ピリオド (\\(aq.\\(aq) とそれに続く10進数という 形式"
10737 "で指定する (10進数はオプション) 。 10進数の文字列の代わりに \"*\" や \"*m$"
10738 "\" (m は 10 進整数)を書くこともできる。 \"*\" と \"*m$\" はそれぞれ、次の引き"
10739 "数と m 番目の引き数を精度として 使うことを指定する (これらの引き数は I<int> "
10740 "型でなければならない)。 精度として \\(aq.\\(aq だけが指定された場合、 精度は"
10741 "ゼロとみなされる。 精度が負の数だった場合、 精度は指定されなかったものとみな"
10742 "される。 B<d>, B<i>, B<o>, B<u>, B<x>, B<X> 変換では、表示される最小の桁数を"
10743 "指定する。 B<a>, B<A>, B<e>, B<E>, B<f>, B<F> 変換では、小数点以下に表示され"
10744 "る数字の桁数を指定する。 B<g> と B<G> 変換では、有効数字の最大桁数を指定す"
10745 "る。 B<s> と B<S> 変換では、文字列から出力される最大文字数を指定する。"
10748 #: build/C/man3/printf.3:441
10750 msgid "The length modifier"
10753 #. type: Plain text
10754 #: build/C/man3/printf.3:451
10756 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
10759 "「整数変換」とは、 B<d>, B<i>, B<o>, B<u>, B<x>, B<X> 変換のことである。"
10762 #: build/C/man3/printf.3:451 build/C/man3/scanf.3:294
10767 #. type: Plain text
10768 #: build/C/man3/printf.3:462
10770 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
10771 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
10772 "I<signed char> argument."
10774 "整数変換に対応する引き数が I<signed char> か I<unsigned char> で、 B<n> 変換"
10775 "に対応する引き数が I<signed char> へのポインタであることを示す。"
10778 #: build/C/man3/printf.3:462 build/C/man3/scanf.3:284
10783 #. type: Plain text
10784 #: build/C/man3/printf.3:473
10786 "A following integer conversion corresponds to a I<short int> or I<unsigned "
10787 "short int> argument, or a following B<n> conversion corresponds to a pointer "
10788 "to a I<short int> argument."
10790 "整数変換に対応する引き数が I<short int> か I<unsigned short int> で、 B<n> 変"
10791 "換に対応する引き数が I<short int> へのポインタであることを示す。"
10794 #: build/C/man3/printf.3:473 build/C/man3/scanf.3:311
10799 #. type: Plain text
10800 #: build/C/man3/printf.3:492
10802 "(ell) A following integer conversion corresponds to a I<long int> or "
10803 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
10804 "a pointer to a I<long int> argument, or a following B<c> conversion "
10805 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
10806 "corresponds to a pointer to I<wchar_t> argument."
10808 "各変換に対応する引き数が、 整数変換では I<long int>か I<unsigned long int>、 "
10809 "B<n> 変換では I<long long int> へのポインタ、 B<c> 変換では I<wint_t>、 B<s> "
10810 "変換では I<wchar_t> へのポインタであることを示す。"
10813 #: build/C/man3/printf.3:492
10816 msgstr "B<ll> (エルエル)"
10818 #. type: Plain text
10819 #: build/C/man3/printf.3:504
10821 "(ell-ell). A following integer conversion corresponds to a I<long long int> "
10822 "or I<unsigned long long int> argument, or a following B<n> conversion "
10823 "corresponds to a pointer to a I<long long int> argument."
10825 "整数変換に対応する引き数が I<long long int> か I<unsigned long long int> "
10826 "で、 B<n> 変換に対応する引き数が I<long int> へのポインタであることを示す。"
10829 #: build/C/man3/printf.3:504 build/C/man3/scanf.3:338
10834 #. type: Plain text
10835 #: build/C/man3/printf.3:520
10837 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
10838 "corresponds to a I<long double> argument. (C99 allows %LF, but SUSv2 does "
10841 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, B<G> 変換に対応する引き数が I<long "
10842 "double> であることを示す。 (C99 では %LF を使うことを認めているが、SUSv2 では"
10846 #: build/C/man3/printf.3:520 build/C/man3/scanf.3:354
10851 #. type: Plain text
10852 #: build/C/man3/printf.3:526
10854 "(\"quad\". 4.4BSD and Linux libc5 only. Don't use.) This is a synonym for "
10857 "(\"quad\"。 4.4BSD と Linux libc5 のみ有効。使ってはならない。) B<ll> と同じ"
10861 #: build/C/man3/printf.3:526 build/C/man3/scanf.3:302
10866 #. type: Plain text
10867 #: build/C/man3/printf.3:533
10869 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
10872 "整数変換に対応する引き数が I<intmax_t> か I<uintmax_t> であることを示す。"
10875 #: build/C/man3/printf.3:533 build/C/man3/scanf.3:366
10880 #. type: Plain text
10881 #: build/C/man3/printf.3:544
10883 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
10884 "argument. (Linux libc5 has B<Z> with this meaning. Don't use it.)"
10886 "整数変換に対応する引き数が I<size_t> か I<ssize_t> であることを示す。 (Linux "
10887 "libc5 では、これを指定するのに B<Z> を用いる。使ってはならない。)"
10890 #: build/C/man3/printf.3:544 build/C/man3/scanf.3:359
10895 #. type: Plain text
10896 #: build/C/man3/printf.3:549
10897 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
10898 msgstr "整数変換に対応する引き数が I<ptrdiff_t> であることを示す。"
10900 #. type: Plain text
10901 #: build/C/man3/printf.3:578
10903 "The SUSv2 knows about only the length modifiers B<h> (in B<hd>, B<hi>, "
10904 "B<ho>, B<hx>, B<hX>, B<hn>) and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
10905 "B<ln>, B<lc>, B<ls>) and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
10907 "SUSv2 で長さ修飾子として使用できるのは、 B<h> (B<hd>, B<hi>, B<ho>, B<hx>, "
10908 "B<hX>, B<hn>), B<l> (B<ld>, B<li>, B<lo>, B<lx>, B<lX>, B<ln>, B<lc>, "
10909 "B<ls>), B<L> (B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>) だけである。"
10912 #: build/C/man3/printf.3:578
10914 msgid "The conversion specifier"
10917 #. type: Plain text
10918 #: build/C/man3/printf.3:581
10920 "A character that specifies the type of conversion to be applied. The "
10921 "conversion specifiers and their meanings are:"
10923 "適用される変換の型を指定する文字。 変換指定子とその意味は以下の通りである。"
10926 #: build/C/man3/printf.3:581
10929 msgstr "B<d>, B<i>"
10931 #. type: Plain text
10932 #: build/C/man3/printf.3:591
10934 "The I<int> argument is converted to signed decimal notation. The precision, "
10935 "if any, gives the minimum number of digits that must appear; if the "
10936 "converted value requires fewer digits, it is padded on the left with zeros. "
10937 "The default precision is 1. When 0 is printed with an explicit precision 0, "
10938 "the output is empty."
10940 "I<int> 引き数を符号付き 10 進表記に変換する。 精度指定があれば、精度で指定し"
10941 "た桁数は必ず出力される。変換後の値が 指定された桁数に足りない場合は、左側が "
10942 "0 で埋められる。 デフォルトの精度は 1 である。 0 を表示しようとした時に、明示"
10943 "的に精度として 0 が指定されていると、 出力は空文字列となる。"
10946 #: build/C/man3/printf.3:591
10948 msgid "B<o>, B<u>, B<x>, B<X>"
10949 msgstr "B<o>, B<u>, B<x>, B<X>"
10951 #. type: Plain text
10952 #: build/C/man3/printf.3:618
10954 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
10955 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>) notation. The "
10956 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
10957 "used for B<X> conversions. The precision, if any, gives the minimum number "
10958 "of digits that must appear; if the converted value requires fewer digits, it "
10959 "is padded on the left with zeros. The default precision is 1. When 0 is "
10960 "printed with an explicit precision 0, the output is empty."
10962 "I<unsigned int> 引き数を、 符号なし8進数 (B<o>), 符号なし10進数 (B<u>), 符号"
10963 "なし16進数 (B<x> と B<X>) に変換する。 B<x> 変換では B<abcdef> が使用され、 "
10964 "B<X> 変換では B<ABCDEF> が使用される。 精度指定があれば、精度で指定した桁数は"
10965 "必ず出力される。変換後の値が 指定された桁数に足りない場合は、左側が 0 で埋め"
10969 #: build/C/man3/printf.3:618
10972 msgstr "B<e>, B<E>"
10974 #. type: Plain text
10975 #: build/C/man3/printf.3:637
10977 "The I<double> argument is rounded and converted in the style [-]dB<\\&."
10978 ">dddB<e>\\(+-dd where there is one digit before the decimal-point character "
10979 "and the number of digits after it is equal to the precision; if the "
10980 "precision is missing, it is taken as 6; if the precision is zero, no decimal-"
10981 "point character appears. An B<E> conversion uses the letter B<E> (rather "
10982 "than B<e>) to introduce the exponent. The exponent always contains at "
10983 "least two digits; if the value is zero, the exponent is 00."
10985 "I<double> 引き数を丸めて [-]dB<\\&.>dddB<e>\\(+-dd の形に変換する。\n"
10986 "小数点の前には一桁の数字があり、小数点以下の桁数は精度で指定された桁数\n"
10987 "になる。精度は指定されなかった場合 6 とみなされる。 精度が 0 の場合には、\n"
10988 "小数点以下は表示されない。B<E> 変換では、指数を表現するときに (B<e> で\n"
10989 "はなく) B<E> が使われる。指数部分は少なくとも 2桁表示される。つまり、\n"
10990 "指数の値が 0 の場合には、00 と表示される。"
10993 #: build/C/man3/printf.3:637
10996 msgstr "B<f>, B<F>"
10998 #. type: Plain text
10999 #: build/C/man3/printf.3:648
11001 "The I<double> argument is rounded and converted to decimal notation in the "
11002 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
11003 "character is equal to the precision specification. If the precision is "
11004 "missing, it is taken as 6; if the precision is explicitly zero, no decimal-"
11005 "point character appears. If a decimal point appears, at least one digit "
11006 "appears before it."
11008 "I<double> 引き数を丸めて [-]dddB<\\&.>ddd の形の10進表現に変換する。 小数点の"
11009 "後の桁数は、精度で指定された値となる。 精度が指定されていない場合には 6 とし"
11010 "て扱われる。 精度として明示的に 0 が指定されたときには、小数点以下は表示され"
11011 "ない。 小数点を表示する際には、小数点の前に少なくとも一桁は数字が表示される。"
11013 #. type: Plain text
11014 #: build/C/man3/printf.3:659
11016 "(The SUSv2 does not know about B<F> and says that character string "
11017 "representations for infinity and NaN may be made available. The C99 "
11018 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
11019 "starting with \"nan\" for NaN, in the case of B<f> conversion, and \"[-]INF"
11020 "\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
11022 "(SUSv2 では、B<F> は規定されておらず、無限や NaN に関する文字列表現を\n"
11023 "行ってもよいことになっている。\n"
11024 " C99 標準では、B<f> 変換では、無限は \"[-]inf\" か \"[-]infinity\" と表示"
11026 "NaN は文字列の先頭に `nan' をつけて表示するように規定されている。\n"
11027 "B<F> 変換の場合は \"[-]INF\", \"[-]INFINITY\", \"NAN*\" と表示される。)"
11030 #: build/C/man3/printf.3:659
11033 msgstr "B<g>, B<G>"
11035 #. type: Plain text
11036 #: build/C/man3/printf.3:684
11038 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
11039 "for B<G> conversions). The precision specifies the number of significant "
11040 "digits. If the precision is missing, 6 digits are given; if the precision "
11041 "is zero, it is treated as 1. Style B<e> is used if the exponent from its "
11042 "conversion is less than -4 or greater than or equal to the precision. "
11043 "Trailing zeros are removed from the fractional part of the result; a decimal "
11044 "point appears only if it is followed by at least one digit."
11046 "I<double> 引き数を B<f> か B<e> (B<G> 変換の場合は B<F> か B<E>) の形式に変"
11047 "換する。 精度は表示する桁数を指定する。 精度が指定されない場合は、6桁とみなさ"
11048 "れる。 精度が 0 の場合は、1桁とみなされる。 変換される値の指数が、 -4 より小"
11049 "さいか、精度以上の場合に、 B<e> 形式が使用される。 変換された結果の小数部分の"
11050 "末尾の 0 は削除される。小数点が表示されるのは、 小数点以下に数字が少なくとも"
11054 #: build/C/man3/printf.3:684
11057 msgstr "B<a>, B<A>"
11059 #. type: Plain text
11060 #: build/C/man3/printf.3:708
11062 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
11063 "to hexadecimal notation (using the letters abcdef) in the style [-]B<0x>hB<"
11064 "\\&.>hhhhB<p>\\(+-; for B<A> conversion the prefix B<0X>, the letters "
11065 "ABCDEF, and the exponent separator B<P> is used. There is one hexadecimal "
11066 "digit before the decimal point, and the number of digits after it is equal "
11067 "to the precision. The default precision suffices for an exact "
11068 "representation of the value if an exact representation in base 2 exists and "
11069 "otherwise is sufficiently large to distinguish values of type I<double>. "
11070 "The digit before the decimal point is unspecified for nonnormalized numbers, "
11071 "and nonzero but otherwise unspecified for normalized numbers."
11073 "(C99 にはあるが SUSv2 にはない) B<a> 変換では、 I<double> 引き数を\n"
11074 "(abcdef の文字を使って) [-]B<0x>hB<\\&.>hhhhB<p>\\(+- 形式の\n"
11076 "B<A> 変換では、前置文字列 B<0X>, 文字 ABCDEF, 指数文字 B<P> を用いる。\n"
11077 "小数点の前には 1 桁の 16 進数が置かれ、小数点の後ろの桁数は 精度で指定\n"
11078 "された値となる。デフォルトの精度は、その値が 2 進数で正確に表現できる\n"
11079 "場合には、その値を正確に表現できる桁数となる。それ以外の場合は、\n"
11080 "I<double> 型の値を区別するのに十分な大きさとなる。 小数点の前の数字は、\n"
11081 "正規化されていない数の場合はいくつになるか分からない。 正規化された数の\n"
11082 "場合は、 0 以外の値になるが、いくつになるかは分からない。"
11085 #: build/C/man3/printf.3:708 build/C/man3/scanf.3:459
11086 #: build/C/man3/wprintf.3:149
11091 #. type: Plain text
11092 #: build/C/man3/printf.3:726
11094 "If no B<l> modifier is present, the I<int> argument is converted to an "
11095 "I<unsigned char>, and the resulting character is written. If an B<l> "
11096 "modifier is present, the I<wint_t> (wide character) argument is converted to "
11097 "a multibyte sequence by a call to the B<wcrtomb>(3) function, with a "
11098 "conversion state starting in the initial state, and the resulting multibyte "
11099 "string is written."
11101 "B<l> 修飾子がなければ、 I<int> 引き数を I<unsigned char> に変換して、その結果"
11102 "に対応する文字を出力する。 B<l> 修飾子があれば、 I<wint_t> (ワイド文字) 引き"
11103 "数を、 B<wcrtomb>(3) 関数を初期シフト状態で呼び出してマルチバイト文字列に変"
11104 "換し、 変換されたマルチバイト文字列を出力する。"
11107 #: build/C/man3/printf.3:726 build/C/man3/scanf.3:451
11108 #: build/C/man3/wprintf.3:163
11113 #. type: Plain text
11114 #: build/C/man3/printf.3:741
11116 "If no B<l> modifier is present: The I<const char\\ *> argument is expected "
11117 "to be a pointer to an array of character type (pointer to a string). "
11118 "Characters from the array are written up to (but not including) a "
11119 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
11120 "than the number specified are written. If a precision is given, no null "
11121 "byte need be present; if the precision is not specified, or is greater than "
11122 "the size of the array, the array must contain a terminating null byte."
11124 "B<l> 修飾子がない場合、 引き数は I<const char\\ *> 型で文字型の配列へのポイン"
11125 "タ (文字列へのポインタ) であることが 期待されている。配列中の文字は、終端の "
11126 "ヌルバイト (\\(aq\\e0\\(aq) が出てくるまで出力される (終端文字は出力されな"
11127 "い)。 精度が指定されていると、指定された字数以上は出力されない。 精度が指定さ"
11128 "れた場合には、終端バイトが存在する必要はない。 精度が指定されていなかったり、"
11129 "精度の値が配列の大きさより大きい場合には、 配列は終端のヌルバイトを含んでいな"
11132 #. type: Plain text
11133 #: build/C/man3/printf.3:768
11135 "If an B<l> modifier is present: The I<const wchar_t\\ *> argument is "
11136 "expected to be a pointer to an array of wide characters. Wide characters "
11137 "from the array are converted to multibyte characters (each by a call to the "
11138 "B<wcrtomb>(3) function, with a conversion state starting in the initial "
11139 "state before the first wide character), up to and including a terminating "
11140 "null wide character. The resulting multibyte characters are written up to "
11141 "(but not including) the terminating null byte. If a precision is specified, "
11142 "no more bytes than the number specified are written, but no partial "
11143 "multibyte characters are written. Note that the precision determines the "
11144 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
11145 "positions>. The array must contain a terminating null wide character, "
11146 "unless a precision is given and it is so small that the number of bytes "
11147 "written exceeds it before the end of the array is reached."
11149 "B<l> 修飾子が指定されている場合、 引き数は I<const wchar_t\\ *> 型でワイド文"
11150 "字の配列へのポインタであることが期待されている。 配列中のワイド文字は (1文字"
11151 "毎に B<wcrtomb>(3) を呼び出して) マルチバイト文字に変換される (最初のワイド"
11152 "文字の変換の前に B<wcrtomb>() のシフト状態を初期状態に戻してから変換は行われ"
11153 "る)。 マルチバイト文字への変換は、文字列を終端するヌルワイド文字が 出てくるま"
11154 "で行われ、終端ヌルワイド文字も含めて変換される。 結果のマルチバイト文字列は、"
11155 "終端のヌルバイトが出てくるまで 出力される (終端のヌルバイトは出力されない)。 "
11156 "精度が指定された場合、指定されたバイト数以上には出力されない。 但し、マルチバ"
11157 "イト文字の一部分だけが出力されることはない。 精度は「バイト」数を指定するもの"
11158 "であり、「ワイド文字」数や 「画面での位置」を指定するものではないことに注"
11159 "意。 精度が指定されていて、さらに出力が配列の末尾に達する前に出力バイト数が "
11160 "精度の値を超える場合だけは、配列はヌルワイド文字で終端されていなくてもよい。 "
11161 "それ以外の場合は、必ず配列はヌルワイド文字で終端されていなければならない。"
11164 #: build/C/man3/printf.3:768
11169 #. type: Plain text
11170 #: build/C/man3/printf.3:774
11171 msgid "(Not in C99, but in SUSv2.) Synonym for B<lc>. Don't use."
11172 msgstr "(C99 にはないが SUSv2 にはある) B<lc> と同じ。使ってはならない。"
11175 #: build/C/man3/printf.3:774
11180 #. type: Plain text
11181 #: build/C/man3/printf.3:780
11182 msgid "(Not in C99, but in SUSv2.) Synonym for B<ls>. Don't use."
11183 msgstr "(C99 にはないが SUSv2 にはある) B<ls> と同じ。使ってはならない。"
11186 #: build/C/man3/printf.3:780 build/C/man3/scanf.3:502
11191 #. type: Plain text
11192 #: build/C/man3/printf.3:788
11194 "The I<void\\ *> pointer argument is printed in hexadecimal (as if by B<%#x> "
11197 "I<void\\ *> ポインタ引き数を (B<%#x> や B<%#lx> のような) 16 進数で出力する。"
11200 #: build/C/man3/printf.3:788 build/C/man3/scanf.3:510
11205 #. type: Plain text
11206 #: build/C/man3/printf.3:795
11208 "The number of characters written so far is stored into the integer indicated "
11209 "by the I<int\\ *> (or variant) pointer argument. No argument is converted."
11211 "これまでに出力された文字数を I<int\\ *> (または類似の型) のポインタ引き数が指"
11212 "す整数に保存する。 引き数の変換は行われない。"
11215 #: build/C/man3/printf.3:795
11220 #. type: Plain text
11221 #: build/C/man3/printf.3:801
11223 "(Glibc extension.) Print output of I<strerror(errno)>. No argument is "
11226 "(glibc での拡張) I<strerror(errno)> の出力を表示する。引き数は必要ない。"
11229 #: build/C/man3/printf.3:801 build/C/man3/scanf.3:377
11234 #. type: Plain text
11235 #: build/C/man3/printf.3:807
11237 "A \\(aq%\\(aq is written. No argument is converted. The complete "
11238 "conversion specification is \\(aq%%\\(aq."
11240 "\\(aq%\\(aq 文字を出力する。変換される引き数は無い。 変換指定全体を書くと \"%"
11243 #. type: Plain text
11244 #: build/C/man3/printf.3:822
11246 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
11247 "and B<vsprintf>() functions conform to C89 and C99. The B<snprintf>() and "
11248 "B<vsnprintf>() functions conform to C99."
11250 "B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
11251 "B<vsprintf>() 関数は、C89 と C99 に準拠している。 B<snprintf>() と "
11252 "B<vsnprintf>() は C99 に準拠している。"
11254 #. type: Plain text
11255 #: build/C/man3/printf.3:835
11257 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
11258 "other: when B<snprintf>() is called with I<size>=0 then SUSv2 stipulates an "
11259 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
11260 "this case, and gives the return value (as always) as the number of "
11261 "characters that would have been written in case the output string has been "
11264 "B<snprintf>() の返り値を見ると、 SUSv2 と C99 標準は互いに矛盾している。 "
11265 "SUSv2 では、 B<snprintf>() が I<size>=0 で呼び出された場合、 1 未満の値を何"
11266 "か返り値とするように規定している。 一方 C99 では、このような場合 I<str> を "
11267 "NULL とし、返り値として (通常通り) 出力バッファが十分な大きさが あった場合に"
11270 #. type: Plain text
11271 #: build/C/man3/printf.3:849
11273 "Linux libc4 knows about the five C standard flags. It knows about the "
11274 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
11275 "B<E>, B<f>, B<F>, B<g>, B<G>, B<i>, B<n>, B<o>, B<p>, B<s>, B<u>, B<x>, and "
11276 "B<X>, where B<F> is a synonym for B<f>. Additionally, it accepts B<D>, "
11277 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>. (This is bad, and "
11278 "caused serious bugs later, when support for B<%D> disappeared.) No locale-"
11279 "dependent radix character, no thousands' separator, no NaN or infinity, no "
11280 "\"%m$\" and \"*m$\"."
11282 "Linux libc4 では、 5 つの C 標準のフラグ、 長さ修飾子 B<h>, B<l>, B<L>、変換 "
11283 "B<c>, B<d>, B<e>, B<E>, B<f>, B<F>, B<g>, B<G>, B<i>, B<n>, B<o>, B<p>, "
11284 "B<s>, B<u>, B<x>, B<X> が使える。 但し B<F> は B<f> と同義である。 また、 "
11285 "B<D>, B<O>, and B<U> を B<ld>, B<lo>, and B<lu> と同じものとして使える (これ"
11286 "はまずい仕様で、 後に B<%D> の対応が打ち切られた時に深刻なバグを 引き起こし"
11287 "た)。ロケール依存の小数点、1000 区切り、 NaN と無限、 \"%m$\" と \"*m$\" は使"
11290 #. type: Plain text
11291 #: build/C/man3/printf.3:860
11293 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
11294 "locale, \"%m$\" and \"*m$\". It knows about the length modifiers B<h>, "
11295 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
11296 "double> and for I<long long int> (this is a bug). It no longer recognizes "
11297 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
11298 "outputs I<strerror(errno)>."
11300 "Linux libc5 では、 5 つの C 標準のフラグと \\(aq フラグ、ロケール、 \"%m$\" "
11301 "と \"*m$\" が使える。 また、長さ修飾子 B<h>, B<l>, B<L>, B<Z>, iand B<q> が使"
11302 "えるが、 B<L> と B<q> は両方とも I<long double> と I<long long int> に対応し"
11303 "ている (これはバグである)。 現在では変換 B<F>, B<D>, B<O>, B<U> は認識されな"
11304 "いが、変換文字 B<m> が追加された。これは I<strerror(errno)> を出力するもので"
11307 #. type: Plain text
11308 #: build/C/man3/printf.3:862
11309 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
11310 msgstr "glibc 2.0 では、変換文字 B<C> と B<S> が追加された。"
11312 #. type: Plain text
11313 #: build/C/man3/printf.3:865
11315 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
11316 "characters B<a> and B<A>."
11318 "glibc 2.1 では、長さ修飾子 B<hh>, B<j>, B<t>, B<z> と変換文字 B<a>, B<A> が追"
11321 #. type: Plain text
11322 #: build/C/man3/printf.3:868
11324 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
11325 "flag character B<I>."
11327 "glibc 2.2 では、 C99 で規定された意味での変換文字 B<F> と フラグ文字 B<I> が"
11330 #. type: Plain text
11331 #: build/C/man3/printf.3:870
11332 msgid "Some programs imprudently rely on code such as the following"
11334 "テキストを I<buf> に追加するのに、軽率にも次のようなコードを使っているプログ"
11337 #. type: Plain text
11338 #: build/C/man3/printf.3:872
11340 msgid " sprintf(buf, \"%s some further text\", buf);\n"
11341 msgstr " sprintf(buf, \"%s some further text\", buf);\n"
11343 #. http://sourceware.org/bugzilla/show_bug.cgi?id=7075
11344 #. type: Plain text
11345 #: build/C/man3/printf.3:888
11347 "to append text to I<buf>. However, the standards explicitly note that the "
11348 "results are undefined if source and destination buffers overlap when calling "
11349 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>(). Depending "
11350 "on the version of B<gcc>(1) used, and the compiler options employed, calls "
11351 "such as the above will B<not> produce the expected results."
11353 "しかしながら、標準規格では、 B<sprintf>(), B<snprintf>(), B<vsprintf>(), "
11354 "B<vsnprintf>() の呼び出しにおいて、コピー元とコピー先のバッファが重なってい"
11355 "た場合の 結果は不定である、と明記されている。 使用する B<gcc>(1) のバージョ"
11356 "ンや指定したコンパイラのオプション次第では、 上記のような呼び出しで、期待した"
11360 #. UNIX V7 defines the three routines
11364 #. and has the flag \-, the width or precision *, the length modifier l,
11365 #. and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
11366 #. This is still true for 2.9.1BSD, but 2.10BSD has the flags
11367 #. #, + and <space> and no longer mentions D,O,U,X.
11370 #. .BR vfprintf (),
11371 #. .BR vsprintf (),
11372 #. and warns not to use D,O,U,X.
11373 #. 4.3BSD Reno has the flag 0, the length modifiers h and L,
11374 #. and the conversions n, p, E, G, X (with current meaning)
11375 #. and deprecates D,O,U.
11376 #. 4.4BSD introduces the functions
11379 #. .BR vsnprintf (),
11380 #. and the length modifier q.
11381 #. FreeBSD also has functions
11384 #. .BR vasprintf (),
11385 #. that allocate a buffer large enough for
11387 #. In glibc there are functions
11391 #. that print to a file descriptor instead of a stream.
11392 #. type: Plain text
11393 #: build/C/man3/printf.3:930
11395 "The glibc implementation of the functions B<snprintf>() and B<vsnprintf>() "
11396 "conforms to the C99 standard, that is, behaves as described above, since "
11397 "glibc version 2.1. Until glibc 2.0.6 they would return -1 when the output "
11400 "glibc の B<snprintf>() と B<vsnprintf>() の実装は、バージョン 2.1 以降は "
11401 "C99 標準に準拠しており、 上記の通りの動作をする。 glibc 2.0.6 までは、出力が"
11402 "切り詰められた場合は -1 を返す。"
11404 #. type: Plain text
11405 #: build/C/man3/printf.3:947
11407 "Because B<sprintf>() and B<vsprintf>() assume an arbitrarily long string, "
11408 "callers must be careful not to overflow the actual space; this is often "
11409 "impossible to assure. Note that the length of the strings produced is "
11410 "locale-dependent and difficult to predict. Use B<snprintf>() and "
11411 "B<vsnprintf>() instead (or B<asprintf>(3) and B<vasprintf>(3))."
11413 "B<sprintf>() と B<vsprintf>() は勝手に十分に長い文字列領域があると仮定する"
11414 "ので、呼び出し側は 実際の領域からあふれないように注意しなければならない。 し"
11415 "かし、これを保証することが不可能な場合が多い。 生成される文字列の長さはロケー"
11416 "ル依存であり、予測が難しいことに注意。 代わりに B<snprintf>() と "
11417 "B<vsnprintf>() (または B<asprintf>(3) と B<vasprintf>(3)) を使うこと。"
11419 #. type: Plain text
11420 #: build/C/man3/printf.3:960
11422 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
11423 "contains an B<snprintf>() equivalent to B<sprintf>(), that is, one that "
11424 "ignores the I<size> argument. Thus, the use of B<snprintf>() with early "
11425 "libc4 leads to serious security problems."
11427 "Linux libc4.[45] には B<snprintf>() はないが、 libbsd が提供されており、 そ"
11428 "の中には B<sprintf>() と等価な (つまり I<size> 引き数を無視する) "
11429 "B<snprintf>() がある。 したがって、初期の libc4 で B<snprintf>() を使うと、"
11430 "深刻なセキュリティ問題を引き起こすことがある。"
11433 #. Some floating-point conversions under early libc4
11434 #. caused memory leaks.
11435 #. type: Plain text
11436 #: build/C/man3/printf.3:974
11438 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
11439 "contain a % character. If I<foo> comes from untrusted user input, it may "
11440 "contain B<%n>, causing the B<printf>() call to write to memory and creating "
11443 "B<printf(>I<foo>B<);> のようなコードはしばしばバグを引き起こす。 なぜなら "
11444 "I<foo> に % 文字が含まれてるかもしれないからである。 I<foo> が信頼できない"
11445 "ユーザー入力から作られている場合には、 その中に B<%n> が含まれていることがあ"
11446 "り、 B<printf>() 呼び出し時にメモリへの書き込みが起こり、 セキュリティーホー"
11449 #. type: Plain text
11450 #: build/C/man3/printf.3:978
11451 msgid "To print I<Pi> to five decimal places:"
11452 msgstr "I<Pi> を 5 桁で出力する。"
11454 #. type: Plain text
11455 #: build/C/man3/printf.3:984
11458 "#include E<lt>math.hE<gt>\n"
11459 "#include E<lt>stdio.hE<gt>\n"
11460 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
11462 "#include E<lt>math.hE<gt>\n"
11463 "#include E<lt>stdio.hE<gt>\n"
11464 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
11466 #. type: Plain text
11467 #: build/C/man3/printf.3:993
11469 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
11470 "I<weekday> and I<month> are pointers to strings:"
11472 "日付と時間を \"Sunday, July 3, 10:02\" の形式で出力する。 (I<weekday> と "
11473 "I<month> は文字列へのポインタである)"
11475 #. type: Plain text
11476 #: build/C/man3/printf.3:999
11479 "#include E<lt>stdio.hE<gt>\n"
11480 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
11481 " weekday, month, day, hour, min);\n"
11483 "#include E<lt>stdio.hE<gt>\n"
11484 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
11485 "\tweekday, month, day, hour, min);\n"
11487 #. type: Plain text
11488 #: build/C/man3/printf.3:1005
11490 "Many countries use the day-month-year order. Hence, an internationalized "
11491 "version must be able to print the arguments in an order specified by the "
11494 "日 - 月 - 年 の順序で表示を行う国も多い。 従って、国際版では書式で指定された"
11495 "順番で 引き数を表示できなければならない。"
11497 #. type: Plain text
11498 #: build/C/man3/printf.3:1011
11501 "#include E<lt>stdio.hE<gt>\n"
11502 "fprintf(stdout, format,\n"
11503 " weekday, month, day, hour, min);\n"
11505 "#include E<lt>stdio.hE<gt>\n"
11506 "fprintf(stdout, format,\n"
11507 "\tweekday, month, day, hour, min);\n"
11509 #. type: Plain text
11510 #: build/C/man3/printf.3:1018
11512 "where I<format> depends on locale, and may permute the arguments. With the "
11515 "I<format> はロケールに依存しており、引き数の順番を変えることもできる。 "
11518 #. type: Plain text
11519 #: build/C/man3/printf.3:1022
11521 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
11522 msgstr "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
11524 #. type: Plain text
11525 #: build/C/man3/printf.3:1026
11526 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
11527 msgstr "であれば、 \"Sonntag, 3. Juli, 10:02\" という結果になる。"
11529 #. type: Plain text
11530 #: build/C/man3/printf.3:1029
11532 "To allocate a sufficiently large string and print into it (code correct for "
11533 "both glibc 2.0 and glibc 2.1):"
11535 "十分に大きな文字列領域を確保して、そこにメッセージを格納するには (glibc 2.0 "
11536 "と glibc 2.1 の両方で正しく動作するコード):"
11538 #. type: Plain text
11539 #: build/C/man3/printf.3:1034
11542 "#include E<lt>stdio.hE<gt>\n"
11543 "#include E<lt>stdlib.hE<gt>\n"
11544 "#include E<lt>stdarg.hE<gt>\n"
11546 "#include E<lt>stdio.hE<gt>\n"
11547 "#include E<lt>stdlib.hE<gt>\n"
11548 "#include E<lt>stdarg.hE<gt>\n"
11550 #. type: Plain text
11551 #: build/C/man3/printf.3:1042
11555 "make_message(const char *fmt, ...)\n"
11558 " int size = 100; /* Guess we need no more than 100 bytes */\n"
11563 "make_message(const char *fmt, ...)\n"
11566 " int size = 100; /* Guess we need no more than 100 bytes */\n"
11570 #. type: Plain text
11571 #: build/C/man3/printf.3:1046
11574 " p = malloc(size);\n"
11575 " if (p == NULL)\n"
11578 " p = malloc(size);\n"
11579 " if (p == NULL)\n"
11582 #. type: Plain text
11583 #: build/C/man3/printf.3:1048
11585 msgid " while (1) {\n"
11586 msgstr " while (1) {\n"
11588 #. type: Plain text
11589 #: build/C/man3/printf.3:1050
11591 msgid " /* Try to print in the allocated space */\n"
11592 msgstr " /* Try to print in the allocated space */\n"
11594 #. type: Plain text
11595 #: build/C/man3/printf.3:1054
11598 " va_start(ap, fmt);\n"
11599 " n = vsnprintf(p, size, fmt, ap);\n"
11602 " va_start(ap, fmt);\n"
11603 " n = vsnprintf(p, size, fmt, ap);\n"
11606 #. type: Plain text
11607 #: build/C/man3/printf.3:1056
11609 msgid " /* Check error code */\n"
11610 msgstr " /* Check error code */\n"
11612 #. type: Plain text
11613 #: build/C/man3/printf.3:1061
11616 " if (n E<lt> 0) {\n"
11621 " if (n E<lt> 0) {\n"
11626 #. type: Plain text
11627 #: build/C/man3/printf.3:1063
11629 msgid " /* If that worked, return the string */\n"
11630 msgstr " /* If that worked, return the string */\n"
11632 #. type: Plain text
11633 #: build/C/man3/printf.3:1066
11636 " if (n E<lt> size)\n"
11639 " if (n E<lt> size)\n"
11642 #. type: Plain text
11643 #: build/C/man3/printf.3:1068
11645 msgid " /* Else try again with more space */\n"
11646 msgstr " /* Else try again with more space */\n"
11648 #. type: Plain text
11649 #: build/C/man3/printf.3:1070
11651 msgid " size = n + 1; /* Precisely what is needed */\n"
11652 msgstr " size = n + 1; /* Precisely what is needed */\n"
11654 #. type: Plain text
11655 #: build/C/man3/printf.3:1081
11658 " np = realloc(p, size);\n"
11659 " if (np == NULL) {\n"
11668 " np = realloc(p, size);\n"
11669 " if (np == NULL) {\n"
11678 #. type: Plain text
11679 #: build/C/man3/printf.3:1085
11681 "If truncation occurs in glibc versions prior to 2.0.6, this is treated as an "
11682 "error instead of being handled gracefully."
11684 "バージョン 2.0.6 より前の glibc で切り詰めが起こった場合、切り詰めは適切に処"
11687 #. type: Plain text
11688 #: build/C/man3/printf.3:1094
11690 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
11691 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
11693 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
11694 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
11697 #: build/C/man3/puts.3:26
11703 #: build/C/man3/puts.3:26 build/C/man3/scanf.3:52
11706 msgstr "2014-01-11"
11708 #. type: Plain text
11709 #: build/C/man3/puts.3:29
11710 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
11711 msgstr "fputc, fputs, putc, putchar, puts - 文字と文字列の出力"
11713 #. type: Plain text
11714 #: build/C/man3/puts.3:34
11716 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
11717 msgstr "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
11719 #. type: Plain text
11720 #: build/C/man3/puts.3:36
11722 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11723 msgstr "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11725 #. type: Plain text
11726 #: build/C/man3/puts.3:38
11728 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
11729 msgstr "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
11731 #. type: Plain text
11732 #: build/C/man3/puts.3:40
11734 msgid "B<int putchar(int >I<c>B<);>\n"
11735 msgstr "B<int putchar(int >I<c>B<);>\n"
11737 #. type: Plain text
11738 #: build/C/man3/puts.3:42
11740 msgid "B<int puts(const char *>I<s>B<);>\n"
11741 msgstr "B<int puts(const char *>I<s>B<);>\n"
11743 #. type: Plain text
11744 #: build/C/man3/puts.3:51
11746 "B<fputc>() writes the character I<c>, cast to an I<unsigned char>, to "
11749 "B<fputc>() は、キャラクタ I<c> を I<unsigned char> にキャストし、 I<stream> "
11752 #. type: Plain text
11753 #: build/C/man3/puts.3:58
11755 "B<fputs>() writes the string I<s> to I<stream>, without its terminating "
11756 "null byte (\\(aq\\e0\\(aq)."
11758 "B<fputs>() は、文字列 I<s> を I<stream> に書き込む。 文字列終端のヌルバイト "
11759 "(\\(aq\\e0\\(aq) は出力しない。"
11761 #. type: Plain text
11762 #: build/C/man3/puts.3:65
11764 "B<putc>() is equivalent to B<fputc>() except that it may be implemented as "
11765 "a macro which evaluates I<stream> more than once."
11767 "B<putc>() は、 I<stream> を一度以上評価するマクロとして実装されているかも知"
11768 "れないという点を除き、 B<fputc>() と同じである。"
11770 #. type: Plain text
11771 #: build/C/man3/puts.3:69
11772 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<, >I<stdout>B<).>"
11773 msgstr "B<putchar(>I<c>B<);> は、 B<putc(>I<c>B<,>I<stdout>B<)> と同じである。"
11775 #. type: Plain text
11776 #: build/C/man3/puts.3:76
11777 msgid "B<puts>() writes the string I<s> and a trailing newline to I<stdout>."
11778 msgstr "B<puts>() は、文字列 I<s> と改行を I<stdout> に書き込む。"
11780 #. type: Plain text
11781 #: build/C/man3/puts.3:81
11783 "Calls to the functions described here can be mixed with each other and with "
11784 "calls to other output functions from the I<stdio> library for the same "
11787 "ここで説明された関数はお互いに混在して使用することができ、また、 I<stdio> ラ"
11788 "イブラリに含まれる他の出力関数を同じ出力ストリームに対して 呼び出す事が出来"
11791 #. type: Plain text
11792 #: build/C/man3/puts.3:96
11794 "B<fputc>(), B<putc>() and B<putchar>() return the character written as an "
11795 "I<unsigned char> cast to an I<int> or B<EOF> on error."
11797 "B<fputc>(), B<putc>(), B<putchar>() は I<unsigned char> として書き込まれた文"
11798 "字を I<int> にキャストして返す。 エラーが発生した場合は B<EOF> を返す。"
11800 #. type: Plain text
11801 #: build/C/man3/puts.3:103
11803 "B<puts>() and B<fputs>() return a nonnegative number on success, or B<EOF> "
11806 "B<puts>() と B<fputs>() は、成功すると負ではない数を、エラーが発生した場合"
11809 #. type: Plain text
11810 #: build/C/man3/puts.3:112
11812 "It is not advisable to mix calls to output functions from the I<stdio> "
11813 "library with low-level calls to B<write>(2) for the file descriptor "
11814 "associated with the same output stream; the results will be undefined and "
11815 "very probably not what you want."
11817 "I<stdio> ライブラリに含まれる出力関数と、同じ出力ストリームに結びつけられた "
11818 "ファイルディスクリプタに対する B<write>(2) の低レベル呼び出しを混在して 使用"
11819 "することは賢明ではない。 その結果は定義されておらず、望む結果が得られない可能"
11822 #. type: Plain text
11823 #: build/C/man3/puts.3:124
11825 "B<write>(2), B<ferror>(3), B<fgets>(3), B<fopen>(3), B<fputwc>(3), "
11826 "B<fputws>(3), B<fseek>(3), B<fwrite>(3), B<putwchar>(3), B<scanf>(3), "
11827 "B<unlocked_stdio>(3)"
11829 "B<write>(2), B<ferror>(3), B<fgets>(3), B<fopen>(3), B<fputwc>(3), "
11830 "B<fputws>(3), B<fseek>(3), B<fwrite>(3), B<putwchar>(3), B<scanf>(3), "
11831 "B<unlocked_stdio>(3)"
11834 #: build/C/man2/read.2:35
11840 #: build/C/man2/read.2:35 build/C/man2/write.2:39
11843 msgstr "2014-05-04"
11845 #. type: Plain text
11846 #: build/C/man2/read.2:38
11847 msgid "read - read from a file descriptor"
11848 msgstr "read - ファイルディスクリプタから読み込む"
11850 #. type: Plain text
11851 #: build/C/man2/read.2:43
11853 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
11854 msgstr "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
11856 #. type: Plain text
11857 #: build/C/man2/read.2:52
11859 "B<read>() attempts to read up to I<count> bytes from file descriptor I<fd> "
11860 "into the buffer starting at I<buf>."
11862 "B<read>() はファイルディスクリプタ (file descriptor) I<fd> から最大 "
11863 "I<count> バイトを I<buf> で始まるバッファーへ読み込もうとする。"
11865 #. type: Plain text
11866 #: build/C/man2/read.2:60
11868 "On files that support seeking, the read operation commences at the current "
11869 "file offset, and the file offset is incremented by the number of bytes "
11870 "read. If the current file offset is at or past the end of file, no bytes "
11871 "are read, and B<read>() returns zero."
11873 "seek に対応しているファイルでは、read は現在のファイルオフセットから行われ、"
11874 "ファイルオフセットは読み込んだバイト数分だけ進められる。現在のファイルオフ"
11875 "セットがファイル末尾かそれより先の場合は、読み出しは行われず、 B<read>() は "
11878 #. type: Plain text
11879 #: build/C/man2/read.2:75
11881 "If I<count> is zero, B<read>() I<may> detect the errors described below. "
11882 "In the absence of any errors, or if B<read>() does not check for errors, a "
11883 "B<read>() with a I<count> of 0 returns zero and has no other effects."
11885 "I<count> が 0 の場合、 B<read>() は以下で説明するエラーを検出するI<場合がある"
11886 ">。 どのエラーもなかった場合、もしくは B<read>() がエラーのチェックを行わない"
11887 "場合、 I<count> が 0 で呼び出された B<read>() は 0 を返し、何も行わない。"
11889 #. type: Plain text
11890 #: build/C/man2/read.2:81
11891 msgid "If I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
11892 msgstr "I<count> が B<SSIZE_MAX> より大きければ、結果は規定できない。"
11894 #. type: Plain text
11895 #: build/C/man2/read.2:95
11897 "On success, the number of bytes read is returned (zero indicates end of "
11898 "file), and the file position is advanced by this number. It is not an error "
11899 "if this number is smaller than the number of bytes requested; this may "
11900 "happen for example because fewer bytes are actually available right now "
11901 "(maybe because we were close to end-of-file, or because we are reading from "
11902 "a pipe, or from a terminal), or because B<read>() was interrupted by a "
11903 "signal. On error, -1 is returned, and I<errno> is set appropriately. In "
11904 "this case, it is left unspecified whether the file position (if any) changes."
11906 "成功した場合、読み込んだバイト数を返す (0 はファイルの終りを意味する)。 ファ"
11907 "イル位置はこの数だけ進められる。 この数が要求した数より小さかったとしてもエ"
11908 "ラーではない; 例えば今すぐには実際にそれだけの数しかない場合 (ファイルの最後"
11909 "に近いのかも しれないし、パイプ (pipe) や端末 (terminal) から読み込んでいるか"
11910 "もしれない) や B<read>() がシグナル (signal) によって割り込まれた場合にこれ"
11911 "は起こりえる。 エラーの場合は、-1 が返され、 I<errno> が適切に設定される。こ"
11912 "の場合はファイル位置が変更されるかどうかは 不定である。"
11915 #: build/C/man2/read.2:96 build/C/man3/scanf.3:548 build/C/man2/write.2:108
11920 #. type: Plain text
11921 #: build/C/man2/read.2:103
11923 "The file descriptor I<fd> refers to a file other than a socket and has been "
11924 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
11926 "ファイルディスクリプタ I<fd> がソケット以外のファイルを参照していて、 非停止 "
11927 "(nonblocking) モード (B<O_NONBLOCK>) に設定されており、読み込みを行うと停止"
11931 #: build/C/man2/read.2:103 build/C/man2/write.2:115
11933 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
11934 msgstr "B<EAGAIN> または B<EWOULDBLOCK>"
11936 #. Actually EAGAIN on Linux
11937 #. type: Plain text
11938 #: build/C/man2/read.2:114
11940 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11941 "(B<O_NONBLOCK>), and the read would block. POSIX.1-2001 allows either error "
11942 "to be returned for this case, and does not require these constants to have "
11943 "the same value, so a portable application should check for both "
11946 "ファイルディスクリプタ I<fd> がソケットを参照していて、非停止 (nonblocking) "
11947 "モード (B<O_NONBLOCK>) に設定されており、読み込みを行うと停止する状況にあ"
11948 "る。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これ"
11949 "ら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なア"
11950 "プリケーションでは、両方の可能性を 確認すべきである。"
11952 #. type: Plain text
11953 #: build/C/man2/read.2:118
11954 msgid "I<fd> is not a valid file descriptor or is not open for reading."
11956 "I<fd> が有効なファイルディスクリプタでないか、読み込みのために オープン "
11959 #. type: Plain text
11960 #: build/C/man2/read.2:122 build/C/man2/write.2:145
11961 msgid "I<buf> is outside your accessible address space."
11962 msgstr "I<buf> がアクセス可能なアドレス空間の外にある。"
11964 #. type: Plain text
11965 #: build/C/man2/read.2:126
11967 "The call was interrupted by a signal before any data was read; see "
11970 "何のデータも読み込まないうちにシグナルに割り込まれた。 B<signal>(7) 参照。"
11972 #. type: Plain text
11973 #: build/C/man2/read.2:137
11975 "I<fd> is attached to an object which is unsuitable for reading; or the file "
11976 "was opened with the B<O_DIRECT> flag, and either the address specified in "
11977 "I<buf>, the value specified in I<count>, or the current file offset is not "
11978 "suitably aligned."
11980 "I<fd> は読み込みに適していないオブジェクトを参照している。 もしくは、ファイル"
11981 "が B<O_DIRECT> フラグを指定してオープンされているが、 I<buf> に指定されたアド"
11982 "レス、 I<count> に指定された値、 現在のファイルオフセットのいずれかの アライ"
11985 #. type: Plain text
11986 #: build/C/man2/read.2:147
11988 "I<fd> was created via a call to B<timerfd_create>(2) and the wrong size "
11989 "buffer was given to B<read>(); see B<timerfd_create>(2) for further "
11992 "I<fd> が B<timerfd_create>(2) の呼び出しで作成されたが、 B<read>() に間違っ"
11993 "たサイズのバッファが渡された。 さらなる情報は B<timerfd_create>(2) を参照の"
11996 #. type: Plain text
11997 #: build/C/man2/read.2:158
11999 "I/O error. This will happen for example when the process is in a background "
12000 "process group, tries to read from its controlling terminal, and either it is "
12001 "ignoring or blocking B<SIGTTIN> or its process group is orphaned. It may "
12002 "also occur when there is a low-level I/O error while reading from a disk or "
12005 "I/O エラー。これは例えばプロセスがバックグランド・プロセスグループで、それを"
12006 "制御している端末から読み込もうとし、 B<SIGTTIN> が無視 (ignore) または禁止 "
12007 "(blocking) されている場合や、 そのプロセスグループが孤立 (orphan) している場"
12008 "合に起こる。 またディスクやテープを読んでいる時に低レベル I/O エラー が発生し"
12011 #. type: Plain text
12012 #: build/C/man2/read.2:162
12013 msgid "I<fd> refers to a directory."
12014 msgstr "I<fd> がディレクトリを参照している。"
12016 #. type: Plain text
12017 #: build/C/man2/read.2:173
12019 "Other errors may occur, depending on the object connected to I<fd>. POSIX "
12020 "allows a B<read>() that is interrupted after reading some data to return -1 "
12021 "(with I<errno> set to B<EINTR>) or to return the number of bytes already "
12024 "I<fd> が接続しているオブジェクトによっては他のエラーも起こりえる。 POSIX で"
12025 "は、 いくらかのデータを読んだ後に割り込みが起こった場合、 B<read>() は "
12026 "(I<errno> に B<EINTR> を設定して) -1 を返してもよいし、 既に読み込んだバイト"
12029 #. type: Plain text
12030 #: build/C/man2/read.2:187
12032 "On NFS filesystems, reading small amounts of data will update the timestamp "
12033 "only the first time, subsequent calls may not do so. This is caused by "
12034 "client side attribute caching, because most if not all NFS clients leave "
12035 "st_atime (last file access time) updates to the server and client side "
12036 "reads satisfied from the client's cache will not cause st_atime updates on "
12037 "the server as there are no server side reads. UNIX semantics can be "
12038 "obtained by disabling client side attribute caching, but in most situations "
12039 "this will substantially increase server load and decrease performance."
12041 "NFS において。少量のデータを読み込む場合、最初の時のみにタイム スタンプが更新"
12042 "され、続くコールでは更新されないだろう。 これはクライアント側で属性のキャッシ"
12043 "ングを行なうためである。 なぜならば、もし全ての NFS クライアントが st_atime "
12044 "(最終ファイルアクセス時刻) の更新をサーバーに送らず、クライアント側でキャッ"
12045 "シュを読むことに満足して いれば、サーバー側での read は発生しないので "
12046 "st_atime の更新は行なわれからだ。 UNIX の方式では、クライアント側の属性の"
12047 "キャッシングを無効にすることで、 これを得ることができる。しかしほとんどの状況"
12048 "ではこれは続くサーバーの 負荷を増加させ、パフォーマンスの低下をもたらす。"
12050 #. type: Plain text
12051 #: build/C/man2/read.2:190 build/C/man2/write.2:214
12053 "According to POSIX.1-2008/SUSv4 Section XSI 2.9.7 (\"Thread Interactions "
12054 "with Regular File Operations\"):"
12057 #. type: Plain text
12058 #: build/C/man2/read.2:195 build/C/man2/write.2:219
12060 "All of the following functions shall be atomic with respect to each other in "
12061 "the effects specified in POSIX.1-2008 when they operate on regular files or "
12062 "symbolic links: ..."
12066 #. http://thread.gmane.org/gmane.linux.kernel/1649458
12067 #. From: Michael Kerrisk (man-pages <mtk.manpages <at> gmail.com>
12068 #. Subject: Update of file offset on write() etc. is non-atomic with I/O
12069 #. Date: 2014-02-17 15:41:37 GMT
12070 #. Newsgroups: gmane.linux.kernel, gmane.linux.file-systems
12071 #. commit 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4
12072 #. Author: Linus Torvalds <torvalds@linux-foundation.org>
12073 #. Date: Mon Mar 3 09:36:58 2014 -0800
12074 #. vfs: atomic f_pos accesses as per POSIX
12075 #. type: Plain text
12076 #: build/C/man2/read.2:226
12078 "Among the APIs subsequently listed are B<read>() and B<readv>(2). And "
12079 "among the effects that should be atomic across threads (and processes) are "
12080 "updates of the file offset. However, on Linux before version 3.14, this was "
12081 "not the case: if two processes that share an open file description (see "
12082 "B<open>(2)) perform a B<read>() (or B<readv>(2)) at the same time, then "
12083 "the I/O operations were not atomic with respect updating the file offset, "
12084 "with the result that the reads in the two processes might (incorrectly) "
12085 "overlap in the blocks of data that they obtained. This problem was fixed in "
12089 #. type: Plain text
12090 #: build/C/man2/read.2:239
12092 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
12093 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
12096 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
12097 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
12101 #: build/C/man2/readlink.2:44
12106 #. type: Plain text
12107 #: build/C/man2/readlink.2:47
12108 msgid "readlink, readlinkat - read value of a symbolic link"
12109 msgstr "readlink, readlinkat - シンボリックリンクの値を読む"
12111 #. type: Plain text
12112 #: build/C/man2/readlink.2:53
12114 msgid "B<ssize_t readlink(const char *>I<pathname>B<, char *>I<buf>B<, size_t >I<bufsiz>B<);>\n"
12115 msgstr "B<ssize_t readlink(const char *>I<pathname>B<, char *>I<buf>B<, size_t >I<bufsiz>B<);>\n"
12117 #. type: Plain text
12118 #: build/C/man2/readlink.2:59
12121 "B<ssize_t readlinkat(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
12122 "B< char *>I<buf>B<, size_t >I<bufsiz>B<);>\n"
12124 "B<ssize_t readlinkat(int >I<dirfd>B<, const char *>I<pathname>B<,>\n"
12125 "B< char *>I<buf>B<, size_t >I<bufsiz>B<);>\n"
12127 #. type: Plain text
12128 #: build/C/man2/readlink.2:68
12129 msgid "B<readlink>():"
12130 msgstr "B<readlink>():"
12132 #. type: Plain text
12133 #: build/C/man2/readlink.2:71 build/C/man2/symlink.2:59
12135 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
12136 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
12138 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
12139 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
12141 #. type: Plain text
12142 #: build/C/man2/readlink.2:74
12143 msgid "B<readlinkat>():"
12144 msgstr "B<readlinkat>():"
12146 #. type: Plain text
12147 #: build/C/man2/readlink.2:100
12149 "B<readlink>() places the contents of the symbolic link I<pathname> in the "
12150 "buffer I<buf>, which has size I<bufsiz>. B<readlink>() does not append a "
12151 "null byte to I<buf>. It will truncate the contents (to a length of "
12152 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
12155 "B<readlink>() は I<pathname> で与えられたシンボリックリンクの内容を I<buf> "
12156 "バッファーへ格納する、 I<buf> のサイズは I<bufsiz> である。 B<readlink>() は"
12157 "ヌルバイトを I<buf> に追加しない。 その内容全てを格納するのにバッファーが小さ"
12158 "過ぎる場合は、 (I<bufsiz> バイトの長さに) 内容を切り詰める。"
12161 #: build/C/man2/readlink.2:100
12163 msgid "readlinkat()"
12164 msgstr "readlinkat()"
12166 #. type: Plain text
12167 #: build/C/man2/readlink.2:106
12169 "The B<readlinkat>() system call operates in exactly the same way as "
12170 "B<readlink>(), except for the differences described here."
12172 "B<readlinkat>() システムコールは B<readlink>() と全く同様に動作するが、以下で"
12175 #. type: Plain text
12176 #: build/C/man2/readlink.2:116
12178 "If the pathname given in I<pathname> is relative, then it is interpreted "
12179 "relative to the directory referred to by the file descriptor I<dirfd> "
12180 "(rather than relative to the current working directory of the calling "
12181 "process, as is done by B<readlink>() for a relative pathname)."
12183 "I<pathname> で指定されたパス名が相対パスの場合、このパス名はファイルディスク"
12184 "リプター I<dirfd> が参照するディレクトリに対する相対パスと解釈される "
12185 "(B<readlink>() に相対パス名を渡した場合のように、呼び出したプロセスのカレント"
12186 "ワーキングディレクトリに対する相対パスではない)。"
12188 #. type: Plain text
12189 #: build/C/man2/readlink.2:128
12191 "If I<pathname> is relative and I<dirfd> is the special value B<AT_FDCWD>, "
12192 "then I<pathname> is interpreted relative to the current working directory of "
12193 "the calling process (like B<readlink>())."
12195 "I<pathname> で指定されたパス名が相対パスで、 I<dirfd> が特別な値 B<AT_FDCWD> "
12196 "の場合、 (B<readlink>() と同様に) I<pathname> は呼び出したプロセスのカレント"
12197 "ワーキングディレクトリに対する相対パスと解釈される。"
12199 #. commit 65cfc6722361570bfe255698d9cd4dccaf47570d
12200 #. type: Plain text
12201 #: build/C/man2/readlink.2:148
12203 "Since Linux 2.6.39, I<pathname> can be an empty string, in which case the "
12204 "call operates on the file referred to by I<dirfd> (which may have been "
12205 "obtained using the B<open>(2) B<O_PATH> flag). In this case, I<dirfd> can "
12206 "refer to any type of file, not just a directory."
12208 "Linux 2.6.39 以降では、 I<pathname> に空文字列を指定できる。 その場合、呼び出"
12209 "しは I<dirfd> が参照するファイルに対して行われる (I<dirfd> は B<open>(2) の "
12210 "B<O_PATH> フラグを使って取得できる)。 この場合、 I<dirfd> はディレクトリだけ"
12211 "でなく、ファイルを参照していてもよい。"
12213 #. type: Plain text
12214 #: build/C/man2/readlink.2:153
12215 msgid "See B<openat>(2) for an explanation of the need for B<readlinkat>()."
12216 msgstr "B<readlinkat>() の必要性についての説明については B<openat>(2) を参照。"
12218 #. type: Plain text
12219 #: build/C/man2/readlink.2:159
12221 "On success, these calls return the number of bytes placed in I<buf>. On "
12222 "error, -1 is returned and I<errno> is set to indicate the error."
12224 "成功すると、これらのシステムコールは I<buf> に格納されたバイト数を返す。 エ"
12225 "ラーの場合、-1 を返し、 I<errno> にエラーを示す値を設定する。"
12227 #. type: Plain text
12228 #: build/C/man2/readlink.2:165
12230 "Search permission is denied for a component of the path prefix. (See also "
12231 "B<path_resolution>(7).)"
12233 "パスのディレクトリ部分に検索許可が与えられていない (B<path_resolution>(7) も"
12236 #. type: Plain text
12237 #: build/C/man2/readlink.2:169
12238 msgid "I<buf> extends outside the process's allocated address space."
12239 msgstr "I<buf> がプロセスに割り当てられたアドレス空間の外を指している。"
12241 #. At the glibc level, bufsiz is unsigned, so this error can only occur
12242 #. if bufsiz==0. However, the in the kernel syscall, bufsiz is signed,
12243 #. and this error can also occur if bufsiz < 0.
12244 #. See: http://thread.gmane.org/gmane.linux.man/380
12245 #. Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
12246 #. type: Plain text
12247 #: build/C/man2/readlink.2:178
12248 msgid "I<bufsiz> is not positive."
12249 msgstr "I<bufsiz> が正でない。"
12251 #. type: Plain text
12252 #: build/C/man2/readlink.2:181
12253 msgid "The named file is not a symbolic link."
12254 msgstr "指定したファイルがシンボリックリンクでない。"
12256 #. type: Plain text
12257 #: build/C/man2/readlink.2:184
12258 msgid "An I/O error occurred while reading from the filesystem."
12259 msgstr "ファイルシステムの読み込み中に I/O エラーが起こった。"
12261 #. type: Plain text
12262 #: build/C/man2/readlink.2:187
12263 msgid "Too many symbolic links were encountered in translating the pathname."
12264 msgstr "パス名にシンボリックリンクが多すぎる。"
12266 #. type: Plain text
12267 #: build/C/man2/readlink.2:190
12268 msgid "A pathname, or a component of a pathname, was too long."
12269 msgstr "パス名かパス名の一部分が長過ぎる。"
12271 #. type: Plain text
12272 #: build/C/man2/readlink.2:193
12273 msgid "The named file does not exist."
12274 msgstr "その名前のファイルが存在しない。"
12276 #. type: Plain text
12277 #: build/C/man2/readlink.2:199
12278 msgid "A component of the path prefix is not a directory."
12279 msgstr "パスのディレクトリ部分がディレクトリでない。"
12281 #. type: Plain text
12282 #: build/C/man2/readlink.2:202
12283 msgid "The following additional errors can occur for B<readlinkat>():"
12284 msgstr "B<readlinkat>() では以下のエラーも発生する。"
12286 #. type: Plain text
12287 #: build/C/man2/readlink.2:212 build/C/man2/unlink.2:269
12289 "I<pathname> is relative and I<dirfd> is a file descriptor referring to a "
12290 "file other than a directory."
12292 "I<pathname> が相対パスで、 I<dirfd> がディレクトリ以外のファイルを参照してい"
12295 #. type: Plain text
12296 #: build/C/man2/readlink.2:216
12298 "B<readlinkat>() was added to Linux in kernel 2.6.16; library support was "
12299 "added to glibc in version 2.4."
12301 "B<readlinkat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサ"
12302 "ポートはバージョン 2.4 で glibc に追加された。"
12304 #. type: Plain text
12305 #: build/C/man2/readlink.2:222
12307 "B<readlink>(): 4.4BSD (B<readlink>() first appeared in 4.2BSD), "
12308 "POSIX.1-2001, POSIX.1-2008."
12310 "4.4BSD (B<readlink>() は 4.2BSD で初めて登場した), POSIX.1-2001, "
12313 #. type: Plain text
12314 #: build/C/man2/readlink.2:225
12315 msgid "B<readlinkat>(): POSIX.1-2008."
12316 msgstr "B<readlinkat>(): POSIX.1-2008."
12318 #. type: Plain text
12319 #: build/C/man2/readlink.2:233
12321 "In versions of glibc up to and including glibc 2.4, the return type of "
12322 "B<readlink>() was declared as I<int>. Nowadays, the return type is "
12323 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
12325 "バージョン 2.4 以前の glibc (バージョン 2.4 を含む) では、 B<readlink>() の"
12326 "返り値の型は I<int> で宣言されていた。現在では、返り値の型は I<ssize_t> であ"
12327 "る (返り値 I<ssize_t> は POSIX.1-2001 で (新たに) 必須となった)。"
12329 #. type: Plain text
12330 #: build/C/man2/readlink.2:256
12332 "Using a statically sized buffer might not provide enough room for the "
12333 "symbolic link contents. The required size for the buffer can be obtained "
12334 "from the I<stat.st_size> value returned by a call to B<lstat>(2) on the "
12335 "link. However, the number of bytes written by B<readlink>() and "
12336 "B<readlinkat>() should be checked to make sure that the size of the "
12337 "symbolic link did not increase between the calls. Dynamically allocating "
12338 "the buffer for B<readlink>() and B<readlinkat>() also addresses a common "
12339 "portability problem when using I<PATH_MAX> for the buffer size, as this "
12340 "constant is not guaranteed to be defined per POSIX if the system does not "
12343 "静的な大きさのバッファを使うと、 シンボリックリンクの内容を格納するのに十分な"
12344 "領域がない場合がある。 バッファに必要なサイズは、 そのシンボリックリンクに対"
12345 "して B<lstat>(2) の呼び出しで返される I<stat.st_size> の値から取得できる。 た"
12346 "だし、 B<readlink>() や B<readlinkat>() が書き込んだバイト数をチェックして、 "
12347 "シンボリックリンクのサイズが二つの呼び出しの間で増えていないことを確認すべき"
12348 "である。 B<readlink>() や B<readlinkat>() 用のバッファを動的に割り当てる方法"
12349 "でも、 バッファサイズとして I<PATH_MAX> を使用する場合に共通する移植性の問題"
12350 "を解決することができる。 なぜなら、POSIX では、 システムがそのような上限値を"
12351 "定義していない場合には、 I<PATH_MAX> が定義されることが保証されていないからで"
12354 #. type: Plain text
12355 #: build/C/man2/readlink.2:262
12357 "The following program allocates the buffer needed by B<readlink>() "
12358 "dynamically from the information provided by B<lstat>(), making sure there's "
12359 "no race condition between the calls."
12361 "以下のプログラムは、 B<readlink>() が必要とするバッファを、\n"
12362 "B<lstat>() が提供する情報に基づいて動的に割り当てる。\n"
12363 "また、両方の呼び出し間で競合条件がないことを保証している。"
12365 #. type: Plain text
12366 #: build/C/man2/readlink.2:269
12369 "#include E<lt>sys/types.hE<gt>\n"
12370 "#include E<lt>sys/stat.hE<gt>\n"
12371 "#include E<lt>stdio.hE<gt>\n"
12372 "#include E<lt>stdlib.hE<gt>\n"
12373 "#include E<lt>unistd.hE<gt>\n"
12375 "#include E<lt>sys/types.hE<gt>\n"
12376 "#include E<lt>sys/stat.hE<gt>\n"
12377 "#include E<lt>stdio.hE<gt>\n"
12378 "#include E<lt>stdlib.hE<gt>\n"
12379 "#include E<lt>unistd.hE<gt>\n"
12381 #. type: Plain text
12382 #: build/C/man2/readlink.2:276
12386 "main(int argc, char *argv[])\n"
12388 " struct stat sb;\n"
12389 " char *linkname;\n"
12393 "main(int argc, char *argv[])\n"
12395 " struct stat sb;\n"
12396 " char *linkname;\n"
12399 #. type: Plain text
12400 #: build/C/man2/readlink.2:281
12403 " if (argc != 2) {\n"
12404 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
12405 " exit(EXIT_FAILURE);\n"
12408 " if (argc != 2) {\n"
12409 " fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
12410 " exit(EXIT_FAILURE);\n"
12413 #. type: Plain text
12414 #: build/C/man2/readlink.2:286
12417 " if (lstat(argv[1], &sb) == -1) {\n"
12418 " perror(\"lstat\");\n"
12419 " exit(EXIT_FAILURE);\n"
12422 " if (lstat(argv[1], &sb) == -1) {\n"
12423 " perror(\"lstat\");\n"
12424 " exit(EXIT_FAILURE);\n"
12427 #. type: Plain text
12428 #: build/C/man2/readlink.2:292
12431 " linkname = malloc(sb.st_size + 1);\n"
12432 " if (linkname == NULL) {\n"
12433 " fprintf(stderr, \"insufficient memory\\en\");\n"
12434 " exit(EXIT_FAILURE);\n"
12437 " linkname = malloc(sb.st_size + 1);\n"
12438 " if (linkname == NULL) {\n"
12439 " fprintf(stderr, \"insufficient memory\\en\");\n"
12440 " exit(EXIT_FAILURE);\n"
12443 #. type: Plain text
12444 #: build/C/man2/readlink.2:294
12446 msgid " r = readlink(argv[1], linkname, sb.st_size + 1);\n"
12447 msgstr " r = readlink(argv[1], linkname, sb.st_size + 1);\n"
12449 #. type: Plain text
12450 #: build/C/man2/readlink.2:299
12453 " if (r == -1) {\n"
12454 " perror(\"readlink\");\n"
12455 " exit(EXIT_FAILURE);\n"
12458 " if (r == -1) {\n"
12459 " perror(\"readlink\");\n"
12460 " exit(EXIT_FAILURE);\n"
12463 #. type: Plain text
12464 #: build/C/man2/readlink.2:305
12467 " if (r E<gt> sb.st_size) {\n"
12468 " fprintf(stderr, \"symlink increased in size \"\n"
12469 " \"between lstat() and readlink()\\en\");\n"
12470 " exit(EXIT_FAILURE);\n"
12473 " if (r E<gt> sb.st_size) {\n"
12474 " fprintf(stderr, \"symlink increased in size \"\n"
12475 " \"between lstat() and readlink()\\en\");\n"
12476 " exit(EXIT_FAILURE);\n"
12479 #. type: Plain text
12480 #: build/C/man2/readlink.2:307
12482 msgid " linkname[r] = \\(aq\\e0\\(aq;\n"
12483 msgstr " linkname[r] = \\(aq\\e0\\(aq;\n"
12485 #. type: Plain text
12486 #: build/C/man2/readlink.2:309
12488 msgid " printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], linkname);\n"
12489 msgstr " printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], linkname);\n"
12491 #. type: Plain text
12492 #: build/C/man2/readlink.2:320
12494 "B<readlink>(1), B<lstat>(2), B<stat>(2), B<symlink>(2), "
12495 "B<path_resolution>(7), B<symlink>(7)"
12497 "B<readlink>(1), B<lstat>(2), B<stat>(2), B<symlink>(2), "
12498 "B<path_resolution>(7), B<symlink>(7)"
12501 #: build/C/man2/readv.2:32
12507 #: build/C/man2/readv.2:32
12510 msgstr "2010-11-17"
12512 #. type: Plain text
12513 #: build/C/man2/readv.2:35
12515 "readv, writev, preadv, pwritev - read or write data into multiple buffers"
12516 msgstr "readv, writev, preadv, pwritev - 複数のバッファへの読み書きを行なう"
12518 #. type: Plain text
12519 #: build/C/man2/readv.2:38
12521 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
12522 msgstr "B<#include E<lt>sys/uio.hE<gt>>\n"
12524 #. type: Plain text
12525 #: build/C/man2/readv.2:40
12527 msgid "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<);>\n"
12528 msgstr "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<);>\n"
12530 #. type: Plain text
12531 #: build/C/man2/readv.2:42
12533 msgid "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<);>\n"
12534 msgstr "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<);>\n"
12536 #. type: Plain text
12537 #: build/C/man2/readv.2:45
12540 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<,>\n"
12541 "B< off_t >I<offset>B<);>\n"
12543 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<,>\n"
12544 "B< off_t >I<offset>B<);>\n"
12546 #. type: Plain text
12547 #: build/C/man2/readv.2:48
12550 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<,>\n"
12551 "B< off_t >I<offset>B<);>\n"
12553 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int >I<iovcnt>B<,>\n"
12554 "B< off_t >I<offset>B<);>\n"
12556 #. type: Plain text
12557 #: build/C/man2/readv.2:58
12558 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
12559 msgstr "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
12561 #. type: Plain text
12562 #: build/C/man2/readv.2:68
12564 "The B<readv>() system call reads I<iovcnt> buffers from the file associated "
12565 "with the file descriptor I<fd> into the buffers described by I<iov> "
12566 "(\"scatter input\")."
12568 "B<readv>() システムコールは、ファイルディスクリプタ I<fd> に関連付けられた\n"
12569 "ファイルから、 I<iovcnt> 個のバッファ分のデータを読み込み、 I<iov> で指定\n"
12570 "されたバッファに格納する (\"scatter input\";「ばらまき入力」)。"
12572 #. type: Plain text
12573 #: build/C/man2/readv.2:78
12575 "The B<writev>() system call writes I<iovcnt> buffers of data described by "
12576 "I<iov> to the file associated with the file descriptor I<fd> (\"gather output"
12579 "B<writev>() システムコールは、 I<iov> で指定されたバッファから最大 "
12581 "個のバッファ分のデータを取り出し、 ファイルディスクリプタ I<fd> に関連付け"
12583 "れたファイルに書き込む (\"gather output\";「かき集め出力」)。"
12585 #. type: Plain text
12586 #: build/C/man2/readv.2:87
12588 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
12589 "I<E<lt>sys/uio.hE<gt>> as:"
12591 "ポインタ I<iov> は I<iovec> 構造体の配列へのポインタである。 I<iovec> 構造体"
12592 "は I<E<lt>sys/uio.hE<gt>> で以下のように定義されている:"
12594 #. type: Plain text
12595 #: build/C/man2/readv.2:95
12599 " void *iov_base; /* Starting address */\n"
12600 " size_t iov_len; /* Number of bytes to transfer */\n"
12604 " void *iov_base; /* Starting address */\n"
12605 " size_t iov_len; /* Number of bytes to transfer */\n"
12608 #. type: Plain text
12609 #: build/C/man2/readv.2:103
12611 "The B<readv>() system call works just like B<read>(2) except that multiple "
12612 "buffers are filled."
12614 "B<readv>() システムコールは、複数のバッファにデータを読み込む点を除いて\n"
12615 "B<read>(2) と全く同様の動作を行う。"
12617 #. type: Plain text
12618 #: build/C/man2/readv.2:109
12620 "The B<writev>() system call works just like B<write>(2) except that "
12621 "multiple buffers are written out."
12623 "B<writev>() システムコールは、複数のバッファのデータを書き出す点以外は\n"
12624 "B<write>(2) と全く同様の動作を行う。"
12626 #. type: Plain text
12627 #: build/C/man2/readv.2:128
12629 "Buffers are processed in array order. This means that B<readv>() "
12630 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on. (If "
12631 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
12632 "filled.) Similarly, B<writev>() writes out the entire contents of "
12633 "I<iov>[0] before proceeding to I<iov>[1], and so on."
12635 "バッファは配列の順序で処理される。これは、 B<readv>() が I<iov>[0] が完全に"
12636 "一杯になるまでデータを詰めてから、 I<iov>[1] などに進むことを意味する (データ"
12637 "が十分ない場合は、 I<iov> が指すバッファのいずれも一杯にならない)。 同様に、 "
12638 "B<writev>() は I<iov>[0] の内容を全部書き出してから I<iov>[1] などに進む。"
12640 #. type: Plain text
12641 #: build/C/man2/readv.2:146
12643 "The data transfers performed by B<readv>() and B<writev>() are atomic: the "
12644 "data written by B<writev>() is written as a single block that is not "
12645 "intermingled with output from writes in other processes (but see B<pipe>(7) "
12646 "for an exception); analogously, B<readv>() is guaranteed to read a "
12647 "contiguous block of data from the file, regardless of read operations "
12648 "performed in other threads or processes that have file descriptors referring "
12649 "to the same open file description (see B<open>(2))."
12651 "B<readv>() と B<writev>() によるデータ転送は atomic に行われる。つまり、 "
12652 "B<writev>() によるデータ書き込みは一つのブロックとして行われ、他のプロセス"
12653 "の write による書き込みと混ざり合うことはない (例外に関しては B<pipe>(7) を"
12654 "参照のこと)。同様に、 B<readv>() はファイルから連続するデータブロックが読み"
12655 "出すことが保証され、 同じファイル記述 (file description; B<open>(2) 参照) を"
12656 "参照するファイルディスクリプタを持つ他のスレッドやプロセスが 実行した read 操"
12660 #: build/C/man2/readv.2:146
12662 msgid "preadv() and pwritev()"
12663 msgstr "preadv() と pwritev()"
12665 #. type: Plain text
12666 #: build/C/man2/readv.2:159
12668 "The B<preadv>() system call combines the functionality of B<readv>() and "
12669 "B<pread>(2). It performs the same task as B<readv>(), but adds a fourth "
12670 "argument, I<offset>, which specifies the file offset at which the input "
12671 "operation is to be performed."
12673 "B<preadv>() システムコールは B<readv>() と B<preadv>(2) の機能を\n"
12675 "B<readv>() と同じ処理を実行するが、\n"
12676 "4 番目の引き数 I<offset> が追加されており、\n"
12677 "この引き数は入力操作を行うファイルオフセットを指定する。"
12679 #. type: Plain text
12680 #: build/C/man2/readv.2:172
12682 "The B<pwritev>() system call combines the functionality of B<writev>() and "
12683 "B<pwrite>(2). It performs the same task as B<writev>(), but adds a fourth "
12684 "argument, I<offset>, which specifies the file offset at which the output "
12685 "operation is to be performed."
12687 "B<pwritev>() システムコールは B<writev>() と B<pwrite>(2) の機能を\n"
12689 "B<writev>() と同じ処理を実行するが、\n"
12690 "4 番目の引き数 I<offset> が追加されており、\n"
12691 "この引き数は出力操作を行うファイルオフセットを指定する。"
12693 #. type: Plain text
12694 #: build/C/man2/readv.2:177
12696 "The file offset is not changed by these system calls. The file referred to "
12697 "by I<fd> must be capable of seeking."
12699 "これらのシステムコールで、ファイルオフセットは変更されない。\n"
12700 "I<fd> が参照するファイルは seek 可能でなければならない。"
12702 #. type: Plain text
12703 #: build/C/man2/readv.2:188
12705 "On success, B<readv>() and B<preadv>() return the number of bytes read; "
12706 "B<writev>() and B<pwritev>() return the number of bytes written. On "
12707 "error, -1 is returned, and I<errno> is set appropriately."
12709 "成功した場合、 B<readv>() と B<preadv> は読み込んだバイト数を返し、\n"
12710 "B<writev>() と B<pwritev>()は書き込んだバイト数を返す。\n"
12711 "エラーの場合 -1 を返し、I<errno> を適切に設定する。"
12713 #. type: Plain text
12714 #: build/C/man2/readv.2:200
12716 "The errors are as given for B<read>(2) and B<write>(2). Furthermore, "
12717 "B<preadv>() and B<pwritev>() can also fail for the same reasons as "
12718 "B<lseek>(2). Additionally, the following error is defined:"
12720 "B<read>(2) や B<write>(2) と同じエラーが定義されている。\n"
12721 "さらに、 B<preadv>() と B<pwritev>() は B<lseek>(2) と同じ理由でも失敗す"
12723 "また、追加で以下のエラーが定義されている:"
12725 #. type: Plain text
12726 #: build/C/man2/readv.2:209
12728 "The sum of the I<iov_len> values overflows an I<ssize_t> value. Or, the "
12729 "vector count I<iovcnt> is less than zero or greater than the permitted "
12732 "I<iov_len> の合計が I<ssize_t> の範囲をオーバーフローした。もしくは、 ベクタ"
12733 "数 I<iovcnt> が 0 より小さいか許可された最大値よりも大きかった。"
12735 #. type: Plain text
12736 #: build/C/man2/readv.2:214
12738 "B<preadv>() and B<pwritev>() first appeared in Linux 2.6.30; library "
12739 "support was added in glibc 2.10."
12741 "B<preadv>() と B<pwritev>() は Linux 2.6.30 で初めて登場した。\n"
12742 "ライブラリによるサポートは glibc 2.10 で追加された。"
12744 #. The readv/writev system calls were buggy before Linux 1.3.40.
12745 #. (Says release.libc.)
12746 #. type: Plain text
12747 #: build/C/man2/readv.2:222
12749 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
12750 "4.2BSD), POSIX.1-2001. Linux libc5 used I<size_t> as the type of the "
12751 "I<iovcnt> argument, and I<int> as the return type."
12753 "B<readv>(), B<writev>(): \n"
12754 "4.4BSD (これらのシステムコールは 4.2BSD で最初に現われた)、POSIX.1-2001。 \n"
12755 "Linux libc5 では、 I<iovcnt> 引き数の型として I<size_t> を、\n"
12756 "返り値の型として I<int> を使用していた。"
12758 #. type: Plain text
12759 #: build/C/man2/readv.2:226
12761 "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
12762 msgstr "B<preadv>(), B<pwritev>(): 非標準だが、最近の BSD にも存在する。"
12765 #: build/C/man2/readv.2:227
12767 msgid "Linux notes"
12768 msgstr "Linux での注意"
12770 #. type: Plain text
12771 #: build/C/man2/readv.2:258
12773 "POSIX.1-2001 allows an implementation to place a limit on the number of "
12774 "items that can be passed in I<iov>. An implementation can advertise its "
12775 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
12776 "return value from I<sysconf(_SC_IOV_MAX)>. On Linux, the limit advertised "
12777 "by these mechanisms is 1024, which is the true kernel limit. However, the "
12778 "glibc wrapper functions do some extra work if they detect that the "
12779 "underlying kernel system call failed because this limit was exceeded. In "
12780 "the case of B<readv>(). the wrapper function allocates a temporary buffer "
12781 "large enough for all of the items specified by I<iov>, passes that buffer in "
12782 "a call to B<read>(2), copies data from the buffer to the locations specified "
12783 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
12784 "buffer. The wrapper function for B<writev>() performs the analogous task "
12785 "using a temporary buffer and a call to B<write>(2)."
12787 "POSIX.1-2001 では、 I<iov> で渡すことができる要素数に上限を設ける実装が認めら"
12788 "れている。 実装は、 I<E<lt>limits.hE<gt>> の B<IOV_MAX> を定義することや、実"
12789 "行時に I<sysconf(_SC_IOV_MAX)> の返り値経由で、この上限を広告することができ"
12790 "る。 Linux では、この仕組みにより広告される上限は 1024 であり、 この値はカー"
12791 "ネルでの上限そのものである。 一方で、glibc のラッパー関数は、その関数の内部で"
12792 "呼ばれるカーネル システムコールがこの上限を超過して失敗したことを検出する"
12793 "と、 追加の動作をする。 B<readv>() の場合、ラッパー関数は I<iov> で指定され"
12794 "た全ての要素を格納できる大きさの一時バッファを割り当て、 B<read>(2) を呼び出"
12795 "す際にそのバッファを渡し、 そのバッファのデータを I<iov> の各要素の "
12796 "I<iov_base> フィールドが指定する場所にコピーしてから、 そのバッファを解放す"
12797 "る。 B<writev>() のラッパー関数も、同じように一時バッファを使って "
12798 "B<write>(2) を呼び出す。"
12800 #. type: Plain text
12801 #: build/C/man2/readv.2:265
12803 "It is not advisable to mix calls to B<readv>() or B<writev>(), which "
12804 "operate on file descriptors, with the functions from the stdio library; the "
12805 "results will be undefined and probably not what you want."
12807 "ファイルディスクリプタに対する操作を行う B<readv>() や B<writev>() と、\n"
12808 "標準入出力ライブラリの関数をごちゃまぜにして呼ぶのはお薦めしない。\n"
12809 "どんな結果になるかは定義されておらず、おそらく期待する結果は\n"
12812 #. type: Plain text
12813 #: build/C/man2/readv.2:268
12814 msgid "The following code sample demonstrates the use of B<writev>():"
12815 msgstr "以下のサンプルコードは B<writev>() の使用方法を示すものである。"
12817 #. type: Plain text
12818 #: build/C/man2/readv.2:275
12821 "char *str0 = \"hello \";\n"
12822 "char *str1 = \"world\\en\";\n"
12823 "struct iovec iov[2];\n"
12824 "ssize_t nwritten;\n"
12826 "char *str0 = \"hello \";\n"
12827 "char *str1 = \"world\\en\";\n"
12828 "struct iovec iov[2];\n"
12829 "ssize_t nwritten;\n"
12831 #. type: Plain text
12832 #: build/C/man2/readv.2:280
12835 "iov[0].iov_base = str0;\n"
12836 "iov[0].iov_len = strlen(str0);\n"
12837 "iov[1].iov_base = str1;\n"
12838 "iov[1].iov_len = strlen(str1);\n"
12840 "iov[0].iov_base = str0;\n"
12841 "iov[0].iov_len = strlen(str0);\n"
12842 "iov[1].iov_base = str1;\n"
12843 "iov[1].iov_len = strlen(str1);\n"
12845 #. type: Plain text
12846 #: build/C/man2/readv.2:282
12848 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
12849 msgstr "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
12851 #. type: Plain text
12852 #: build/C/man2/readv.2:288
12853 msgid "B<pread>(2), B<read>(2), B<write>(2)"
12854 msgstr "B<pread>(2), B<read>(2), B<write>(2)"
12857 #: build/C/man3/remove.3:31
12863 #: build/C/man3/remove.3:31
12866 msgstr "2014-03-10"
12868 #. type: Plain text
12869 #: build/C/man3/remove.3:34
12870 msgid "remove - remove a file or directory"
12871 msgstr "remove - ファイルやディレクトリを削除する"
12873 #. type: Plain text
12874 #: build/C/man3/remove.3:38
12875 msgid "B<int remove(const char *>I<pathname>B<);>"
12876 msgstr "B<int remove(const char *>I<pathname>B<);>"
12878 #. type: Plain text
12879 #: build/C/man3/remove.3:46
12881 "B<remove>() deletes a name from the filesystem. It calls B<unlink>(2) for "
12882 "files, and B<rmdir>(2) for directories."
12884 "B<remove>() はファイルシステムからファイル名を削除する。 ファイルに対しては "
12885 "B<unlink>(2) を、ディレクトリに対しては B<rmdir>(2) を呼び出す。"
12887 #. type: Plain text
12888 #: build/C/man3/remove.3:50
12890 "If the removed name was the last link to a file and no processes have the "
12891 "file open, the file is deleted and the space it was using is made available "
12894 "もしその名前が ファイルへの最後のリンクで、かつ、どのプロセスもそのファイル"
12895 "を 開いていないなら、ファイルも削除する。ファイルの占めていた 領域は他で使う"
12898 #. type: Plain text
12899 #: build/C/man3/remove.3:55
12901 "If the name was the last link to a file, but any processes still have the "
12902 "file open, the file will remain in existence until the last file descriptor "
12903 "referring to it is closed."
12905 "名前がファイルへの最後のリンクであっても、どこかのプロセスが そのファイルを開"
12906 "いているなら、ファイルの最後のファイル記述子 (file descriptor) が閉じられるま"
12909 #. type: Plain text
12910 #: build/C/man3/remove.3:57 build/C/man2/unlink.2:78
12911 msgid "If the name referred to a symbolic link, the link is removed."
12912 msgstr "名前が指しているのがシンボリックリンクなら、そのリンクを削除する。"
12914 #. type: Plain text
12915 #: build/C/man3/remove.3:60
12917 "If the name referred to a socket, FIFO, or device, the name is removed, but "
12918 "processes which have the object open may continue to use it."
12920 "名前が指しているのがソケット、FIFO、デバイスの場合、名前は削除されるが、 その"
12921 "ソケットなどを開いているプロセスはそのまま使い続けることができる。"
12923 #. type: Plain text
12924 #: build/C/man3/remove.3:70
12925 msgid "The errors that occur are those for B<unlink>(2) and B<rmdir>(2)."
12926 msgstr "発生するエラーは B<unlink>(2) および B<rmdir>(2) と同じものである。"
12928 #. type: Plain text
12929 #: build/C/man3/remove.3:75
12930 msgid "The B<remove>() function is thread-safe."
12931 msgstr "関数 B<remove>() はスレッドセーフである。"
12933 #. type: Plain text
12934 #: build/C/man3/remove.3:77
12935 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
12936 msgstr "C89, C99, 4.3BSD, POSIX.1-2001."
12938 #. type: Plain text
12939 #: build/C/man3/remove.3:83
12941 "Under libc4 and libc5, B<remove>() was an alias for B<unlink>(2) (and "
12942 "hence would not remove directories)."
12944 "libc4 と libc5 においては、 B<remove>() は B<unlink>(2) の別名であった "
12945 "(従ってディレクトリを削除できなかった)。"
12947 #. type: Plain text
12948 #: build/C/man3/remove.3:86 build/C/man2/unlink.2:284
12950 "Infelicities in the protocol underlying NFS can cause the unexpected "
12951 "disappearance of files which are still being used."
12953 "NFS プロトコルに内在する問題により、まだ使用中のファイルが想定外に消えてしま"
12956 #. type: Plain text
12957 #: build/C/man3/remove.3:97
12959 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
12960 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
12962 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
12963 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
12966 #: build/C/man2/rename.2:33
12971 #. type: Plain text
12972 #: build/C/man2/rename.2:36
12973 msgid "rename, renameat, renameat2 - change the name or location of a file"
12974 msgstr "rename, renameat, renameat2 - ファイルの名前や位置を変更する"
12976 #. type: Plain text
12977 #: build/C/man2/rename.2:41
12979 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>\n"
12980 msgstr "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>\n"
12982 #. type: Plain text
12983 #: build/C/man2/rename.2:44
12986 "B<#include E<lt>fcntl.hE<gt> >/* Definition of AT_* constants */\n"
12987 "B<#include E<lt>stdio.hE<gt>>\n"
12989 "B<#include E<lt>fcntl.hE<gt> >/* AT_* 定数の定義 */\n"
12990 "B<#include E<lt>stdio.hE<gt>>\n"
12992 #. type: Plain text
12993 #: build/C/man2/rename.2:47
12996 "B<int renameat(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
12997 "B< int >I<newdirfd>B<, const char *>I<newpath>B<);>\n"
12999 "B<int renameat(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
13000 "B< int >I<newdirfd>B<, const char *>I<newpath>B<);>\n"
13002 #. type: Plain text
13003 #: build/C/man2/rename.2:51
13006 "B<int renameat2(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
13007 "B< int >I<newdirfd>B<, const char *>I<newpath>B<, unsigned int >I<flags>B<);>\n"
13009 "B<int renameat2(int >I<olddirfd>B<, const char *>I<oldpath>B<,>\n"
13010 "B< int >I<newdirfd>B<, const char *>I<newpath>B<, unsigned int >I<flags>B<);>\n"
13012 #. type: Plain text
13013 #: build/C/man2/rename.2:59
13014 msgid "B<renameat>():"
13015 msgstr "B<renameat>():"
13017 #. type: Plain text
13018 #: build/C/man2/rename.2:81
13020 "B<rename>() renames a file, moving it between directories if required. Any "
13021 "other hard links to the file (as created using B<link>(2)) are unaffected. "
13022 "Open file descriptors for I<oldpath> are also unaffected."
13024 "B<rename>() はファイルの名前を変更し、必要ならばディレクトリ間の移動を行な"
13025 "う。 そのファイルに対する (B<link>(2) を使用して作られた) 他のハードリンク "
13026 "(hard link) には影響はない。 オープン済の I<oldpath> に対するファイルディスク"
13029 #. type: Plain text
13030 #: build/C/man2/rename.2:89
13032 "If I<newpath> already exists, it will be atomically replaced (subject to a "
13033 "few conditions; see ERRORS below), so that there is no point at which "
13034 "another process attempting to access I<newpath> will find it missing."
13036 "I<newpath> が既に存在する場合、それは不可分操作で (atomically) 置き換えられ"
13037 "る (ただし、いくつかの条件がある; 以下の「エラー」のセクションを参照)。 その"
13038 "ため、 I<newpath> にアクセスしようとしている他のプロセスがファイルを見失うこ"
13039 "とはない (訳註: 常にアクセス可能である)。"
13041 #. type: Plain text
13042 #: build/C/man2/rename.2:97
13044 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
13045 "file, then B<rename>() does nothing, and returns a success status."
13047 "I<oldpath> と I<newpath> がどちらも既存のハードリンクで、同じファイルを参照し"
13048 "ている場合、 B<rename>() は何も行わず、ステータスとして成功を返す。"
13050 #. type: Plain text
13051 #: build/C/man2/rename.2:105
13053 "If I<newpath> exists but the operation fails for some reason, B<rename>() "
13054 "guarantees to leave an instance of I<newpath> in place."
13056 "I<newpath> が存在し、何らかの理由で操作が失敗した場合、 B<rename>() は "
13057 "I<newpath> の実体を元のまま残すことを保証する。"
13059 #. type: Plain text
13060 #: build/C/man2/rename.2:111
13062 "I<oldpath> can specify a directory. In this case, I<newpath> must either "
13063 "not exist, or it must specify an empty directory."
13065 "I<oldpath> にはディレクトリを指定することもできる。 この場合、 I<newpath> は"
13066 "存在しないか、空のディレクトリでなければならない。"
13068 #. type: Plain text
13069 #: build/C/man2/rename.2:118
13071 "However, when overwriting there will probably be a window in which both "
13072 "I<oldpath> and I<newpath> refer to the file being renamed."
13074 "一方で、上書きを行なう場合は、rename が行なわれるファイルを I<oldpath> と "
13075 "I<newpath> の両方で参照できる瞬間がおそらく存在する。"
13077 #. type: Plain text
13078 #: build/C/man2/rename.2:124
13080 "If I<oldpath> refers to a symbolic link, the link is renamed; if I<newpath> "
13081 "refers to a symbolic link, the link will be overwritten."
13083 "I<oldpath> がシンボリックリンク (symbolic link) を参照している場合は、 リンク"
13084 "の名前が変更される。 また、 I<newpath> がシンボリックリンクを参照している場合"
13088 #: build/C/man2/rename.2:124
13090 msgid "renameat ()"
13091 msgstr "renameat ()"
13093 #. type: Plain text
13094 #: build/C/man2/rename.2:130
13096 "The B<renameat>() system call operates in exactly the same way as "
13097 "B<rename>(), except for the differences described here."
13099 "B<renameat>() システムコールは B<rename>() と全く同様に動作するが、以下で説明"
13102 #. type: Plain text
13103 #: build/C/man2/rename.2:140
13105 "If the pathname given in I<oldpath> is relative, then it is interpreted "
13106 "relative to the directory referred to by the file descriptor I<olddirfd> "
13107 "(rather than relative to the current working directory of the calling "
13108 "process, as is done by B<rename>() for a relative pathname)."
13110 "I<oldpath> で指定されたパス名が相対パスの場合、このパス名はファイルディスクリ"
13111 "プター I<olddirfd> が参照するディレクトリに対する相対パスと解釈される "
13112 "(B<rename>(2) に相対パス名を渡した場合のように、呼び出したプロセスのカレント"
13113 "ワーキングディレクトリに対する相対パスではない)。"
13115 #. type: Plain text
13116 #: build/C/man2/rename.2:152
13118 "If I<oldpath> is relative and I<olddirfd> is the special value B<AT_FDCWD>, "
13119 "then I<oldpath> is interpreted relative to the current working directory of "
13120 "the calling process (like B<rename>())."
13122 "I<oldpath> で指定されたパス名が相対パスで、 I<olddirfd> が特別な値 "
13123 "B<AT_FDCWD> の場合、 (B<rename>(2) と同様に) I<oldpath> は呼び出したプロセス"
13124 "のカレントワーキングディレクトリに対する相対パスと解釈される。"
13126 #. type: Plain text
13127 #: build/C/man2/rename.2:171
13128 msgid "See B<openat>(2) for an explanation of the need for B<renameat>()."
13129 msgstr "B<renameat>() の必要性についての説明については B<openat>(2) を参照。"
13132 #: build/C/man2/rename.2:171
13134 msgid "renameat2()"
13135 msgstr "renameat2()"
13137 #. type: Plain text
13138 #: build/C/man2/rename.2:182
13140 "B<renameat2>() has an additional I<flags> argument. A B<renameat2>() call "
13141 "with a zero I<flags> argument is equivalent to B<renameat>()."
13144 #. type: Plain text
13145 #: build/C/man2/rename.2:186
13147 #| msgid "The character % is followed by zero or more of the following flags:"
13149 "The I<flags> argument is a bit mask consisting of zero or more of the "
13151 msgstr "% 文字の後ろには 0 個以上のフラグ文字が続く。"
13154 #: build/C/man2/rename.2:186
13156 msgid "B<RENAME_NOREPLACE>"
13159 #. type: Plain text
13160 #: build/C/man2/rename.2:194
13162 "Don't overwrite I<newpath>. of the rename. Return an error if I<newpath> "
13167 #: build/C/man2/rename.2:194
13169 msgid "B<RENAME_EXCHANGE>"
13170 msgstr "B<RENAME_EXCHANGE>"
13172 #. type: Plain text
13173 #: build/C/man2/rename.2:203
13175 "Atomically exchange I<oldpath> and I<newpath>. Both pathnames must exist "
13176 "but may be of different types (e.g., one could be a non-empty directory and "
13177 "the other a symbolic link)."
13180 #. type: Plain text
13181 #: build/C/man2/rename.2:228
13183 "Write permission is denied for the directory containing I<oldpath> or "
13184 "I<newpath>, or, search permission is denied for one of the directories in "
13185 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
13186 "and does not allow write permission (needed to update the I<..> entry). "
13187 "(See also B<path_resolution>(7).)"
13189 "I<oldpath> または I<newpath> を含んでいるディレクトリの書き込み許可がない。 "
13190 "または、 I<oldpath> または I<newpath> のディレクトリ部分のどれかに検索許可が"
13191 "ない。 または、 I<oldpath> がディレクトリで (I<..> エントリを更新するのに必要"
13192 "な) 書き込み許可がない (B<path_resolution>(7) も参照)。"
13195 #: build/C/man2/rename.2:228 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:169
13200 #. type: Plain text
13201 #: build/C/man2/rename.2:245
13203 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
13204 "use by some process (perhaps as current working directory, or as root "
13205 "directory, or because it was open for reading) or is in use by the system "
13206 "(for example as mount point), while the system considers this an error. "
13207 "(Note that there is no requirement to return B<EBUSY> in such cases"
13208 "\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
13209 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
13212 "I<oldpath> または I<newpath> がディレクトリで、何らかのプロセスが使用中 (多"
13213 "分、カレントワーキングディレクトリか、ルートディレクトリか、 読み込みのために"
13214 "オープンされているかでろう) もしくは、システムが使用中 (例えばマウントポイン"
13215 "トである) であり、システムがこれをエラーであると判断したために rename が失敗"
13216 "した。 (このような場合に B<EBUSY> を返すことは規格では要求されていない点に注"
13217 "意すること。 このような場合に、rename をとにかく実行してみるのは何の問題もな"
13218 "い。 ただし、そのような状況で、システムが他に返すエラーがない場合には "
13219 "B<EBUSY> を返すことが許されている。)"
13221 #. type: Plain text
13222 #: build/C/man2/rename.2:255
13224 "The new pathname contained a path prefix of the old, or, more generally, an "
13225 "attempt was made to make a directory a subdirectory of itself."
13227 "I<newpath> が I<oldpath> のパス部分を含んでいる。ディレクトリを自分自身のサブ"
13228 "ディレクトリに 変更しようとした場合がほとんどである。"
13230 #. type: Plain text
13231 #: build/C/man2/rename.2:261
13232 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
13234 "I<newpath> は存在しているディレクトリであるが、 I<oldpath> はディレクトリでな"
13237 #. type: Plain text
13238 #: build/C/man2/rename.2:272
13240 "I<oldpath> already has the maximum number of links to it, or it was a "
13241 "directory and the directory containing I<newpath> has the maximum number of "
13244 "I<oldpath> は既に最大数までのリンクを持っているか、それがディレクトリで "
13245 "I<newpath> を含んでいるディレクトリが最大数までのリンクを持っている。"
13247 #. type: Plain text
13248 #: build/C/man2/rename.2:288
13250 "The link named by I<oldpath> does not exist; or, a directory component in "
13251 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
13253 "I<oldpath> という名前のリンクが存在しない。 または、 I<newpath> というディレ"
13254 "クトリが存在しない。 または、 I<oldpath> か I<newpath> が空の文字列である。"
13256 #. type: Plain text
13257 #: build/C/man2/rename.2:305
13259 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
13260 "a directory. Or, I<oldpath> is a directory, and I<newpath> exists but is "
13263 "I<oldpath> か I<newpath> に含まれているディレクトリ部分が 実際にはディレクト"
13264 "リでない。 または I<oldpath> がディレクトリで、 I<newpath> が存在してディレク"
13268 #: build/C/man2/rename.2:305
13270 msgid "B<ENOTEMPTY> or B<EEXIST>"
13271 msgstr "B<ENOTEMPTY または EEXIST>"
13273 #. type: Plain text
13274 #: build/C/man2/rename.2:309
13276 "I<newpath> is a nonempty directory, that is, contains entries other than \"."
13279 "I<newpath> が空でないディレクトリである。すなわち \".\" と \"..\" 以外を含ん"
13283 #: build/C/man2/rename.2:309 build/C/man2/unlink.2:224
13285 msgid "B<EPERM> or B<EACCES>"
13286 msgstr "B<EPERM> または B<EACCES>"
13288 #. type: Plain text
13289 #: build/C/man2/rename.2:333
13291 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>) set and "
13292 "the process's effective user ID is neither the user ID of the file to be "
13293 "deleted nor that of the directory containing it, and the process is not "
13294 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
13295 "I<newpath> is an existing file and the directory containing it has the "
13296 "sticky bit set and the process's effective user ID is neither the user ID of "
13297 "the file to be replaced nor that of the directory containing it, and the "
13298 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
13299 "capability); or the filesystem containing I<pathname> does not support "
13300 "renaming of the type requested."
13302 "I<oldpath> のあるディレクトリにスティッキービット (sticky bit) "
13303 "(B<S_ISVTX>) が設定されており、 プロセスの実効ユーザー ID が 削除しようとす"
13304 "るファイルのユーザー ID と そのファイルを含むディレクトリのユーザー ID のいず"
13305 "れとも一致せず、かつ プロセスに特権がない (Linux では B<CAP_FOWNER> ケーパビ"
13306 "リティ (capability) がない)。 または、 I<newpath> がすでに存在するファイル"
13307 "で、親ディレクトリにスティッキービットが設定されており、 プロセスの実効ユー"
13308 "ザー ID が 置き換えようとするファイルのユーザー ID と そのファイルを含むディ"
13309 "レクトリのユーザー ID のいずれとも一致せず、かつ プロセスに特権がない (Linux "
13310 "では B<CAP_FOWNER> ケーパビリティがない)。 または I<oldpath> と I<newpath> が"
13311 "存在するファイルシステムが、要求された種類の名前の変更を サポートしていない。"
13313 #. type: Plain text
13314 #: build/C/man2/rename.2:344
13316 "I<oldpath> and I<newpath> are not on the same mounted filesystem. (Linux "
13317 "permits a filesystem to be mounted at multiple points, but B<rename>() does "
13318 "not work across different mount points, even if the same filesystem is "
13319 "mounted on both.)"
13321 "I<oldpath> と I<newpath> が同じマウントされたファイルシステムに存在しない。 "
13322 "(Linux は 1 つのファイルシステムを複数のマウント位置に マウントすることを許可"
13323 "している。 しかし B<rename>() は、たとえ同じファイルシステムであっても、 "
13324 "別々のマウント位置を跨いでは動作しない。)"
13326 #. type: Plain text
13327 #: build/C/man2/rename.2:349
13329 "The following additional errors can occur for B<renameat>() and "
13331 msgstr "B<renameat>() と B<renameat2>() では以下のエラーも発生する。"
13333 #. type: Plain text
13334 #: build/C/man2/rename.2:368
13335 msgid "The following additional errors can occur for B<renameat2>():"
13336 msgstr "B<renameat2>() では以下のエラーも発生する。"
13338 #. type: Plain text
13339 #: build/C/man2/rename.2:376
13340 msgid "I<flags> contains B<RENAME_NOREPLACE> and I<newpath> already exists."
13343 #. type: Plain text
13344 #: build/C/man2/rename.2:385
13346 "An invalid flag was specified in I<flags>, or both B<RENAME_NOREPLACE> and "
13347 "B<RENAME_EXCHANGE> were specified."
13350 #. type: Plain text
13351 #: build/C/man2/rename.2:389
13353 #| msgid "The filesystem does not allow unlinking of files."
13354 msgid "The filesystem does not support one of the flags in I<flags>."
13355 msgstr "ファイルシステムがファイルに対する unlink 操作を許していない。"
13357 #. type: Plain text
13358 #: build/C/man2/rename.2:397
13359 msgid "I<flags> contains B<RENAME_EXCHANGE> and I<newpath> does not exist."
13362 #. type: Plain text
13363 #: build/C/man2/rename.2:401
13365 "B<renameat>() was added to Linux in kernel 2.6.16; library support was "
13366 "added to glibc in version 2.4."
13368 "B<renameat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサ"
13369 "ポートはバージョン 2.4 で glibc に追加された。"
13371 #. FIXME glibc support is pending.
13372 #. type: Plain text
13373 #: build/C/man2/rename.2:405
13374 msgid "B<renameat2>() was added to Linux in kernel 3.15."
13375 msgstr "B<renameat2>() はカーネル 2.6.16 で Linux に追加された。"
13377 #. type: Plain text
13378 #: build/C/man2/rename.2:408
13379 msgid "B<rename>(): 4.3BSD, C89, C99, POSIX.1-2001, POSIX.1-2008."
13380 msgstr "B<rename>(): 4.3BSD, C89, C99, POSIX.1-2001, POSIX.1-2008."
13382 #. type: Plain text
13383 #: build/C/man2/rename.2:411
13384 msgid "B<renameat>(): POSIX.1-2008."
13385 msgstr "B<renameat>(): POSIX.1-2008."
13387 #. type: Plain text
13388 #: build/C/man2/rename.2:414
13389 msgid "B<renameat2()> is Linux-specific."
13390 msgstr "B<renameat2>() は Linux 固有である。"
13392 #. type: Plain text
13393 #: build/C/man2/rename.2:425
13395 "On NFS filesystems, you can not assume that if the operation failed, the "
13396 "file was not renamed. If the server does the rename operation and then "
13397 "crashes, the retransmitted RPC which will be processed when the server is up "
13398 "again causes a failure. The application is expected to deal with this. See "
13399 "B<link>(2) for a similar problem."
13401 "NFS ファイルシステムでは、操作が失敗したからといって、 ファイルの名前が変更で"
13402 "きなかったと決めてかかることはできない。 サーバが rename 操作を終えてからク"
13403 "ラッシュした場合、 サーバが再び立ち上がったときに、 再送信された RPC が処理さ"
13404 "れるが、これは失敗となる。 アプリケーションはこの問題を正しく取り扱うことが期"
13405 "待されている。 同様の問題について B<link>(2) にも書かれている。"
13407 #. type: Plain text
13408 #: build/C/man2/rename.2:433
13410 "B<mv>(1), B<chmod>(2), B<link>(2), B<symlink>(2), B<unlink>(2), "
13411 "B<path_resolution>(7), B<symlink>(7)"
13413 "B<mv>(1), B<chmod>(2), B<link>(2), B<symlink>(2), B<unlink>(2), "
13414 "B<path_resolution>(7), B<symlink>(7)"
13417 #: build/C/man2/rmdir.2:30
13423 #: build/C/man2/rmdir.2:30
13426 msgstr "2008-05-08"
13428 #. type: Plain text
13429 #: build/C/man2/rmdir.2:33
13430 msgid "rmdir - delete a directory"
13431 msgstr "rmdir - ディレクトリを削除する"
13433 #. type: Plain text
13434 #: build/C/man2/rmdir.2:37
13435 msgid "B<int rmdir(const char *>I<pathname>B<);>"
13436 msgstr "B<int rmdir(const char *>I<pathname>B<);>"
13438 #. type: Plain text
13439 #: build/C/man2/rmdir.2:40
13440 msgid "B<rmdir>() deletes a directory, which must be empty."
13442 "B<rmdir>() はディレクトリを削除する。削除するディレクトリは空でなければなら"
13445 #. type: Plain text
13446 #: build/C/man2/rmdir.2:55
13448 "Write access to the directory containing I<pathname> was not allowed, or one "
13449 "of the directories in the path prefix of I<pathname> did not allow search "
13450 "permission. (See also B<path_resolution>(7)."
13452 "I<pathname> を含んでいるディレクトリへの書き込みアクセスが プロセスの実効 "
13453 "(effective) UID に対して許可されていないか、 I<pathname> に含まれているディレ"
13454 "クトリのどれかに検索 (実行) 許可がないか、 I<pathname> に至るまでのディレクト"
13455 "リのいずれかに対する検索許可がなかった。 (B<path_resolution>(7) も参照のこ"
13458 #. type: Plain text
13459 #: build/C/man2/rmdir.2:64
13461 "I<pathname> is currently in use by the system or some process that prevents "
13462 "its removal. On Linux this means I<pathname> is currently used as a mount "
13463 "point or is the root directory of the calling process."
13465 "I<pathname> がシステムや別のプロセスにより使用中で削除することができない。 "
13466 "Linux では、 I<pathname> がマウントポイントとして使用されているか、 呼び出し"
13467 "たプロセスのルートディレクトリであることを意味する。"
13469 #. type: Plain text
13470 #: build/C/man2/rmdir.2:73
13471 msgid "I<pathname> has I<.> as last component."
13472 msgstr "I<pathname> の最後のディレクトリ部分が I<.> である。"
13474 #. type: Plain text
13475 #: build/C/man2/rmdir.2:85
13477 "A directory component in I<pathname> does not exist or is a dangling "
13480 "I<pathname> の中のディレクトリ部分が存在しないか、壊れた (dangling) シンボ"
13481 "リックリンク (symbolic link) である。"
13483 #. type: Plain text
13484 #: build/C/man2/rmdir.2:94
13486 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
13487 "fact, a directory."
13489 "I<pathname> か I<pathname> に含まれているディレクトリ部分が、実際には、ディレ"
13493 #: build/C/man2/rmdir.2:94
13495 msgid "B<ENOTEMPTY>"
13496 msgstr "B<ENOTEMPTY>"
13498 #. type: Plain text
13499 #: build/C/man2/rmdir.2:107
13501 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
13502 "I<..> as its final component. POSIX.1-2001 also allows B<EEXIST> for this "
13505 "ディレクトリ I<pathname> に I<.> と I<..> 以外のエントリがある。または、 "
13506 "I<pathname> を構成する最後の要素が I<..> である。 POSIX.1-2001 は、この状況"
13507 "で B<EEXIST> を返すことを認めている。"
13509 #. type: Plain text
13510 #: build/C/man2/rmdir.2:118
13512 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>) set "
13513 "and the process's effective user ID is neither the user ID of the file to be "
13514 "deleted nor that of the directory containing it, and the process is not "
13515 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
13517 "I<pathname> を含んでいるディレクトリにスティッキービット(sticky-bit) "
13518 "(B<S_ISVTX>) が設定されていて、プロセスの実効ユーザーID が削除しようとする"
13519 "ファイルの ユーザID とそのファイルを含むディレクトリのユーザーID のどちらとも"
13520 "異なり、 プロセスも権限 (Linux では B<CAP_FOWNER> ケーパビリティ) がない。"
13522 #. type: Plain text
13523 #: build/C/man2/rmdir.2:123
13525 "The filesystem containing I<pathname> does not support the removal of "
13528 "I<pathname> を含んでいるファイルシステムがディレクトリの 削除をサポートしてい"
13531 #. type: Plain text
13532 #: build/C/man2/rmdir.2:127
13533 msgid "I<pathname> refers to a directory on a read-only filesystem."
13535 "I<pathname> が読み込み専用のファイルシステム上のディレクトリを参照している。"
13537 #. type: Plain text
13538 #: build/C/man2/rmdir.2:132
13540 "Infelicities in the protocol underlying NFS can cause the unexpected "
13541 "disappearance of directories which are still being used."
13543 "NFS プロトコルに潜在している欠陥によって、まだ使用中のディレクトリが 突然消滅"
13544 "する現象が引き起こされることがある。"
13546 #. type: Plain text
13547 #: build/C/man2/rmdir.2:141
13549 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
13550 "B<unlink>(2), B<unlinkat>(2)"
13552 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
13553 "B<unlink>(2), B<unlinkat>(2)"
13556 #: build/C/man3/scanf.3:52
13561 #. type: Plain text
13562 #: build/C/man3/scanf.3:55
13564 "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
13565 msgstr "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - 書式付き入力変換"
13567 #. type: Plain text
13568 #: build/C/man3/scanf.3:62
13571 "B<int scanf(const char *>I<format>B<, ...);>\n"
13572 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
13573 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
13575 "B<int scanf(const char *>I<format>B<, ...);>\n"
13576 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
13577 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
13579 #. type: Plain text
13580 #: build/C/man3/scanf.3:64
13582 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
13583 msgstr "B<#include E<lt>stdarg.hE<gt>>\n"
13585 #. type: Plain text
13586 #: build/C/man3/scanf.3:68
13589 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
13590 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list >I<ap>B<);>\n"
13591 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list >I<ap>B<);>\n"
13593 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
13594 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list >I<ap>B<);>\n"
13595 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list >I<ap>B<);>\n"
13597 #. type: Plain text
13598 #: build/C/man3/scanf.3:79
13599 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
13600 msgstr "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
13602 #. type: Plain text
13603 #: build/C/man3/scanf.3:82
13605 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
13608 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
13611 #. type: Plain text
13612 #: build/C/man3/scanf.3:104
13614 "The B<scanf>() family of functions scans input according to I<format> as "
13615 "described below. This format may contain I<conversion specifications>; the "
13616 "results from such conversions, if any, are stored in the locations pointed "
13617 "to by the I<pointer> arguments that follow I<format>. Each I<pointer> "
13618 "argument must be of a type that is appropriate for the value returned by the "
13619 "corresponding conversion specification."
13621 "B<scanf>() 関数グループは、以下に述べるように、 I<format> に従って入力を読み"
13622 "込むものである。 この書式には I<「変換指定」 (conversion specifications)> を"
13623 "含めることができ、変換指定があれば、その変換の結果は I<format> に続く "
13624 "I<pointer> 引き数が指す場所に格納される。 それぞれの I<pointer> 引き数の型"
13625 "は、対応する変換指定が返す値に 適合していなければならない。"
13627 #. type: Plain text
13628 #: build/C/man3/scanf.3:115
13630 "If the number of conversion specifications in I<format> exceeds the number "
13631 "of I<pointer> arguments, the results are undefined. If the number of "
13632 "I<pointer> arguments exceeds the number of conversion specifications, then "
13633 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
13635 "I<format> 中の変換指定の個数が I<pointer> 引き数の数より多かった場合の結果は"
13636 "未定義である。 I<pointer> 引き数の数が変換指定の個数よりも多かった場合、 余分"
13637 "な I<pointer> 引き数の評価は行われるが、それ以外は行われず無視される。"
13639 #. type: Plain text
13640 #: build/C/man3/scanf.3:127
13642 "The B<scanf>() function reads input from the standard input stream "
13643 "I<stdin>, B<fscanf>() reads input from the stream pointer I<stream>, and "
13644 "B<sscanf>() reads its input from the character string pointed to by I<str>."
13646 "B<scanf>() 関数は標準入力ストリーム I<stdin> からの入力を読み込む。 "
13647 "B<fscanf>() はストリームポインタ I<stream> からの入力を読み込む。 "
13648 "B<sscanf>() は文字列ポインタ I<str> で示された文字列からの入力を読み込む。"
13650 #. type: Plain text
13651 #: build/C/man3/scanf.3:145
13653 "The B<vfscanf>() function is analogous to B<vfprintf>(3) and reads input "
13654 "from the stream pointer I<stream> using a variable argument list of pointers "
13655 "(see B<stdarg>(3). The B<vscanf>() function scans a variable argument list "
13656 "from the standard input and the B<vsscanf>() function scans it from a "
13657 "string; these are analogous to the B<vprintf>(3) and B<vsprintf>(3) "
13658 "functions respectively."
13660 "B<vfscanf>() 関数は B<vfprintf>(3) と同様に、ストリームポインタ I<stream> "
13661 "からの入力をポインタの可変長引き数リストを用いて読み込む (B<stdarg>(3) を参"
13662 "照)。 B<vscanf>() 関数は、可変長引き数のリストに基づき標準入力からの読み取り"
13663 "を行う。 B<vsscanf>() 関数はそのリストに基づき文字列から読み取る。 これらの"
13664 "関係は B<vprintf>(3) と B<vsprintf>(3) 関数の関係と同様である。"
13666 #. type: Plain text
13667 #: build/C/man3/scanf.3:159
13669 "The I<format> string consists of a sequence of I<directives> which describe "
13670 "how to process the sequence of input characters. If processing of a "
13671 "directive fails, no further input is read, and B<scanf>() returns. A "
13672 "\"failure\" can be either of the following: I<input failure>, meaning that "
13673 "input characters were unavailable, or I<matching failure>, meaning that the "
13674 "input was inappropriate (see below)."
13676 "I<format> 文字列は I<「命令」 (directive)> の列で構成される。命令は入力文字の"
13677 "系列をどのように処理するかを指示する ものである。ある命令の処理が失敗すると、"
13678 "入力はそれ以上読み込まれず、 B<scanf>() は返る。「失敗」は I<「入力の失敗」 "
13679 "(input failure)> と I<「一致の失敗」 (matching failure)> のいずれかである。 "
13680 "入力の失敗は入力文字が使用できなかったことを意味し、 一致の失敗は入力が不適切"
13681 "であったこと (下記参照) を意味する。"
13683 #. type: Plain text
13684 #: build/C/man3/scanf.3:161
13685 msgid "A directive is one of the following:"
13686 msgstr "命令は以下のいずれかである:"
13689 #: build/C/man3/scanf.3:161 build/C/man3/scanf.3:167 build/C/man3/scanf.3:171
13690 #: build/C/man3/scanf.3:190 build/C/man3/scanf.3:201 build/C/man3/scanf.3:220
13691 #: build/C/man3/scanf.3:232 build/C/man3/scanf.3:246
13696 #. type: Plain text
13697 #: build/C/man3/scanf.3:167
13699 "A sequence of white-space characters (space, tab, newline, etc.; see "
13700 "B<isspace>(3)). This directive matches any amount of white space, including "
13701 "none, in the input."
13703 "ホワイトスペース (スペース、タブ、改行など; B<isspace>(3) 参照) の列。 この"
13704 "命令は、入力中の任意の個数のホワイトスペースに一致する。 (「何もなし」にも一"
13707 #. type: Plain text
13708 #: build/C/man3/scanf.3:171
13710 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq). "
13711 "This character must exactly match the next character of input."
13713 "通常文字 (つまり、ホワイトスペースと \\(aq%\\(aq 以外の文字)。 この文字は入力"
13714 "の次の文字に正確に一致しなければならない。"
13716 #. type: Plain text
13717 #: build/C/man3/scanf.3:182
13719 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
13720 "character. A sequence of characters from the input is converted according "
13721 "to this specification, and the result is placed in the corresponding "
13722 "I<pointer> argument. If the next item of input does not match the "
13723 "conversion specification, the conversion fails\\(emthis is a I<matching "
13726 "変換指定。変換指定は \\(aq%\\(aq (パーセント) 文字で始まる。 入力された文字の"
13727 "系列はこの指定にもとづいて変換され、 変換結果は対応する I<pointer> 引き数が指"
13728 "す場所に格納される。 入力の次の文字が変換指定と一致しない場合は、変換は失敗す"
13729 "る \\(emこれが I<「一致の失敗」 (matching failure)> である。"
13731 #. type: Plain text
13732 #: build/C/man3/scanf.3:190
13734 "Each I<conversion specification> in I<format> begins with either the "
13735 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
13736 "for the distinction) followed by:"
13738 "I<format> 中の各々の I<「変換指定」> は文字 \\(aq%\\(aq か文字系列 \"B<"
13739 "%>I<n>B<$>\" (違いについては後述) で始まり、以下の要素が続く。"
13741 #. type: Plain text
13742 #: build/C/man3/scanf.3:201
13744 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>() reads "
13745 "input as directed by the conversion specification, but discards the input. "
13746 "No corresponding I<pointer> argument is required, and this specification is "
13747 "not included in the count of successful assignments returned by B<scanf>()."
13749 "代入抑制文字 \\(aq*\\(aq (省略可能)。 B<scanf>() は変換指定に指示された通り"
13750 "入力を読み込むが、その入力は捨てられる。 対応する I<pointer> 引き数は必要な"
13751 "く、 B<scanf>() が返す代入が成功した数にこの指定は含まれない。"
13753 #. type: Plain text
13754 #: build/C/man3/scanf.3:220
13756 "An optional \\(aqm\\(aq character. This is used with string conversions (I<"
13757 "%s>, I<%c>, I<%[>), and relieves the caller of the need to allocate a "
13758 "corresponding buffer to hold the input: instead, B<scanf>() allocates a "
13759 "buffer of sufficient size, and assigns the address of this buffer to the "
13760 "corresponding I<pointer> argument, which should be a pointer to a I<char\\ "
13761 "*> variable (this variable does not need to be initialized before the "
13762 "call). The caller should subsequently B<free>(3) this buffer when it is no "
13765 "文字 \\(aqm\\(aq (省略可能)。これは文字列変換 (I<%s>, I<%c>, I<%[>) とともに"
13766 "使用され、これを使うと 呼び出し元が入力を保持する対応するバッファを確保する必"
13767 "要がなくなる。 代わりに B<scanf>() が必要な大きさのバッファを確保し、この"
13768 "バッファのアドレスを 対応する I<pointer> 引き数に代入する。 I<pointer> 引き数"
13769 "は I<char\\ *> 型の変数へのポインタでなければならない (変数自体は呼び出し前に"
13770 "初期化されている必要はない)。 呼び出し元は、不要になった時点で、このバッファ"
13771 "を B<free>(3) すべきである。"
13773 #. type: Plain text
13774 #: build/C/man3/scanf.3:232
13776 "An optional decimal integer which specifies the I<maximum field width>. "
13777 "Reading of characters stops either when this maximum is reached or when a "
13778 "nonmatching character is found, whichever happens first. Most conversions "
13779 "discard initial white space characters (the exceptions are noted below), and "
13780 "these discarded characters don't count toward the maximum field width. "
13781 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq) to "
13782 "mark the end of the input; the maximum field width does not include this "
13785 "I<「最大フィールド幅」> を指定する 10進数 (省略可能)。 この最大値に達するか、"
13786 "一致しない文字が見つかるか、のどちらかに なると、文字の読み込みを停止する。 "
13787 "ほとんどの変換では、先頭のホワイトスペース文字は捨てられ (例外については後述"
13788 "する)、 捨てられたこれらの文字は最大フィールド幅の計算には含まれない。 文字列"
13789 "の入力変換では、入力の末尾を示す終端のヌルバイト (\\(aq\\e0\\(aq) も格納され"
13790 "るが、最大フィールド幅にはこの終端バイトは含まれない。"
13792 #. type: Plain text
13793 #: build/C/man3/scanf.3:246
13795 "An optional I<type modifier character>. For example, the B<l> type modifier "
13796 "is used with integer conversions such as B<%d> to specify that the "
13797 "corresponding I<pointer> argument refers to a I<long int> rather than a "
13798 "pointer to an I<int>."
13800 "I<「型修飾子」 (type modifier characters)> (省略可能)。 例えば、型修飾子 "
13801 "B<l> を B<%d> などの整数変換と一緒に使うと、対応する I<pointer> 引き数が "
13802 "I<int> ではなく I<long int> を参照していることを指定できる。"
13804 #. type: Plain text
13805 #: build/C/man3/scanf.3:251
13807 "A I<conversion specifier> that specifies the type of input conversion to be "
13809 msgstr "I<「変換指定」> : 実行すべき入力変換の種類を指定する。"
13811 #. type: Plain text
13812 #: build/C/man3/scanf.3:280
13814 "The conversion specifications in I<format> are of two forms, either "
13815 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\". The two "
13816 "forms should not be mixed in the same I<format> string, except that a string "
13817 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>. If "
13818 "I<format> contains \\(aq%\\(aq specifications, then these correspond in "
13819 "order with successive I<pointer> arguments. In the \"B<%>I<n>B<$>\" form "
13820 "(which is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer "
13821 "that specifies that the converted input should be placed in the location "
13822 "referred to by the I<n>-th I<pointer> argument following I<format>."
13824 "I<format> 中の変換指定は、\\(aq%\\(aq で始まるか、 \"B<%>I<n>B<$>\" で始まる"
13825 "かの、いずれかの形式である。 これら 2つの形式を同じ I<format> 文字列に混ぜる"
13826 "ことはできない。但し、\"B<%>I<n>B<$>\" を 含む文字列に B<%%> と B<%*> を含め"
13827 "ることはできる。 I<format> に \\(aq%\\(aq 指定が含まれている場合、各々の "
13828 "\\(aq%\\(aq 指定と 後続の I<pointer> 引き数はその順番通りに対応する。 \"B<"
13829 "%>I<n>B<$>\" 形式 (POSIX.1-2001 では規定されているが、C99 にはない) では、 "
13830 "I<n> は 10進数であり、変換後の入力を I<format> の後ろの I<n> 番目の "
13831 "I<pointer> 引き数が参照する場所に格納することを指定する。"
13834 #: build/C/man3/scanf.3:280
13836 msgid "Conversions"
13839 #. type: Plain text
13840 #: build/C/man3/scanf.3:284
13842 "The following I<type modifier characters> can appear in a conversion "
13844 msgstr "変換指定には、以下の I<「型修飾子」> を入れることができる。"
13846 #. type: Plain text
13847 #: build/C/man3/scanf.3:294
13849 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
13850 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
13851 "I<unsigned short int> (rather than I<int>)."
13853 "変換が B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, B<n> のいずれかであり、次のポイン"
13854 "タが (I<int> ではなく) I<short int> か I<unsigned short int> へのポインタで"
13857 #. type: Plain text
13858 #: build/C/man3/scanf.3:302
13860 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
13861 "I<unsigned char>."
13863 "B<h> と同じだが、次のポインタが I<signed char> か I<unsigned char> へのポイン"
13866 #. type: Plain text
13867 #: build/C/man3/scanf.3:311
13869 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
13870 "I<uintmax_t>. This modifier was introduced in C99."
13872 "B<h> と同じだが、次のポインタが I<intmax_t> か I<uintmax_t> へのポインタであ"
13873 "ることを示す。 この修飾子は C99 で導入された。"
13875 #. This use of l was introduced in Amendment 1 to ISO C90.
13876 #. type: Plain text
13877 #: build/C/man3/scanf.3:338
13879 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
13880 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
13881 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
13882 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
13883 "(rather than I<float>). Specifying two B<l> characters is equivalent to "
13884 "B<L>. If used with B<%c> or B<%s>, the corresponding parameter is "
13885 "considered as a pointer to a wide character or wide-character string "
13888 "変換が B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, B<n> か B<n> のいずれかであり次の"
13889 "ポインタが (I<int> ではなく) I<long int> か I<unsigned long int> へのポイン"
13890 "タであること、または、変換が B<e>, B<f>, B<g> のうちのひとつであり次のポイン"
13891 "タが (I<float> ではなく) I<double> へのポインタであることのいずれかであるこ"
13892 "とを示す。 B<l> 文字を二つ指定すると、 B<L> と同じ意味となる。 B<%c> や B<"
13893 "%s> とともに使用すると、 パラメータはそれぞれワイド文字やワイド文字列へのポイ"
13896 #. MTK, Jul 05: The following is no longer true for modern
13897 #. ANSI C (i.e., C99):
13898 #. (Note that long long is not an
13900 #. type. Any program using this will not be portable to all
13902 #. type: Plain text
13903 #: build/C/man3/scanf.3:354
13905 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
13906 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
13907 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
13909 "B<e>, B<f>, B<g> 変換で、次のポインタが I<long double> へのポインタであること"
13910 "を示す。もしくは、 B<d>, B<i>, B<o>, B<u>, B<x> 変換で、次のポインタが "
13911 "I<long long> へのポインタであることのいずれかであることを示す。"
13913 #. type: Plain text
13914 #: build/C/man3/scanf.3:359
13915 msgid "equivalent to B<L>. This specifier does not exist in ANSI C."
13916 msgstr "B<L> と同一である。 この修飾子は ANSI C には存在しない。"
13918 #. type: Plain text
13919 #: build/C/man3/scanf.3:366
13921 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>. This "
13922 "modifier was introduced in C99."
13924 "B<h> と同様だが、次のポインタが I<ptrdiff_t> へのポインタであることを示す。 "
13925 "この修飾子は C99 で導入された。"
13927 #. type: Plain text
13928 #: build/C/man3/scanf.3:373
13930 "As for B<h>, but the next pointer is a pointer to a I<size_t>. This "
13931 "modifier was introduced in C99."
13933 "B<h> と同様だが、次のポインタが I<size_t> へのポインタであることを示す。 この"
13936 #. type: Plain text
13937 #: build/C/man3/scanf.3:377
13938 msgid "The following I<conversion specifiers> are available:"
13939 msgstr "以下の I<「変換指定子」> が利用可能である。"
13941 #. type: Plain text
13942 #: build/C/man3/scanf.3:386
13944 "Matches a literal \\(aq%\\(aq. That is, B<%\\&%> in the format string "
13945 "matches a single input \\(aq%\\(aq character. No conversion is done (but "
13946 "initial white space characters are discarded), and assignment does not occur."
13948 "文字 \\(aq%\\(aq に対応する。 書式文字列の中の B<%\\&%> は単一の文字 \\(aq%"
13949 "\\(aq に対応する。 変換は行われず (但し、先頭のホワイトスペース文字は捨てられ"
13953 #: build/C/man3/scanf.3:386
13958 #. type: Plain text
13959 #: build/C/man3/scanf.3:391
13961 "Matches an optionally signed decimal integer; the next pointer must be a "
13962 "pointer to I<int>."
13964 "符号つきの 10進の整数に対応する。 次のポインタは I<int> へのポインタでなけれ"
13968 #: build/C/man3/scanf.3:391
13973 #. type: Plain text
13974 #: build/C/man3/scanf.3:400
13976 "Equivalent to I<ld>; this exists only for backward compatibility. (Note: "
13977 "thus only in libc4. In libc5 and glibc the B<%D> is silently ignored, "
13978 "causing old programs to fail mysteriously.)"
13980 "I<ld> と同一である。これは以前の仕様との互換性だけのためにある。 (注意: これ"
13981 "は libc4 の場合だけである。 libc5 や glibc では B<%D> は暗黙のうちに無視さ"
13982 "れ、古いプログラムにおいて謎に満ちた失敗の原因となる。)"
13985 #: build/C/man3/scanf.3:400
13990 #. type: Plain text
13991 #: build/C/man3/scanf.3:412
13993 "Matches an optionally signed integer; the next pointer must be a pointer to "
13994 "I<int>. The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
13995 "base 8 if it begins with I<0>, and in base 10 otherwise. Only characters "
13996 "that correspond to the base are used."
13998 "符号つき整数に対応する。 次のポインタは I<int> へのポインタでなければならな"
13999 "い。 この整数は I<0x> または I<0X> で開始する場合には 16 進数、 I<0> で開始す"
14000 "る場合には 8 進数、その他の場合には 10進数として読み込まれる。 この変換で使用"
14001 "される文字は、これらの基数に対応しているものだけである。"
14004 #: build/C/man3/scanf.3:412
14009 #. type: Plain text
14010 #: build/C/man3/scanf.3:416
14012 "Matches an unsigned octal integer; the next pointer must be a pointer to "
14015 "符号なしの 8 進の整数に対応する。 次のポインタは I<unsigned int> でなければな"
14019 #: build/C/man3/scanf.3:416
14024 #. type: Plain text
14025 #: build/C/man3/scanf.3:421
14027 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
14030 "符号なしの 10進の整数に対応する。 次のポインタは I<unsigned int> へのポインタ"
14033 #. type: Plain text
14034 #: build/C/man3/scanf.3:426
14036 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
14037 "to I<unsigned int>."
14039 "符号なしの 16 進の整数に対応する。 次のポインタは I<unsigned int> へのポイン"
14043 #: build/C/man3/scanf.3:426
14048 #. type: Plain text
14049 #: build/C/man3/scanf.3:430
14050 msgid "Equivalent to B<x>."
14051 msgstr "B<x> と同一である。"
14054 #: build/C/man3/scanf.3:430
14059 #. type: Plain text
14060 #: build/C/man3/scanf.3:435
14062 "Matches an optionally signed floating-point number; the next pointer must be "
14063 "a pointer to I<float>."
14065 "符号つき浮動小数点実数に対応する。 次のポインタは I<float> へのポインタでなけ"
14069 #: build/C/man3/scanf.3:435
14074 #. type: Plain text
14075 #: build/C/man3/scanf.3:439 build/C/man3/scanf.3:443 build/C/man3/scanf.3:447
14076 msgid "Equivalent to B<f>."
14077 msgstr "B<f> と同一である。"
14080 #: build/C/man3/scanf.3:439
14086 #: build/C/man3/scanf.3:443
14091 #. type: Plain text
14092 #: build/C/man3/scanf.3:451
14093 msgid "(C99) Equivalent to B<f>."
14094 msgstr "(C99) B<f> と同一である。"
14096 #. type: Plain text
14097 #: build/C/man3/scanf.3:459
14099 "Matches a sequence of non-white-space characters; the next pointer must be a "
14100 "pointer to character array that is long enough to hold the input sequence "
14101 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
14102 "automatically. The input string stops at white space or at the maximum "
14103 "field width, whichever occurs first."
14105 "ホワイトスペースではない文字で構成された文字列に対応する。 次のポインタは文字"
14106 "の配列へのポインタでなければならず、 その文字配列は、入力された文字列と (自動"
14107 "的に追加される) 終端のヌルバイト (\\(aq\\e0\\(aq) を格納するのに十分な大きさ"
14108 "でなければならない。 文字列の入力は、ホワイトスペースが入力されるか、最大"
14109 "フィールド幅に 達するか、のどちらかが起こると停止される。"
14111 #. type: Plain text
14112 #: build/C/man3/scanf.3:469
14114 "Matches a sequence of characters whose length is specified by the I<maximum "
14115 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
14116 "there must be enough room for all the characters (no terminating null byte "
14117 "is added). The usual skip of leading white space is suppressed. To skip "
14118 "white space first, use an explicit space in the format."
14120 "I<「最大フィールド幅」> (デフォルトは 1) で指定された幅の文字の列に対応す"
14121 "る。 次のポインタは I<char> へのポインタで、すべての文字を格納するのに十分な"
14122 "領域が なければならない (終端のヌルバイトは追加されない)。 通常行われる先頭の"
14123 "ホワイトスペースの読み飛ばしは行われない。 先頭のホワイトスペースを読み飛ばす"
14124 "ためには、 フォーマット文の中で明示的にスペースを使用すれば良い。"
14127 #: build/C/man3/scanf.3:469
14132 #. type: Plain text
14133 #: build/C/man3/scanf.3:502
14135 "Matches a nonempty sequence of characters from the specified set of accepted "
14136 "characters; the next pointer must be a pointer to I<char>, and there must be "
14137 "enough room for all the characters in the string, plus a terminating null "
14138 "byte. The usual skip of leading white space is suppressed. The string is "
14139 "to be made up of characters in (or not in) a particular set; the set is "
14140 "defined by the characters between the open bracket B<[> character and a "
14141 "close bracket B<]> character. The set I<excludes> those characters if the "
14142 "first character after the open bracket is a circumflex (B<^>). To include a "
14143 "close bracket in the set, make it the first character after the open bracket "
14144 "or the circumflex; any other position will end the set. The hyphen "
14145 "character B<-> is also special; when placed between two other characters, it "
14146 "adds all intervening characters to the set. To include a hyphen, make it "
14147 "the last character before the final close bracket. For instance, "
14148 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
14149 "nine, and hyphen\". The string ends with the appearance of a character not "
14150 "in the (or, with a circumflex, in) set or when the field width runs out."
14152 "格納された文字列のうちから取り出された、 指定された文字の集合で構成される空で"
14153 "はない文字の列に対応する。 次のポインタは I<char> へのポインタでなければなら"
14154 "ず、 そこには文字列中のすべての文字と終端のヌルバイト を格納するための十分な"
14155 "領域がなければならない。 通常行われる先頭のホワイトスペースの読み飛ばしは行わ"
14156 "れない。 この文字列は特別な集合の中の文字で構成されている。 この集合は 開き括"
14157 "弧 B<[> と閉じ括弧 B<]> の間の文字で定義される。 開き括弧のあとの最初の文字が"
14158 "曲アクセント記号 (B<^>) の場合、集合はこれらの文字を含まないものとなる。 閉"
14159 "じ括弧を集合に含ませるためには、この文字を開き括弧または 曲アクセント記号のあ"
14160 "との最初の文字にすればよい。 つまり、他の位置に閉じ括弧を置くと文字の集合が終"
14161 "る。 ハイフン B<-> もまた特殊文字である。 二つの異なる文字の間に置かれた時、"
14162 "この文字は、 その間にある全ての文字を集合に加える。 ハイフン自体を含ませるた"
14163 "めには、 括弧が閉じる前の最後の一文字をハイフンにすればよい。 例えば、 "
14164 "B<[^]0-9-]> は「閉じ括弧、0 〜 9、ハイフンの 3 種類を除く全ての文字」の集合を"
14165 "意味する。 この文字列は 集合に含まれていない (曲アクセントの場合には含まれ"
14166 "る) 文字の 出現または確保された領域が使い切られた時に終了する。"
14168 #. type: Plain text
14169 #: build/C/man3/scanf.3:510
14171 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
14172 "pointer must be a pointer to a pointer to I<void>."
14174 "(B<printf>(3) の B<%p> で印字されるような) ポインタ値に対応する。 次のポイン"
14175 "タは I<void> へのポインタへのポインタでなければならない。"
14177 #. type: Plain text
14178 #: build/C/man3/scanf.3:530
14180 "Nothing is expected; instead, the number of characters consumed thus far "
14181 "from the input is stored through the next pointer, which must be a pointer "
14182 "to I<int>. This is I<not> a conversion, although it can be suppressed with "
14183 "the B<*> assignment-suppression character. The C standard says: \"Execution "
14184 "of a B<%n> directive does not increment the assignment count returned at the "
14185 "completion of execution\" but the Corrigendum seems to contradict this. "
14186 "Probably it is wise not to make any assumptions on the effect of B<%n> "
14187 "conversions on the return value."
14189 "どんな入力も必要としない。 そのかわりに、 入力からここまで消費された文字数が"
14190 "次のポインタで指定された場所に 格納される。 このポインタは I<int> へのポイン"
14191 "タでなければならない。 変換を抑制するのであれば B<*> 代入抑制文字を使って抑制"
14192 "することができるのだが、 この変換指定子は変換では「ない」。 C 言語の標準規格"
14193 "では「実行の完了時に返される代入の回数は B<%n> 命令の実行では増加しない」と"
14194 "なっているが、 正誤表の内容はこれと矛盾するようである。おそらく、 B<%n> 変換"
14195 "が返り値に与える影響についてはどのような仮定もしないのが 賢明であろう。"
14197 #. type: Plain text
14198 #: build/C/man3/scanf.3:535
14200 "These functions return the number of input items successfully matched and "
14201 "assigned, which can be fewer than provided for, or even zero in the event of "
14202 "an early matching failure."
14204 "これらの関数は、一致と代入が成功した入力要素の個数を返す。 返される値は渡され"
14205 "た変換の個数よりも少ないこともあり、 最初に一致の失敗があった場合には 0 にな"
14208 #. type: Plain text
14209 #: build/C/man3/scanf.3:547
14211 "The value B<EOF> is returned if the end of input is reached before either "
14212 "the first successful conversion or a matching failure occurs. B<EOF> is "
14213 "also returned if a read error occurs, in which case the error indicator for "
14214 "the stream (see B<ferror>(3)) is set, and I<errno> is set indicate the "
14217 "最初の変換が成功する前に入力の最後に達して、一致の失敗が起こった場合には、 "
14218 "B<EOF> が返される。また、 読み込みエラーが発生した場合にも B<EOF> が返され"
14219 "る。読み込みエラーの場合には、そのストリームの エラー指示子がセットされ "
14220 "(B<ferror>(3) 参照)、 I<errno> にエラーを示す値がセットされる。"
14222 #. type: Plain text
14223 #: build/C/man3/scanf.3:553
14225 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
14226 "operation would block."
14228 "I<stream> に対応するファイルディスクリプタが nonblocking となっており、 読み"
14229 "込み操作は停止 (block) することになる。"
14231 #. type: Plain text
14232 #: build/C/man3/scanf.3:558
14234 "The file descriptor underlying I<stream> is invalid, or not open for reading."
14236 "I<stream> に対応するファイルディスクリプタが無効であるが、 読み込み用にオープ"
14239 #. type: Plain text
14240 #: build/C/man3/scanf.3:561
14241 msgid "Input byte sequence does not form a valid character."
14242 msgstr "入力されたバイト列が有効な文字を構成していない。"
14244 #. type: Plain text
14245 #: build/C/man3/scanf.3:565
14246 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
14247 msgstr "読み込み操作がシグナルにより割り込まれた。 B<signal>(7) 参照。"
14249 #. type: Plain text
14250 #: build/C/man3/scanf.3:570
14251 msgid "Not enough arguments; or I<format> is NULL."
14252 msgstr "引き数が十分でない。または I<format> が NULL である。"
14254 #. type: Plain text
14255 #: build/C/man3/scanf.3:573
14256 msgid "Out of memory."
14260 #: build/C/man3/scanf.3:573
14265 #. type: Plain text
14266 #: build/C/man3/scanf.3:577
14268 "The result of an integer conversion would exceed the size that can be stored "
14269 "in the corresponding integer type."
14270 msgstr "整数変換の結果が、対応する整数型に格納できるサイズを越えてしまう。"
14272 #. type: Plain text
14273 #: build/C/man3/scanf.3:587
14275 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>() conform to C89 and "
14276 "C99 and POSIX.1-2001. These standards do not specify the B<ERANGE> error."
14278 "B<fscanf>(), B<scanf>(), B<sscanf>() 関数は C89, C99, POSIX.1-2001 に準拠し"
14279 "ている。 これらの標準では、エラー B<ERANGE> は規定されていない。"
14281 #. type: Plain text
14282 #: build/C/man3/scanf.3:597
14284 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
14285 "the usage of B<L> in integer conversions is the GNU notation."
14287 "B<q> 指定子は I<long long> の 4.4BSD での記述方法である。 一方、整数変換での "
14288 "B<ll> または B<L> の使用は GNU での拡張である。"
14290 #. type: Plain text
14291 #: build/C/man3/scanf.3:608
14293 "The Linux version of these functions is based on the I<GNU> I<libio> "
14294 "library. Take a look at the I<info> documentation of I<GNU> I<libc "
14295 "(glibc-1.08)> for a more concise description."
14297 "これらの関数の Linux 版は I<GNU> I<libio> ライブラリーを元にしている。 より簡"
14298 "潔な説明には I<GNU> I<libc (glibc-1.08)> の I<info> 文書に目を通すこと。"
14301 #: build/C/man3/scanf.3:609
14303 msgid "The 'a' assignment-allocation modifier"
14304 msgstr "'a' 代入割り当て (assignment-allocation) 修飾子"
14306 #. type: Plain text
14307 #: build/C/man3/scanf.3:620
14309 "Originally, the GNU C library supported dynamic allocation for string inputs "
14310 "(as a nonstandard extension) via the B<a> character. (This feature is "
14311 "present at least as far back as glibc 2.0.) Thus, one could write the "
14312 "following to have B<scanf>() allocate a buffer for an input string, with a "
14313 "pointer to that buffer being returned in I<*buf>:"
14315 "元々、 GNU C ライブラリ (glibc) では、 B<a> 文字による文字列入力に対する動的"
14316 "割り当て変換指定子 (dynamic allocation conversion specifier) を (非標準の拡張"
14317 "として) サポートしている。この機能は少なくとも glibc 2.0 の時点ではすでに存在"
14318 "している。 したがって、以下のようにして、 B<scanf>() に入力文字列に対してバッ"
14319 "ファを割り当てさせることができる。割り当てられたバッファは I<*buf> で返され"
14322 #. type: Plain text
14323 #: build/C/man3/scanf.3:623
14327 " scanf(\"%as\", &buf);\n"
14330 " scanf(\"%as\", &buf);\n"
14332 #. type: Plain text
14333 #: build/C/man3/scanf.3:634
14335 "The use of the letter B<a> for this purpose was problematic, since B<a> is "
14336 "also specified by the ISO C standard as a synonym for B<f> (floating-point "
14337 "input). POSIX.1-2008 instead specifies the B<m> modifier for assignment "
14338 "allocation (as documented in DESCRIPTION, above)."
14340 "この目的で文字 B<a> を使うのは問題をはらんでいる。 なぜなら、 B<a> は ISO C "
14341 "標準では (浮動小数点入力を表す) の B<f> の同義語として定義されているからであ"
14342 "る。 その代わり、 POSIX.1-2008 では、(上記の「説明」に書かれている通り) 代入"
14343 "割り当てを行う修飾子として B<m> が規定されている。"
14345 #. type: Plain text
14346 #: build/C/man3/scanf.3:646
14348 "Note that the B<a> modifier is not available if the program is compiled with "
14349 "I<gcc -std=c99> or I<gcc -D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also "
14350 "specified), in which case the B<a> is interpreted as a specifier for "
14351 "floating-point numbers (see above)."
14353 "B<a> 修飾子は I<gcc -std=c99> や I<gcc -D_ISOC99_SOURCE> でコンパイルしたプロ"
14354 "グラムでは (B<_GNU_SOURCE> も同時に指定していない場合) 利用できない点に注意。"
14355 "この場合、 B<a> は (上述の通り) 浮動小数点数を示す変換指定子と解釈される。"
14357 #. type: Plain text
14358 #: build/C/man3/scanf.3:652
14360 "Support for the B<m> modifier was added to glibc starting with version 2.7, "
14361 "and new programs should use that modifier instead of B<a>."
14363 "B<m> 修飾子への対応はバージョン 2.7 以降の glibc で追加されている。新しいプロ"
14364 "グラムでぇあ B<a> の代わりに B<m> を使用すべきである。"
14366 #. type: Plain text
14367 #: build/C/man3/scanf.3:658
14369 "As well as being standardized by POSIX, the B<m> modifier has the following "
14370 "further advantages over the use of B<a:>"
14372 "POSIX で標準化されているだけでなく、 B<m> 修飾子には B<a> を利用する場合に比"
14375 #. type: Plain text
14376 #: build/C/man3/scanf.3:663
14377 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
14378 msgstr "B<%c> 変換指定子にも適用できる (例えば B<%3mc>)。"
14380 #. type: Plain text
14381 #: build/C/man3/scanf.3:669
14383 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
14384 "specifier (and is unaffected by I<gcc -std=c99> etc.)."
14386 "浮動小数点変換指定子としての B<%a> との紛らわしさが避けられる (また I<gcc -"
14387 "std=c99> などの影響も避けられる)。"
14389 #. type: Plain text
14390 #: build/C/man3/scanf.3:682
14392 "All functions are fully C89 conformant, but provide the additional "
14393 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
14394 "B<l> specifiers. The latter may be considered to be a bug, as it changes "
14395 "the behavior of specifiers defined in C89."
14397 "全ての関数は、完全に C89 に準拠している。しかし 追加で B<q> と B<a> 指定子が"
14398 "提供されており、同様に B<L> と B<l> 指定子の付加的な振る舞いもある。後者は、 "
14399 "C89 で定義された指定子の振る舞いを変更するものなので、 バグとみなされるかもし"
14402 #. type: Plain text
14403 #: build/C/man3/scanf.3:698
14405 "Some combinations of the type modifiers and conversion specifiers defined by "
14406 "ANSI C do not make sense (e.g., B<%Ld>). While they may have a well-defined "
14407 "behavior on Linux, this need not to be so on other architectures. Therefore "
14408 "it usually is better to use modifiers that are not defined by ANSI C at all, "
14409 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
14410 "B<u>, B<x>, and B<X> conversions or B<ll>."
14412 "ANSI C で定義された型修飾子と変換指定子の組み合わせの中には 意味を\n"
14413 "なさないものがある (例えば、 B<%Ld>)。 これらが指定された場合、 \n"
14414 "Linux 上でははっきりと定義された振る舞いをするかもしれないが、\n"
14415 "他のアーキテクチャでも同様になっているとは限らない。\n"
14416 "それゆえに、ほとんどの場合、 ANSI C で定義されていない修飾子を使用した\n"
14417 "方が良い。すなわち、 B<d>, B<i>, B<o>, B<u>, B<x>, B<X> 変換や B<ll>\n"
14418 "と組み合わせる場合には、 B<L> の代わりに B<q> を使用した方が良い。"
14420 #. type: Plain text
14421 #: build/C/man3/scanf.3:704
14423 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
14424 "conversions equivalently to B<L>."
14426 "B<q> の使用方法は 4.4BSD と同じではない。 4.4BSD では B<q> は B<L> と同等に浮"
14429 #. type: Plain text
14430 #: build/C/man3/scanf.3:714
14432 "To use the dynamic allocation conversion specifier, specify B<m> as a length "
14433 "modifier (thus B<%ms> or B<%m[>I<range>B<]>). The caller must B<free>(3) "
14434 "the returned string, as in the following example:"
14436 "動的割り当て変換指定子を使用するには、長さ修飾子として B<m> を指定する (つま"
14437 "り、全体としては B<%ms> や B<%m[>I<range>B<]> となる)。以下の例にあるように、"
14438 "呼び出し側は返された文字列を B<free>(3) しなければならない。"
14440 #. type: Plain text
14441 #: build/C/man3/scanf.3:719
14450 #. type: Plain text
14451 #: build/C/man3/scanf.3:730
14455 "n = scanf(\"%m[a-z]\", &p);\n"
14457 " printf(\"read: %s\\en\", p);\n"
14459 "} else if (errno != 0) {\n"
14460 " perror(\"scanf\");\n"
14462 " fprintf(stderr, \"No matching characters\\en\");\n"
14466 "n = scanf(\"%m[a-z]\", &p);\n"
14468 " printf(\"read: %s\\en\", p);\n"
14470 "} else if (errno != 0) {\n"
14471 " perror(\"scanf\");\n"
14473 " fprintf(stderr, \"No matching characters\\en\");\n"
14476 #. type: Plain text
14477 #: build/C/man3/scanf.3:738
14479 "As shown in the above example, it is necessary to call B<free>(3) only if "
14480 "the B<scanf>() call successfully read a string."
14482 "上記の例にあるように、 B<scanf>() が文字列の読み込みに成功した場合にだけ、 "
14483 "B<free>(3) を呼び出す必要がある。"
14485 #. type: Plain text
14486 #: build/C/man3/scanf.3:745
14488 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
14491 "B<getc>(3), B<printf>(3) B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
14495 #: build/C/man3/setbuf.3:48
14501 #: build/C/man3/setbuf.3:48
14504 msgstr "2014-02-18"
14506 #. type: Plain text
14507 #: build/C/man3/setbuf.3:51
14508 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
14510 "setbuf, setbuffer, setlinebuf, setvbuf - ストリームのバッファリングの操作"
14512 #. type: Plain text
14513 #: build/C/man3/setbuf.3:56
14515 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
14516 msgstr "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
14518 #. type: Plain text
14519 #: build/C/man3/setbuf.3:58
14521 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
14522 msgstr "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
14524 #. type: Plain text
14525 #: build/C/man3/setbuf.3:60
14527 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
14528 msgstr "B<void setlinebuf(FILE *>I<stream>B<);>\n"
14530 #. type: Plain text
14531 #: build/C/man3/setbuf.3:63
14533 msgid "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t >I<size>B<);>\n"
14534 msgstr "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t >I<size>B<);>\n"
14536 #. type: Plain text
14537 #: build/C/man3/setbuf.3:73
14538 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
14539 msgstr "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
14541 #. type: Plain text
14542 #: build/C/man3/setbuf.3:96
14544 "The three types of buffering available are unbuffered, block buffered, and "
14545 "line buffered. When an output stream is unbuffered, information appears on "
14546 "the destination file or terminal as soon as written; when it is block "
14547 "buffered many characters are saved up and written as a block; when it is "
14548 "line buffered characters are saved up until a newline is output or input is "
14549 "read from any stream attached to a terminal device (typically I<stdin>). "
14550 "The function B<fflush>(3) may be used to force the block out early. (See "
14551 "B<fclose>(3).) Normally all files are block buffered. When the first I/O "
14552 "operation occurs on a file, B<malloc>(3) is called, and a buffer is "
14553 "obtained. If a stream refers to a terminal (as I<stdout> normally does), it "
14554 "is line buffered. The standard error stream I<stderr> is always unbuffered "
14557 "バッファリングには unbuffered, block buffered, line buffered の3つのタイプが "
14558 "ある。出力ストリームのタイプが unbuffered の場合、データを書き込むとすぐに出 "
14559 "力先ファイルに書き込まれるかターミナルに表示される。block buffered の場合、"
14560 "文 字の読み書きはブロック単位でいっぺんに行われる。line buffered の場合、 新"
14561 "しい行が出力されるか、ターミナルデバイスに接続しているストリーム (通常、"
14562 "I<stdin>) から新しい行が入力されるまで文字がたくわえられる。 ブロックを強制的"
14563 "に出力するには B<fflush>(3) 関数を使う。 (B<fclose>(3) を参照のこと) 通常、"
14564 "ファイルはすべて block buffered である。ファイルに対して 初めて入出力処理を行"
14565 "うと B<malloc>(3) が呼び出されバッファが獲得される。もし ストリームが (通"
14566 "常、 I<stdout> がそうであるように) ターミナルを参照する場合には、ファイルは "
14567 "line buffered と なる。標準エラー出力 I<stderr> はデフォルトでは常に "
14570 #. type: Plain text
14571 #: build/C/man3/setbuf.3:103
14573 "The B<setvbuf>() function may be used on any open stream to change its "
14574 "buffer. The I<mode> argument must be one of the following three macros:"
14576 "B<setvbuf>() 関数は、オープンしている任意のストリームに対してバッファを変更"
14577 "できる。 引き数 I<mode> は、次の 3 つのマクロのうちいずれかである:"
14580 #: build/C/man3/setbuf.3:104
14585 #. type: Plain text
14586 #: build/C/man3/setbuf.3:107
14588 msgstr "unbuffered"
14591 #: build/C/man3/setbuf.3:107
14596 #. type: Plain text
14597 #: build/C/man3/setbuf.3:110
14598 msgid "line buffered"
14599 msgstr "line buffered"
14602 #: build/C/man3/setbuf.3:110
14607 #. type: Plain text
14608 #: build/C/man3/setbuf.3:113
14609 msgid "fully buffered"
14610 msgstr "fully buffered"
14612 #. type: Plain text
14613 #: build/C/man3/setbuf.3:129
14615 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
14616 "least I<size> bytes long; this buffer will be used instead of the current "
14617 "buffer. If the argument I<buf> is NULL, only the mode is affected; a new "
14618 "buffer will be allocated on the next read or write operation. The "
14619 "B<setvbuf>() function may be used only after opening a stream and before "
14620 "any other operations have been performed on it."
14622 "unbuffered のファイルを除き、 I<buf> 引数は I<size> バイト以上の大きさのバッ"
14623 "ファを指していなければならない。このバッファは現在の バッファの代わりに用いら"
14624 "れる。もし、引数 I<buf> が NULL ならば、モードだけが変更される。 新しいバッ"
14625 "ファは次に読み書きした際に割り当てられる。 B<setvbuf>() 関数は、ストリームを"
14626 "オープンした後、 そのストリームに対して何らかの操作をする前にのみ使用できる。"
14628 #. type: Plain text
14629 #: build/C/man3/setbuf.3:135
14631 "The other three calls are, in effect, simply aliases for calls to "
14632 "B<setvbuf>(). The B<setbuf>() function is exactly equivalent to the call"
14634 "他の 3 つの関数は B<setvbuf>() の呼び出しに単純に置き換えることができる。 "
14637 #. type: Plain text
14638 #: build/C/man3/setbuf.3:138
14639 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
14640 msgstr "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
14642 #. type: Plain text
14643 #: build/C/man3/setbuf.3:148
14645 "The B<setbuffer>() function is the same, except that the size of the buffer "
14646 "is up to the caller, rather than being determined by the default B<BUFSIZ>. "
14647 "The B<setlinebuf>() function is exactly equivalent to the call:"
14649 "と全く同等だし、 B<setbuffer>() 関数は、バッファサイズがデフォルト値 "
14650 "B<BUFSIZ> ではなく引数で与えられる点以外は同じである。 B<setlinebuf>() 関数"
14653 #. type: Plain text
14654 #: build/C/man3/setbuf.3:151
14655 msgid "setvbuf(stream, NULL, _IOLBF, 0);"
14656 msgstr "setvbuf(stream, NULL, _IOLBF, 0);"
14658 #. type: Plain text
14659 #: build/C/man3/setbuf.3:162
14661 "The function B<setvbuf>() returns 0 on success. It returns nonzero on "
14662 "failure (I<mode> is invalid or the request cannot be honored). It may set "
14663 "I<errno> on failure."
14665 "B<setvbuf>() 関数は、成功した場合 0 を返す。 失敗した場合、0 以外の値を返す "
14666 "(失敗とは、 I<mode> が不正な場合またはリクエストが条件を満たさない場合であ"
14667 "る)。 B<setvbuf>() 関数が失敗した場合は I<errno> を設定することもある。"
14669 #. type: Plain text
14670 #: build/C/man3/setbuf.3:164
14671 msgid "The other functions do not return a value."
14672 msgstr "その他の関数は値を返さない。"
14674 #. type: Plain text
14675 #: build/C/man3/setbuf.3:173
14677 "The B<setbuf>(), B<setbuffer>(), B<setlinebuf>(), and B<setvbuf>() "
14678 "functions are thread-safe."
14680 "関数 B<setbuf>(), B<setbuffer>(), B<setlinebuf>(), B<setvbuf>() はスレッド"
14683 #. type: Plain text
14684 #: build/C/man3/setbuf.3:179
14685 msgid "The B<setbuf>() and B<setvbuf>() functions conform to C89 and C99."
14687 "B<setbuf>() 関数および B<setvbuf>() 関数は C89 と C99 に準拠している。"
14689 #. type: Plain text
14690 #: build/C/man3/setbuf.3:189
14692 "The B<setbuffer>() and B<setlinebuf>() functions are not portable to "
14693 "versions of BSD before 4.2BSD, and are available under Linux since libc "
14694 "4.5.21. On 4.2BSD and 4.3BSD systems, B<setbuf>() always uses a suboptimal "
14695 "buffer size and should be avoided."
14697 "B<setbuffer>() 関数および B<setlinebuf>() 関数は 4.2BSD より前の BSD とは互"
14698 "換性がない。また Linux でも(古いバージョン では)利用できないかもしれない。"
14699 "4.2BSD および 4.3BSD のシステムでは B<setbuf>() は必ず追加のバッファーのサイ"
14700 "ズを使用するので、これも使うべきでない。"
14702 #. type: Plain text
14703 #: build/C/man3/setbuf.3:196
14705 "You must make sure that the space that I<buf> points to still exists by the "
14706 "time I<stream> is closed, which also happens at program termination. For "
14707 "example, the following is invalid:"
14709 "I<stream> を閉じる時 (プログラムを終了する際にもこれは起きる) には、 I<buf> "
14710 "が指し示す空間とが存在していることを保証しなければならない。 例えば、次のよう"
14713 #. type: Plain text
14714 #: build/C/man3/setbuf.3:199
14716 msgid "#include E<lt>stdio.hE<gt>\n"
14717 msgstr "#include E<lt>stdio.hE<gt>\n"
14719 #. type: Plain text
14720 #: build/C/man3/setbuf.3:208
14726 " char buf[BUFSIZ];\n"
14727 " setbuf(stdin, buf);\n"
14728 " printf(\"Hello, world!\\en\");\n"
14735 " char buf[BUFSIZ];\n"
14736 " setbuf(stdin, buf);\n"
14737 " printf(\"Hello, world!\\en\");\n"
14741 #. type: Plain text
14742 #: build/C/man3/setbuf.3:217
14744 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
14745 "B<printf>(3), B<puts>(3)"
14747 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
14748 "B<printf>(3), B<puts>(3)"
14751 #: build/C/man3/stdin.3:13
14757 #: build/C/man3/stdin.3:13 build/C/man3/tmpfile.3:31
14760 msgstr "2008-07-14"
14762 #. type: Plain text
14763 #: build/C/man3/stdin.3:16
14764 msgid "stdin, stdout, stderr - standard I/O streams"
14765 msgstr "stdin, stdout, stderr - 標準入出力ストリーム"
14767 #. type: Plain text
14768 #: build/C/man3/stdin.3:23
14771 "B<extern FILE *>I<stdin>B<;>\n"
14772 "B<extern FILE *>I<stdout>B<;>\n"
14773 "B<extern FILE *>I<stderr>B<;>\n"
14775 "B<extern FILE *>I<stdin>B<;>\n"
14776 "B<extern FILE *>I<stdout>B<;>\n"
14777 "B<extern FILE *>I<stderr>B<;>\n"
14779 #. type: Plain text
14780 #: build/C/man3/stdin.3:35
14782 "Under normal circumstances every UNIX program has three streams opened for "
14783 "it when it starts up, one for input, one for output, and one for printing "
14784 "diagnostic or error messages. These are typically attached to the user's "
14785 "terminal (see B<tty>(4) but might instead refer to files or other devices, "
14786 "depending on what the parent process chose to set up. (See also the "
14787 "\"Redirection\" section of B<sh>(1).)"
14789 "標準の環境では、 UNIX プログラムは起動時に、オープンされているストリー ムを "
14790 "3 つ与えられる。それぞれ入力用、出力用、診断メッセージやエラーメッ セージの表"
14791 "示用のものである。これらは通常ユーザの端末 (B<tty>(4) を見よ) に接続されてい"
14792 "るが、親プロセスでの選択・設定によってファイル や他のデバイスに関連づけられて"
14793 "いることもある (B<sh>(1) の「リダイレクション」セクションも参照のこと)。"
14795 #. type: Plain text
14796 #: build/C/man3/stdin.3:45
14798 "The input stream is referred to as \"standard input\"; the output stream is "
14799 "referred to as \"standard output\"; and the error stream is referred to as "
14800 "\"standard error\". These terms are abbreviated to form the symbols used to "
14801 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
14803 "入力ストリームは \"standard input\" と呼ばれる。出力ストリームは \"standard "
14804 "output\"、エラーストリームは \"standard error\" と呼ばれる。 これらの用語を短"
14805 "縮したものがそれぞれのファイルを示すシンボルとなる。つ まり I<stdin>, "
14806 "I<stdout>, I<stderr> である。"
14808 #. type: Plain text
14809 #: build/C/man3/stdin.3:54
14811 "Each of these symbols is a B<stdio>(3) macro of type pointer to I<FILE>, "
14812 "and can be used with functions like B<fprintf>(3) or B<fread>(3)."
14814 "これらのシンボルは B<stdio>(3) のマクロで、 FILE へのポインタ型である。した"
14815 "がって B<fprintf>(3) や B<fread>(3) などの関数とともに用いることができる。"
14817 #. type: Plain text
14818 #: build/C/man3/stdin.3:63
14820 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
14821 "same underlying files may also be accessed using the raw UNIX file "
14822 "interface, that is, the functions like B<read>(2) and B<lseek>(2)."
14824 "I<FILE> は UNIX のファイルディスクリプタにバッファ機能を追加したラッパー であ"
14825 "るから、これらのマクロにも対応するファイルがあり、 UNIX の raw ファ イルイン"
14826 "タフェース (B<read>(2) や B<lseek>(2) など) によってアクセスすることもでき"
14829 #. type: Plain text
14830 #: build/C/man3/stdin.3:82
14832 "On program startup, the integer file descriptors associated with the streams "
14833 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively. The "
14834 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
14835 "are defined with these values in I<E<lt>unistd.hE<gt>>. (Applying "
14836 "B<freopen>(3) to one of these streams can change the file descriptor number "
14837 "associated with the stream.)"
14839 "プログラムの起動時には、 ストリーム I<stdin>, I<stdout>, I<stderr> に結びつけ"
14840 "られているファイルディスクリプタの番号は、 それぞれ 0, 1, 2 である。 プリプロ"
14841 "セッサシンボル B<STDIN_FILENO>, B<STDOUT_FILENO>, B<STDERR_FILENO> は "
14842 "I<E<lt>unistd.hE<gt>> 中でそれぞれこれらの値に定義されている。 (これらのスト"
14843 "リームに対して B<freopen>(3) を適用することで、そのストリームに関連付けられ"
14844 "たファイルディスクリプタ の番号を変更することができる。)"
14846 #. type: Plain text
14847 #: build/C/man3/stdin.3:95
14849 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
14850 "unexpected results and should generally be avoided. (For the masochistic "
14851 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
14852 "is supposed to work.) A general rule is that file descriptors are handled "
14853 "in the kernel, while stdio is just a library. This means for example, that "
14854 "after an B<exec>(3), the child inherits all open file descriptors, but all "
14855 "old streams have become inaccessible."
14857 "I<FILE> と raw なファイルディスクリプタの併用は、予期できない結果を生じ るこ"
14858 "とがあるので、通常は避けるべきである。 (マゾヒスティックな人に: POSIX.1 のセ"
14859 "クション 8.2.3 には、この混用で動作がどのようになりそう かが詳しく記述されて"
14860 "いる。) 一般的なルールは以下の通り: ファイルディスクリプタはカーネルによっ"
14861 "て 扱われ、 stdio は単にライブラリによって扱われるのである。すなわち例えば "
14862 "B<exec>(3) の後には、子プロセスはオープンされているファイルディスクリプタ を"
14863 "すべて継承するが、親からのストリームはすべてアクセス不可となる。"
14865 #. type: Plain text
14866 #: build/C/man3/stdin.3:113
14868 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
14869 "macros, assigning to them is nonportable. The standard streams can be made "
14870 "to refer to different files with help of the library function B<freopen>(3), "
14871 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
14872 "and I<stderr>. The standard streams are closed by a call to B<exit>(3) and "
14873 "by normal program termination."
14875 "シンボル I<stdin>, I<stdout>, I<stderr> はすべてマクロとして定義されているの"
14876 "で、これらへの代入 は移植性を保証されない。標準ストリームはライブラリ関数 "
14877 "B<freopen>(3) を用いれば、別のファイルを示すように変更することもできる。 こ"
14878 "のライブラリ関数は I<stdin>, I<stdout>, I<stderr> の再割り当てが可能なように"
14879 "特別に導入されたものである。 標準ストリームは B<exit>(3) の呼び出しと、プロ"
14880 "グラムの正常終了によってクローズされる。"
14882 #. type: Plain text
14883 #: build/C/man3/stdin.3:122
14885 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
14886 "standard also stipulates that these three streams shall be open at program "
14889 "I<stdin>, I<stdout>, I<stderr> マクロは C89 に準拠している。 また C89 では、"
14890 "これら 3 つのストリームがプログラム の起動時にオープンされているべきであるこ"
14893 #. type: Plain text
14894 #: build/C/man3/stdin.3:154
14896 "The stream I<stderr> is unbuffered. The stream I<stdout> is line-buffered "
14897 "when it points to a terminal. Partial lines will not appear until "
14898 "B<fflush>(3) or B<exit>(3) is called, or a newline is printed. This can "
14899 "produce unexpected results, especially with debugging output. The buffering "
14900 "mode of the standard streams (or any other stream) can be changed using the "
14901 "B<setbuf>(3) or B<setvbuf>(3) call. Note that in case I<stdin> is "
14902 "associated with a terminal, there may also be input buffering in the "
14903 "terminal driver, entirely unrelated to stdio buffering. (Indeed, normally "
14904 "terminal input is line buffered in the kernel.) This kernel input handling "
14905 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
14908 "I<stderr> ストリームはバッファリングされていない。 I<stdout> ストリームは、端"
14909 "末に接続されているときには行単位でバッファリング されている。一行に満たない内"
14910 "容は、 B<fflush>(3) か B<exit>(3) が呼び出されるか、改行文字が印字されるま"
14911 "で表示されない。これは、 特にデバッグ時において、予期しない結果を生じる原因と"
14912 "なるかもしれない。 標準ストリームの (あるいは他のすべてのストリームの) バッ"
14913 "ファリングモードは、 B<setbuf>(3) または B<setvbuf>(3) を呼び出すことによっ"
14914 "て変更できる。 ただし、 I<stdin> が端末に接続されているときは、端末のドライバ"
14915 "でバッファリングされている 可能性がある点にも注意すること。これは stdio の"
14916 "バッファリングとは全く 関係なく存在しうる。 (実際、通常だと端末入力はカーネル"
14917 "によって行単位 でバッファリングされている。) このカーネルによる入力の扱いは "
14918 "B<tcsetattr>(3) などの呼び出しによって変更することができる。 B<stty>(1) と "
14919 "B<termios>(3) も参照すること。"
14921 #. type: Plain text
14922 #: build/C/man3/stdin.3:160
14923 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
14924 msgstr "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
14927 #: build/C/man3/stdio.3:39
14933 #: build/C/man3/stdio.3:39
14936 msgstr "2001-12-26"
14938 #. type: Plain text
14939 #: build/C/man3/stdio.3:42
14940 msgid "stdio - standard input/output library functions"
14941 msgstr "stdio - 標準入出力ライブラリ関数"
14943 #. type: Plain text
14944 #: build/C/man3/stdio.3:46
14945 msgid "B<FILE *>I<stdin>B<;>"
14946 msgstr "B<FILE *>I<stdin>B<;>"
14948 #. type: Plain text
14949 #: build/C/man3/stdio.3:48
14950 msgid "B<FILE *>I<stdout>B<;>"
14951 msgstr "B<FILE *>I<stdout>B<;>"
14953 #. type: Plain text
14954 #: build/C/man3/stdio.3:50
14955 msgid "B<FILE *>I<stderr>B<;>"
14956 msgstr "B<FILE *>I<stderr>B<;>"
14958 #. type: Plain text
14959 #: build/C/man3/stdio.3:57
14961 "The standard I/O library provides a simple and efficient buffered stream I/O "
14962 "interface. Input and output is mapped into logical data streams and the "
14963 "physical I/O characteristics are concealed. The functions and macros are "
14964 "listed below; more information is available from the individual man pages."
14966 "標準入出力ライブラリは、簡単かつ効果のよい、 バッファリングされたストリーム入"
14967 "出力インターフェースを提供する。 入力と出力は論理データストリームに割り付けら"
14968 "れ、 入出力の物理的な特徴は隠蔽される。 このライブラリに属する関数とマクロを"
14969 "以下に挙げる。 より詳しい情報は個々の man ページから得ることができる。"
14971 #. type: Plain text
14972 #: build/C/man3/stdio.3:80
14974 "A stream is associated with an external file (which may be a physical "
14975 "device) by I<opening> a file, which may involve creating a new file. "
14976 "Creating an existing file causes its former contents to be discarded. If a "
14977 "file can support positioning requests (such as a disk file, as opposed to a "
14978 "terminal), then a I<file position indicator> associated with the stream is "
14979 "positioned at the start of the file (byte zero), unless the file is opened "
14980 "with append mode. If append mode is used, it is unspecified whether the "
14981 "position indicator will be placed at the start or the end of the file. The "
14982 "position indicator is maintained by subsequent reads, writes and positioning "
14983 "requests. All input occurs as if the characters were read by successive "
14984 "calls to the B<fgetc>(3) function; all output takes place as if all "
14985 "characters were written by successive calls to the B<fputc>(3) function."
14987 "ファイルを I<オープン (open) する> ことによって、 ストリームは外部ファイル "
14988 "(通常は物理デバイス) に連結される。 この操作には新しくファイルを作成すること"
14989 "も含まれる。 既存のファイルと同じ名前のファイルを新たに作ると、 もとのファイ"
14990 "ルの中身が捨てられてしまう。 ファイルが位置指定リクエストをサポートしている "
14991 "(ディスクファイルなどが相当する。逆の例としては端末が挙げられる) 場合、 その"
14992 "ストリームに連結された I<ファイル位置指示子 (file position indicator)> は、追"
14993 "加モードで開かれない限りファイルの先頭 (0 バイト目) に位置する。 追加モードを"
14994 "使用した場合、 位置指示子をファイルの先頭に置かれるか末尾に置かれるかは規定さ"
14995 "れていない。 位置指示子は、 以降の読み書きや位置指定リクエストによって変更さ"
14996 "れる。 すべての入力は、 B<fgetc>(3) 関数を次々に呼び出して文字を読み込んだか"
14997 "のように行われる。 一方すべての出力は、 B<fputc>(3) 関数を次々に呼び出して文"
14998 "字を書き込んだかのように行われる。"
15000 #. type: Plain text
15001 #: build/C/man3/stdio.3:90
15003 "A file is disassociated from a stream by I<closing> the file. Output "
15004 "streams are flushed (any unwritten buffer contents are transferred to the "
15005 "host environment) before the stream is disassociated from the file. The "
15006 "value of a pointer to a I<FILE> object is indeterminate after a file is "
15007 "closed (garbage)."
15009 "ファイルを I<クローズ (close) する> ことによって、そのファイルはストリームか"
15010 "ら切り離される。 出力ストリームは、そのストリームがファイルから切り離される前"
15011 "にフラッシュされる (書き込まれていないすべてのバッファの内容がホスト環境に転"
15012 "送される)。 I<FILE> オブジェクトへのポインタの値は、 ファイルを閉じた後では不"
15013 "確定になる (ゴミになってしまう)。"
15015 #. type: Plain text
15016 #: build/C/man3/stdio.3:103
15018 "A file may be subsequently reopened, by the same or another program "
15019 "execution, and its contents reclaimed or modified (if it can be repositioned "
15020 "at the start). If the main function returns to its original caller, or the "
15021 "B<exit>(3) function is called, all open files are closed (hence all output "
15022 "streams are flushed) before program termination. Other methods of program "
15023 "termination, such as B<abort>(3) do not bother about closing files properly."
15025 "ファイルはその後 (同じまたは別のプログラムによって) 再びオープンされることも"
15026 "あり、 その内容が修正されたり変更されたりする (そのファイルで先頭への位置移動"
15027 "が可能であれば)。 main 関数がもとの呼び出し側に返ったり、 B<exit>(3) 関数が"
15028 "呼ばれた場合、 プログラムの終了の前に 現在開いているすべてのファイルは閉じら"
15029 "れる (その結果、すべての出力ストリームはフラッシュされる)。 プログラムの停止"
15030 "に B<abort>(3) のような他の方法を用いた場合には、 ファイルが正しく閉じられる"
15033 #. type: Plain text
15034 #: build/C/man3/stdio.3:119
15037 #| "At program startup, three text streams are predefined and need not be "
15038 #| "opened explicitly: I<standard input> (for reading conventional input), "
15039 #| "I<standard output> (for writing conventional input), and I<standard "
15040 #| "error> (for writing diagnostic output). These streams are abbreviated "
15041 #| "I<stdin>,I<stdout> and I<stderr>. When opened, the standard error stream "
15042 #| "is not fully buffered; the standard input and output streams are fully "
15043 #| "buffered if and only if the streams do not refer to an interactive device."
15045 "At program startup, three text streams are predefined and need not be opened "
15046 "explicitly: I<standard input> (for reading conventional input), I<standard "
15047 "output> (for writing conventional output), and I<standard error> (for "
15048 "writing diagnostic output). These streams are abbreviated I<stdin>,"
15049 "I<stdout> and I<stderr>. When opened, the standard error stream is not "
15050 "fully buffered; the standard input and output streams are fully buffered if "
15051 "and only if the streams do not refer to an interactive device."
15053 "プログラムの起動時に 3 個のテキストストリームが予め定義されており、 それらは"
15054 "明示的に開く必要がない。 I<標準入力 (standard input)> (通常の入力を読み取るの"
15055 "に使う)、 I<標準出力 (standard output)> (通常の出力を書き込むのに使う)、 I<標"
15056 "準エラー出力 (standard error)> (診断出力を書き込むのに使う) である。 これらの"
15057 "ストリームは I<stdin>, I<stdout>, I<stderr> と短縮して表現される。 オープンさ"
15058 "れたときには、 標準エラーストリームは 完全にはバッファリングされていない。 標"
15059 "準入力ストリームと標準出力ストリームは、 ストリームがインタラクティブなデバイ"
15060 "スを参照していなければ、 完全にバッファリングされている。"
15062 #. type: Plain text
15063 #: build/C/man3/stdio.3:129
15065 "Output streams that refer to terminal devices are always line buffered by "
15066 "default; pending output to such streams is written automatically whenever an "
15067 "input stream that refers to a terminal device is read. In cases where a "
15068 "large amount of computation is done after printing part of a line on an "
15069 "output terminal, it is necessary to B<fflush>(3) the standard output before "
15070 "going off and computing so that the output will appear."
15072 "端末デバイスを参照する出力ストリームは、 デフォルトでは常に行単位でバッファリ"
15073 "ングされている。 ただしそのようなストリームにおけるバッファ内の出力は、 端末"
15074 "デバイスを参照している入力ストリームからの読み込みがあるたびに、 自動的に書き"
15075 "込まれる。 出力端末に行の一部を書き込んだ後で大量の計算を行う場合、 出力が表"
15076 "示されるように、計算に取りかかる前に標準出力に対して B<fflush>(3) を実行する"
15079 #. type: Plain text
15080 #: build/C/man3/stdio.3:143
15082 "The I<stdio> library is a part of the library B<libc> and routines are "
15083 "automatically loaded as needed by the compilers B<cc>(1) and B<pc>(1). The "
15084 "SYNOPSIS sections of the following manual pages indicate which include files "
15085 "are to be used, what the compiler declaration for the function looks like "
15086 "and which external variables are of interest."
15088 "I<stdio> ライブラリは B<libc> ライブラリの一部であり、ルーチンは コンパイ"
15089 "ラー B<cc>(1) と B<pc>(1) によって必要な時に自動的に読み込まれる。 後述す"
15090 "る man ページ中の「書式」の節には、 どのインクルードファイルを使用しなければ"
15091 "ならないか、 その関数のコンパイラー宣言はどのようなものか、 どのような外部変"
15094 #. Not on Linux: .BR fropen ,
15095 #. Not on Linux: .BR fwopen ,
15096 #. type: Plain text
15097 #: build/C/man3/stdio.3:183
15099 "The following are defined as macros; these names may not be reused without "
15100 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
15101 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
15102 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
15103 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
15104 "B<stderr>, B<stdin>, B<stdout>. Function versions of the macro functions "
15105 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
15106 "and B<putchar> exist and will be used if the macros definitions are "
15107 "explicitly removed."
15109 "B<BUFSIZ>, B<EOF>, B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, "
15110 "B<L_ctermid>, B<L_tmpnam>, B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, "
15111 "B<TMP_MAX>, B<clearerr>, B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, "
15112 "B<putc>, B<putchar>, B<stderr>, B<stdin>, B<stdout> はマクロとして定義されて"
15113 "いる。 これらの名前は、現在の定義を B<#undef> で削除しない限り、再利用するこ"
15114 "とはできない。 マクロ関数の関数版として、 B<feof>, B<ferror>, B<clearerr>, "
15115 "B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar> がある。 マクロの定義が明"
15116 "示的に消去されている場合には、 これらを使用することになるだろう。"
15119 #: build/C/man3/stdio.3:183
15121 msgid "List of functions"
15125 #: build/C/man3/stdio.3:188
15127 msgid "Function\tDescription\n"
15131 #: build/C/man3/stdio.3:189
15137 #: build/C/man3/stdio.3:190
15139 msgid "clearerr\tcheck and reset stream status\n"
15140 msgstr "clearerr\tストリームの状態の確認とリセット\n"
15143 #: build/C/man3/stdio.3:191
15145 msgid "fclose\tclose a stream\n"
15146 msgstr "fclose\tストリームをクローズする\n"
15149 #: build/C/man3/stdio.3:192
15151 msgid "fdopen\tstream open functions\n"
15152 msgstr "fdopen\tストリームをオープンする\n"
15155 #: build/C/man3/stdio.3:193
15157 msgid "feof\tcheck and reset stream status\n"
15158 msgstr "feof\tストリームの状態の確認とリセット\n"
15161 #: build/C/man3/stdio.3:194
15163 msgid "ferror\tcheck and reset stream status\n"
15164 msgstr "ferror\tストリームの状態の確認とリセット\n"
15167 #: build/C/man3/stdio.3:195
15169 msgid "fflush\tflush a stream\n"
15170 msgstr "fflush\tストリームをフラッシュする\n"
15173 #: build/C/man3/stdio.3:196
15175 msgid "fgetc\tget next character or word from input stream\n"
15176 msgstr "fgetc\t次の文字または語を入力ストリームから獲得する\n"
15179 #: build/C/man3/stdio.3:197
15181 msgid "fgetpos\treposition a stream\n"
15182 msgstr "fgetpos\tストリームの位置を取得する\n"
15185 #: build/C/man3/stdio.3:198
15187 msgid "fgets\tget a line from a stream\n"
15188 msgstr "fgets\tストリームから行を取得する\n"
15191 #: build/C/man3/stdio.3:199
15193 msgid "fileno\treturn the integer descriptor of the argument stream\n"
15194 msgstr "fileno\t引き数であるストリームの整数値のディスクリプタを返す\n"
15197 #: build/C/man3/stdio.3:200
15199 msgid "fopen\tstream open functions\n"
15200 msgstr "fopen\tストリームをオープンする\n"
15203 #: build/C/man3/stdio.3:201
15205 msgid "fprintf\tformatted output conversion\n"
15206 msgstr "fprintf\t書式付き出力変換\n"
15209 #: build/C/man3/stdio.3:202
15211 msgid "fpurge\tflush a stream\n"
15212 msgstr "fpurge\tストリームをフラッシュする\n"
15215 #: build/C/man3/stdio.3:203
15217 msgid "fputc\toutput a character or word to a stream\n"
15218 msgstr "fputc\t文字または語をストリームに出力する\n"
15221 #: build/C/man3/stdio.3:204
15223 msgid "fputs\toutput a line to a stream\n"
15224 msgstr "fputs\t行をストリームに出力する\n"
15227 #: build/C/man3/stdio.3:205
15229 msgid "fread\tbinary stream input/output\n"
15230 msgstr "fread\tバイナリーストリーム入出力\n"
15233 #: build/C/man3/stdio.3:206
15235 msgid "freopen\tstream open functions\n"
15236 msgstr "freopen\tストリームをオープンする\n"
15239 #: build/C/man3/stdio.3:207
15241 msgid "fscanf\tinput format conversion\n"
15242 msgstr "fscanf\t書式付き入力変換\n"
15245 #: build/C/man3/stdio.3:208
15247 msgid "fseek\treposition a stream\n"
15248 msgstr "fseek\tストリームの位置指示子を移動する\n"
15251 #: build/C/man3/stdio.3:209
15253 msgid "fsetpos\treposition a stream\n"
15254 msgstr "fsetpos\tストリームの位置指示子を移動する\n"
15257 #: build/C/man3/stdio.3:210
15259 msgid "ftell\treposition a stream\n"
15260 msgstr "ftell\tストリームの位置を取得する\n"
15263 #: build/C/man3/stdio.3:211
15265 msgid "fwrite\tbinary stream input/output\n"
15266 msgstr "fwrite\tバイナリーストリーム入出力\n"
15269 #: build/C/man3/stdio.3:212
15271 msgid "getc\tget next character or word from input stream\n"
15272 msgstr "getc\t次の文字または語を入力ストリームから取得する\n"
15275 #: build/C/man3/stdio.3:213
15277 msgid "getchar\tget next character or word from input stream\n"
15278 msgstr "getchar\t次の文字または語を入力ストリームから取得する\n"
15281 #: build/C/man3/stdio.3:214
15283 msgid "gets\tget a line from a stream\n"
15284 msgstr "gets\t行を入力ストリームから取得する\n"
15287 #: build/C/man3/stdio.3:215
15289 msgid "getw\tget next character or word from input stream\n"
15290 msgstr "getw\t次の文字または語を入力ストリームから取得する\n"
15293 #: build/C/man3/stdio.3:216
15295 msgid "mktemp\tmake temporary filename (unique)\n"
15296 msgstr "mktemp\t他と重ならないテンポラリファイル名を作る\n"
15299 #: build/C/man3/stdio.3:217
15301 msgid "perror\tsystem error messages\n"
15302 msgstr "perror\tシステムエラーメッセージ\n"
15305 #: build/C/man3/stdio.3:218
15307 msgid "printf\tformatted output conversion\n"
15308 msgstr "printf\t書式付き出力変換\n"
15311 #: build/C/man3/stdio.3:219
15313 msgid "putc\toutput a character or word to a stream\n"
15314 msgstr "putc\t文字または語をストリームに出力する\n"
15317 #: build/C/man3/stdio.3:220
15319 msgid "putchar\toutput a character or word to a stream\n"
15320 msgstr "putchar\t文字または語をストリームに出力する\n"
15323 #: build/C/man3/stdio.3:221
15325 msgid "puts\toutput a line to a stream\n"
15326 msgstr "puts\t行をストリームに出力する\n"
15329 #: build/C/man3/stdio.3:222
15331 msgid "putw\toutput a character or word to a stream\n"
15332 msgstr "putw\t文字または語をストリームに出力する\n"
15335 #: build/C/man3/stdio.3:223
15337 msgid "remove\tremove directory entry\n"
15338 msgstr "remove\tディレクトリエントリを削除する\n"
15341 #: build/C/man3/stdio.3:224
15343 msgid "rewind\treposition a stream\n"
15344 msgstr "rewind\tストリームの位置指示子を移動する\n"
15347 #: build/C/man3/stdio.3:225
15349 msgid "scanf\tinput format conversion\n"
15350 msgstr "scanf\t書式付き入力変換\n"
15353 #: build/C/man3/stdio.3:226
15355 msgid "setbuf\tstream buffering operations\n"
15356 msgstr "setbuf\tストリームのバッファリングの操作\n"
15359 #: build/C/man3/stdio.3:227
15361 msgid "setbuffer\tstream buffering operations\n"
15362 msgstr "setbuffer\tストリームのバッファリングの操作\n"
15365 #: build/C/man3/stdio.3:228
15367 msgid "setlinebuf\tstream buffering operations\n"
15368 msgstr "setlinebuf\tストリームのバッファリングの操作\n"
15371 #: build/C/man3/stdio.3:229
15373 msgid "setvbuf\tstream buffering operations\n"
15374 msgstr "setvbuf\tストリームのバッファリングの操作\n"
15377 #: build/C/man3/stdio.3:230
15379 msgid "sprintf\tformatted output conversion\n"
15380 msgstr "sprintf\t書式付き出力変換\n"
15383 #: build/C/man3/stdio.3:231
15385 msgid "sscanf\tinput format conversion\n"
15386 msgstr "sscanf\t書式付き入力変換\n"
15389 #: build/C/man3/stdio.3:232
15391 msgid "strerror\tsystem error messages\n"
15392 msgstr "strerror\tシステムエラーメッセージ\n"
15395 #: build/C/man3/stdio.3:233
15397 msgid "sys_errlist\tsystem error messages\n"
15398 msgstr "sys_errlist\tシステムエラーメッセージ\n"
15401 #: build/C/man3/stdio.3:234
15403 msgid "sys_nerr\tsystem error messages\n"
15404 msgstr "sys_nerr\tシステムエラーメッセージ\n"
15407 #: build/C/man3/stdio.3:235
15409 msgid "tempnam\ttemporary file routines\n"
15410 msgstr "tempnam\tテンポラリファイルの操作\n"
15413 #: build/C/man3/stdio.3:236
15415 msgid "tmpfile\ttemporary file routines\n"
15416 msgstr "tmpfile\tテンポラリファイルの操作\n"
15419 #: build/C/man3/stdio.3:237
15421 msgid "tmpnam\ttemporary file routines\n"
15422 msgstr "tmpnam\tテンポラリファイルの操作\n"
15425 #: build/C/man3/stdio.3:238
15427 msgid "ungetc\tun-get character from input stream\n"
15428 msgstr "ungetc\t入力ストリームへ 1 文字戻す。\n"
15431 #: build/C/man3/stdio.3:239
15433 msgid "vfprintf\tformatted output conversion\n"
15434 msgstr "vfprintf\t書式付き出力変換\n"
15437 #: build/C/man3/stdio.3:240
15439 msgid "vfscanf\tinput format conversion\n"
15440 msgstr "vfscanf\t書式付き入力変換\n"
15443 #: build/C/man3/stdio.3:241
15445 msgid "vprintf\tformatted output conversion\n"
15446 msgstr "vprintf\t書式付き出力変換\n"
15449 #: build/C/man3/stdio.3:242
15451 msgid "vscanf\tinput format conversion\n"
15452 msgstr "vscanf\t書式付き入力変換\n"
15455 #: build/C/man3/stdio.3:243
15457 msgid "vsprintf\tformatted output conversion\n"
15458 msgstr "vsprintf\t書式付き出力変換\n"
15461 #: build/C/man3/stdio.3:244
15463 msgid "vsscanf\tinput format conversion\n"
15464 msgstr "vsscanf\t書式付き入力変換\n"
15466 #. type: Plain text
15467 #: build/C/man3/stdio.3:250
15468 msgid "The I<stdio> library conforms to C89."
15469 msgstr "I<stdio> ライブラリは C89 に準拠している。"
15471 #. type: Plain text
15472 #: build/C/man3/stdio.3:257
15474 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
15475 "B<unlocked_stdio>(3)"
15477 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
15478 "B<unlocked_stdio>(3)"
15481 #: build/C/man3/stdio_ext.3:25
15486 #. type: Plain text
15487 #: build/C/man3/stdio_ext.3:30
15489 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
15490 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
15493 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
15494 "__fsetlocking, __fwritable, __fwriting, _flushlbf - 標準入出力ファイル構造体"
15497 #. type: Plain text
15498 #: build/C/man3/stdio_ext.3:34
15499 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
15500 msgstr "B<#include E<lt>stdio_ext.hE<gt>>"
15502 #. type: Plain text
15503 #: build/C/man3/stdio_ext.3:36
15504 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
15505 msgstr "B<size_t __fbufsize(FILE *>I<stream>B<);>"
15507 #. type: Plain text
15508 #: build/C/man3/stdio_ext.3:38
15509 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
15510 msgstr "B<size_t __fpending(FILE *>I<stream>B<);>"
15512 #. type: Plain text
15513 #: build/C/man3/stdio_ext.3:40
15514 msgid "B<int __flbf(FILE *>I<stream>B<);>"
15515 msgstr "B<int __flbf(FILE *>I<stream>B<);>"
15517 #. type: Plain text
15518 #: build/C/man3/stdio_ext.3:42
15519 msgid "B<int __freadable(FILE *>I<stream>B<);>"
15520 msgstr "B<int __freadable(FILE *>I<stream>B<);>"
15522 #. type: Plain text
15523 #: build/C/man3/stdio_ext.3:44
15524 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
15525 msgstr "B<int __fwritable(FILE *>I<stream>B<);>"
15527 #. type: Plain text
15528 #: build/C/man3/stdio_ext.3:46
15529 msgid "B<int __freading(FILE *>I<stream>B<);>"
15530 msgstr "B<int __freading(FILE *>I<stream>B<);>"
15532 #. type: Plain text
15533 #: build/C/man3/stdio_ext.3:48
15534 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
15535 msgstr "B<int __fwriting(FILE *>I<stream>B<);>"
15537 #. type: Plain text
15538 #: build/C/man3/stdio_ext.3:50
15539 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
15540 msgstr "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
15542 #. type: Plain text
15543 #: build/C/man3/stdio_ext.3:52
15544 msgid "B<void _flushlbf(void);>"
15545 msgstr "B<void _flushlbf(void);>"
15547 #. type: Plain text
15548 #: build/C/man3/stdio_ext.3:54
15549 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
15550 msgstr "B<void __fpurge(FILE *>I<stream>B<);>"
15552 #. type: Plain text
15553 #: build/C/man3/stdio_ext.3:59
15555 "Solaris introduced routines to allow portable access to the internals of the "
15556 "I<FILE> structure, and glibc also implemented these."
15558 "Solaris では、 I<FILE> 構造体の内部へポータブルなかたちで アクセスできる手段"
15559 "が導入されており、これらは glibc でも実装されている。"
15561 #. type: Plain text
15562 #: build/C/man3/stdio_ext.3:64
15564 "The B<__fbufsize>() function returns the size of the buffer currently used "
15565 "by the given stream."
15567 "B<__fbufsize>() 関数は、指定されたストリームが使用しているバッファサイズを返"
15570 #. type: Plain text
15571 #: build/C/man3/stdio_ext.3:71
15573 "The B<__fpending>() function returns the number of bytes in the output "
15574 "buffer. For wide-oriented streams the unit is wide characters. This "
15575 "function is undefined on buffers in reading mode, or opened read-only."
15577 "B<__fpending>() 関数は、出力バッファに入っているデータのバイト数を返す。 ワ"
15578 "イドキャラクタを扱うストリームの場合、ワイドキャラクタ単位で計算される。 バッ"
15579 "ファが読み出しモードの場合や読み出し専用で開かれている場合の この関数の振舞い"
15582 #. type: Plain text
15583 #: build/C/man3/stdio_ext.3:76
15585 "The B<__flbf>() function returns a nonzero value if the stream is line-"
15586 "buffered, and zero otherwise."
15588 "B<__flbf>() 関数は、ストリームがラインバッファの場合は 0 以外を、 それ以外の"
15591 #. type: Plain text
15592 #: build/C/man3/stdio_ext.3:81
15594 "The B<__freadable>() function returns a nonzero value if the stream allows "
15595 "reading, and zero otherwise."
15597 "B<__freadable>() 関数は、ストリームが読み出し可能な場合は 0 以外を、 それ以"
15600 #. type: Plain text
15601 #: build/C/man3/stdio_ext.3:86
15603 "The B<__fwritable>() function returns a nonzero value if the stream allows "
15604 "writing, and zero otherwise."
15606 "B<__fwritable>() 関数は、ストリームが書き込み可能な場合は 0 以外を、 それ以"
15609 #. type: Plain text
15610 #: build/C/man3/stdio_ext.3:92
15612 "The B<__freading>() function returns a nonzero value if the stream is read-"
15613 "only, or if the last operation on the stream was a read operation, and zero "
15616 "B<__freading>() 関数は、ストリームが読み出し専用の場合、またはストリームに対"
15617 "する直前の操作が 読み出し操作であった場合は 0 以外を返し、それ以外の場合は 0 "
15620 #. type: Plain text
15621 #: build/C/man3/stdio_ext.3:98
15623 "The B<__fwriting>() function returns a nonzero value if the stream is write-"
15624 "only (or append-only), or if the last operation on the stream was a write "
15625 "operation, and zero otherwise."
15627 "B<__fwriting>() 関数は、ストリームが書き込み専用(もしくは追加専用)の場合、 "
15628 "またはストリームに対する直前の操作が書き込み操作であった場合は 0 以外を返"
15629 "し、 それ以外の場合は 0 を返す。"
15631 #. type: Plain text
15632 #: build/C/man3/stdio_ext.3:106
15634 "The B<__fsetlocking>() function can be used to select the desired type of "
15635 "locking on the stream. It returns the current type. The I<type> argument "
15636 "can take the following three values:"
15638 "B<__fsetlocking>() 関数は、ストリームのロック形式を選択するために使用でき"
15639 "る。 返り値は、現在のロック形式である。 I<type> 引き数は以下の 3 種類の値をと"
15643 #: build/C/man3/stdio_ext.3:106
15645 msgid "B<FSETLOCKING_INTERNAL>"
15646 msgstr "B<FSETLOCKING_INTERNAL>"
15648 #. type: Plain text
15649 #: build/C/man3/stdio_ext.3:111
15651 "Perform implicit locking around every operation on the given stream (except "
15652 "for the *_unlocked ones). This is the default."
15654 "指定されたストリームに対して操作が行われる度に、操作の前後で 明示的に指示しな"
15655 "くてもストリームのロック処理を行う (但し、*_unlocked 関数を使用した場合は例外"
15656 "である)。 これがデフォルトのロック形式である。"
15659 #: build/C/man3/stdio_ext.3:111
15661 msgid "B<FSETLOCKING_BYCALLER>"
15662 msgstr "B<FSETLOCKING_BYCALLER>"
15664 #. type: Plain text
15665 #: build/C/man3/stdio_ext.3:118
15667 "The caller will take care of the locking (possibly using B<flockfile>(3) in "
15668 "case there is more than one thread), and the stdio routines will not do "
15669 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
15671 "関数の呼び出し元でロックの面倒をみる。 (おそらく、複数のスレッドが存在する状"
15672 "況では B<flockfile>(3) を使うことになるだろう) ロック形式が "
15673 "B<FSETLOCKING_INTERNAL> にリセットされるまでは標準入出力関連の関数はロック処"
15677 #: build/C/man3/stdio_ext.3:118
15679 msgid "B<FSETLOCKING_QUERY>"
15680 msgstr "B<FSETLOCKING_QUERY>"
15682 #. type: Plain text
15683 #: build/C/man3/stdio_ext.3:122
15684 msgid "Don't change the type of locking. (Only return it.)"
15685 msgstr "ロック形式の変更を行わない。(現在の形式を返すだけである)"
15687 #. type: Plain text
15688 #: build/C/man3/stdio_ext.3:128
15690 "The B<_flushlbf>() function flushes all line-buffered streams. (Presumably "
15691 "so that output to a terminal is forced out, say before reading keyboard "
15694 "B<_flushlbf>() 関数は、すべてのラインバッファ (line-buffered) タイプのスト"
15695 "リームの 内容を出力(フラッシュ)する。 (当然ながら、端末への出力が強制的に行わ"
15696 "れることになるので、 キーボードからの入力を読みこむ前にこの関数を呼んだ方がい"
15699 #. type: Plain text
15700 #: build/C/man3/stdio_ext.3:132
15702 "The B<__fpurge>() function discards the contents of the stream's buffer."
15703 msgstr "B<__fpurge>() 関数は、ストリームのバッファの内容を廃棄する。"
15705 #. type: Plain text
15706 #: build/C/man3/stdio_ext.3:141
15708 "The B<__fbufsize>(), B<__fpending>(), B<__fpurge>() and B<__fsetlocking>() "
15709 "functions do not lock the stream, so they are not thread-safe."
15711 "関数 B<__fbufsize>(), B<__fpending>(), B<__fpurge>(), B<__fsetlocking>() "
15712 "は、 ストリームのロックを行わない。 そのため、スレッドセーフではない。"
15714 #. type: Plain text
15715 #: build/C/man3/stdio_ext.3:151
15717 "The B<__flbf>(), B<__freadable>(), B<__freading>(), B<__fwritable>(), "
15718 "B<__fwriting>() and B<_flushlbf>() functions are thread-safe."
15720 "関数 B<__flbf>(), B<__freadable>(), B<__freading>(), B<__fwritable>(), "
15721 "B<__fwriting>(), B<_flushlbf>() はスレッドセーフである。"
15723 #. type: Plain text
15724 #: build/C/man3/stdio_ext.3:154
15725 msgid "B<flockfile>(3), B<fpurge>(3)"
15726 msgstr "B<flockfile>(3), B<fpurge>(3)"
15729 #: build/C/man2/symlink.2:33 build/C/man7/symlink.7:37
15735 #: build/C/man2/symlink.2:33
15738 msgstr "2014-05-05"
15740 #. type: Plain text
15741 #: build/C/man2/symlink.2:36
15742 msgid "symlink, symlinkat - make a new name for a file"
15743 msgstr "symlink, symlinkat - ファイルに新しい名前を付ける"
15745 #. type: Plain text
15746 #: build/C/man2/symlink.2:41
15748 msgid "B<int symlink(const char *>I<target>B<, const char *>I<linkpath>B<);>\n"
15749 msgstr "B<int symlink(const char *>I<target>B<, const char *>I<linkpath>B<);>\n"
15751 #. type: Plain text
15752 #: build/C/man2/symlink.2:47
15754 msgid "B<int symlinkat(const char *>I<target>B<, int >I<newdirfd>B<, const char *>I<linkpath>B<);>\n"
15755 msgstr "B<int symlinkat(const char *>I<target>B<, int >I<newdirfd>B<, const char *>I<linkpath>B<);>\n"
15757 #. type: Plain text
15758 #: build/C/man2/symlink.2:56
15759 msgid "B<symlink>():"
15760 msgstr "B<symlink>():"
15762 #. type: Plain text
15763 #: build/C/man2/symlink.2:62
15764 msgid "B<symlinkat>():"
15765 msgstr "B<symlinkat>():"
15767 #. type: Plain text
15768 #: build/C/man2/symlink.2:80
15770 "B<symlink>() creates a symbolic link named I<linkpath> which contains the "
15771 "string I<target>."
15773 "B<symlink>() は I<target> という文字列をファイルの内容として持つ "
15774 "I<linkpath> というシンボリックリンク (symbolic link) を作成する。"
15776 #. type: Plain text
15777 #: build/C/man2/symlink.2:84
15779 "Symbolic links are interpreted at run time as if the contents of the link "
15780 "had been substituted into the path being followed to find a file or "
15783 "シンボリックリンクは実行時に解釈され、 リンクの内容でパスを置き換えて、そのパ"
15784 "スを辿ることで、 ファイルやディレクトリに到達する。"
15786 #. type: Plain text
15787 #: build/C/man2/symlink.2:89
15789 "Symbolic links may contain I<..> path components, which (if used at the "
15790 "start of the link) refer to the parent directories of that in which the link "
15793 "シンボリックリンクはパスの部分に I<..> を含むかもしれない。これは (もしリンク"
15794 "の最初に使用された場合は) リンクの 存在するディレクトリの親ディレクトリが参照"
15797 #. type: Plain text
15798 #: build/C/man2/symlink.2:93
15800 "A symbolic link (also known as a soft link) may point to an existing file or "
15801 "to a nonexistent one; the latter case is known as a dangling link."
15803 "シンボリックリンクは (ソフトリンク (soft link) とも呼ばれ) 存在するファイル"
15804 "を指しているかもしれないし、 存在しないファイルを指しているかもしれない; 後者"
15805 "の場合は壊れたリンク (dangling link) とも呼ばれる。"
15807 #. type: Plain text
15808 #: build/C/man2/symlink.2:100
15810 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
15811 "when following the link, but is checked when removal or renaming of the link "
15812 "is requested and the link is in a directory with the sticky bit "
15813 "(B<S_ISVTX>) set."
15815 "シンボリックリンクの許可 (permission) は無意味である; リンクを追跡する場合に"
15816 "は所有権 (ownership) は無視される。 ただし、リンクの削除や名前の変更が要求さ"
15817 "れ、かつリンクが存在する ディレクトリにスティッキービット (sticky bit) "
15818 "(B<S_ISVTX>) が設定されている場合には、所有権のチェックが行われる。"
15820 #. type: Plain text
15821 #: build/C/man2/symlink.2:106
15822 msgid "If I<linkpath> exists, it will I<not> be overwritten."
15823 msgstr "I<linkpath> が存在する場合には上書きはI<されない>。"
15826 #: build/C/man2/symlink.2:106
15828 msgid "symlinkat()"
15829 msgstr "symlinkat()"
15831 #. type: Plain text
15832 #: build/C/man2/symlink.2:112
15834 "The B<symlinkat>() system call operates in exactly the same way as "
15835 "B<symlink>(), except for the differences described here."
15837 "B<symlinkat>() システムコールは B<symlink>() と全く同様に動作するが、以下で説"
15840 #. type: Plain text
15841 #: build/C/man2/symlink.2:122
15843 "If the pathname given in I<linkpath> is relative, then it is interpreted "
15844 "relative to the directory referred to by the file descriptor I<newdirfd> "
15845 "(rather than relative to the current working directory of the calling "
15846 "process, as is done by B<symlink>() for a relative pathname)."
15848 "I<linkpath> で指定されたパス名が相対パスの場合、このパス名はファイルディスク"
15849 "リプター I<newdirfd> が参照するディレクトリに対する相対パスと解釈される "
15850 "(B<symlink>() に相対パス名を渡した場合のように、呼び出したプロセスのカレント"
15851 "ワーキングディレクトリに対する相対パスではない)。"
15853 #. type: Plain text
15854 #: build/C/man2/symlink.2:134
15856 "If I<linkpath> is relative and I<newdirfd> is the special value B<AT_FDCWD>, "
15857 "then I<linkpath> is interpreted relative to the current working directory of "
15858 "the calling process (like B<symlink>())."
15860 "I<linkpath> で指定されたパス名が相対パスで、 I<newdirfd> が特別な値 "
15861 "B<AT_FDCWD> の場合、 (B<symlink>() と同様に) I<linkpath> は呼び出したプロセス"
15862 "のカレントワーキングディレクトリに対する相対パスと解釈される。"
15864 #. type: Plain text
15865 #: build/C/man2/symlink.2:140
15866 msgid "If I<linkpath> is absolute, then I<newdirfd> is ignored."
15868 "I<linkpath> で指定されたパス名が絶対パスの場合、 I<newdirfd> は無視される。"
15870 #. type: Plain text
15871 #: build/C/man2/symlink.2:155
15873 "Write access to the directory containing I<linkpath> is denied, or one of "
15874 "the directories in the path prefix of I<linkpath> did not allow search "
15875 "permission. (See also B<path_resolution>(7).)"
15877 "I<linkpath> を含んでいるディレクトリへの書き込みが拒否されたか、 I<linkpath> "
15878 "に含まれているディレクトリのどれかに検索許可が与えられていない "
15879 "(B<path_resolution>(7) も参照すること)。"
15881 #. type: Plain text
15882 #: build/C/man2/symlink.2:160
15884 "The user's quota of resources on the filesystem has been exhausted. The "
15885 "resources could be inodes or disk blocks, depending on the filesystem "
15888 "そのファイルシステムのリソース使用量がユーザクォータに達している。対象となる"
15889 "リソースは inode かディスクブロックで、どちらになるかはファイルシステムの実装"
15892 #. type: Plain text
15893 #: build/C/man2/symlink.2:164
15894 msgid "I<linkpath> already exists."
15895 msgstr "I<linkpath> が既に存在する。"
15897 #. type: Plain text
15898 #: build/C/man2/symlink.2:167
15899 msgid "I<target> or I<linkpath> points outside your accessible address space."
15901 "I<target> や I<linkpath> がアクセス可能なアドレス空間の外を指している。"
15903 #. type: Plain text
15904 #: build/C/man2/symlink.2:174
15905 msgid "Too many symbolic links were encountered in resolving I<linkpath>."
15906 msgstr "I<linkpath> を解決する際に遭遇したシンボリックリンクが多過ぎる。"
15908 #. type: Plain text
15909 #: build/C/man2/symlink.2:177
15910 msgid "I<target> or I<linkpath> was too long."
15911 msgstr "I<target> または I<linkpath> が長過ぎる。"
15913 #. type: Plain text
15914 #: build/C/man2/symlink.2:184
15916 "A directory component in I<linkpath> does not exist or is a dangling "
15917 "symbolic link, or I<target> is the empty string."
15919 "I<linkpath> に含まれるディレクトリ部分が存在しないか、壊れたリンクであるか、 "
15920 "I<target> が空文字列である。"
15922 #. type: Plain text
15923 #: build/C/man2/symlink.2:196
15925 "A component used as a directory in I<linkpath> is not, in fact, a directory."
15927 "I<linkpath> に含まれるディレクトリ部分が、実際には、ディレクトリではない。"
15929 #. type: Plain text
15930 #: build/C/man2/symlink.2:201
15932 "The filesystem containing I<linkpath> does not support the creation of "
15935 "I<linkpath> を含んでいるファイルシステム (file system) が シンボリックリンク"
15938 #. type: Plain text
15939 #: build/C/man2/symlink.2:205
15940 msgid "I<linkpath> is on a read-only filesystem."
15941 msgstr "I<linkpath> が読み込み専用のファイルシステムに存在している。"
15943 #. type: Plain text
15944 #: build/C/man2/symlink.2:208
15945 msgid "The following additional errors can occur for B<symlinkat>():"
15946 msgstr "B<symlinkat>() では以下のエラーも発生する。"
15948 #. type: Plain text
15949 #: build/C/man2/symlink.2:212
15950 msgid "I<newdirfd> is not a valid file descriptor."
15951 msgstr "I<newdirfd> が有効なファイルディスクリプタでない。"
15953 #. type: Plain text
15954 #: build/C/man2/symlink.2:218
15957 #| "I<linkpath> is relative and I<newdirfd> is a file descriptor referring to "
15958 #| "a file other than a directory."
15960 "I<linkpath> is a relative pathname and I<newdirfd> refers to a directory "
15961 "that has been deleted."
15963 "I<linkpath> が相対パスで、 I<newdirfd> がディレクトリ以外のファイルを参照して"
15964 "いるファイルディスクリプタである。"
15966 #. type: Plain text
15967 #: build/C/man2/symlink.2:224
15969 "I<linkpath> is relative and I<newdirfd> is a file descriptor referring to a "
15970 "file other than a directory."
15972 "I<linkpath> が相対パスで、 I<newdirfd> がディレクトリ以外のファイルを参照して"
15973 "いるファイルディスクリプタである。"
15975 #. type: Plain text
15976 #: build/C/man2/symlink.2:228
15978 "B<symlinkat>() was added to Linux in kernel 2.6.16; library support was "
15979 "added to glibc in version 2.4."
15981 "B<symlinkat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサ"
15982 "ポートはバージョン 2.4 で glibc に追加された。"
15984 #. SVr4 documents additional error codes EDQUOT and ENOSYS.
15987 #. re multiple files with the same name, and NFS.
15988 #. type: Plain text
15989 #: build/C/man2/symlink.2:235
15990 msgid "B<symlink>(): SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
15991 msgstr "B<symlink>(): SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
15993 #. type: Plain text
15994 #: build/C/man2/symlink.2:238
15995 msgid "B<symlinkat>(): POSIX.1-2008."
15996 msgstr "B<symlinkat>(): POSIX.1-2008."
15998 #. type: Plain text
15999 #: build/C/man2/symlink.2:242
16000 msgid "No checking of I<target> is done."
16001 msgstr "I<target> についてのチェックは行なわれない。"
16003 #. type: Plain text
16004 #: build/C/man2/symlink.2:247
16006 "Deleting the name referred to by a symbolic link will actually delete the "
16007 "file (unless it also has other hard links). If this behavior is not "
16008 "desired, use B<link>(2)."
16010 "シンボリックリンクによって参照される名前を削除すると (それが他にハードリンク "
16011 "(hard link) を持たなければ) 実際にファイルが削除される。 この動作が望んだもの"
16012 "でない場合は、 B<link>(2) を使用すること。"
16014 #. type: Plain text
16015 #: build/C/man2/symlink.2:258
16017 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
16018 "B<rename>(2), B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
16020 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
16021 "B<rename>(2), B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
16023 #. type: Plain text
16024 #: build/C/man7/symlink.7:40
16025 msgid "symlink - symbolic link handling"
16026 msgstr "symlink - シンボリックリンクの取り扱い"
16028 #. type: Plain text
16029 #: build/C/man7/symlink.7:44
16031 "Symbolic links are files that act as pointers to other files. To understand "
16032 "their behavior, you must first understand how hard links work."
16034 "シンボリックリンクは他のファイルへのポインタとして振る舞うファイルである。 そ"
16035 "の挙動を理解するには、まずハードリンクがどのように機能するかを理解しておかな"
16038 #. type: Plain text
16039 #: build/C/man7/symlink.7:60
16041 "A hard link to a file is indistinguishable from the original file because it "
16042 "is a reference to the object underlying the original filename. (To be "
16043 "precise: each of the hard links to a file is a reference to the same I<i-"
16044 "node number>, where an i-node number is an index into the i-node table, "
16045 "which contains metadata about all files on a filesystem. See B<stat>(2).) "
16046 "Changes to a file are independent of the name used to reference the file. "
16047 "Hard links may not refer to directories (to prevent the possibility of loops "
16048 "within the filesystem tree, which would confuse many programs) and may not "
16049 "refer to files on different filesystems (because i-node numbers are not "
16050 "unique across filesystems)."
16052 "あるファイルへのハードリンクは、 元々のファイルと区別することができない。 な"
16053 "ぜなら、 ハードリンクは元々のファイル名の裏にあるオブジェクトへの参照だからで"
16054 "ある。 (より正確には、 あるファイルへのハードリンクはそれぞれ同じ I<i-node 番"
16055 "号> への参照である。 i-node 番号は i-node テーブルへのインデックスで、 i-"
16056 "node テーブルはファイルシステム上のすべてのファイルについてのメタデータを保持"
16057 "している。 B<stat>(2) 参照。) ファイルへの変更は、ファイルの参照に使用された"
16058 "名前とは独立に行われる。 ハードリンクはディレクトリを参照することはできない "
16059 "(これはファイルシステムツリー内でループが発生する可能性を防止するためであ"
16060 "り、 ループが発生すると、 多くのプログラムが混乱してしまうことだろう)。 ま"
16061 "た、 ハードリンクは異なるファイルシステム上のファイルを参照することもできな"
16062 "い (i-node 番号はファイルシステムをまたがると一意ではないからである)。"
16064 #. type: Plain text
16065 #: build/C/man7/symlink.7:69
16067 "A symbolic link is a special type of file whose contents are a string that "
16068 "is the pathname of another file, the file to which the link refers. (The "
16069 "contents of a symbolic link can be read using B<readlink>(2).) In other "
16070 "words, a symbolic link is a pointer to another name, and not to an "
16071 "underlying object. For this reason, symbolic links may refer to directories "
16072 "and may cross filesystem boundaries."
16074 "シンボリックリンクは特別な種類のファイルで、 ファイルの内容はそのリンクの参照"
16075 "先の別のファイルのパス名を示す文字列である (シンボリックリンクの内容は "
16076 "B<readlink>(2) を使って読むことができる)。 言い換えると、 シンボリックリンク"
16077 "は別の名前へのポインタであり、 ファイルの裏にあるオブジェクトへのポインタでは"
16078 "ない。 この理由から、 シンボリックリンクではディレクトリへの参照やファイルシ"
16079 "ステム境界を越える参照を行うことができる。"
16081 #. type: Plain text
16082 #: build/C/man7/symlink.7:75
16084 "There is no requirement that the pathname referred to by a symbolic link "
16085 "should exist. A symbolic link that refers to a pathname that does not exist "
16086 "is said to be a I<dangling link>."
16088 "シンボリックリンクが参照する先のパス名が存在しないといけないという要件はな"
16089 "い。 存在しないパス名を参照するシンボリックリンクは「壊れた (dangling) リン"
16092 #. type: Plain text
16093 #: build/C/man7/symlink.7:87
16095 "Because a symbolic link and its referenced object coexist in the filesystem "
16096 "name space, confusion can arise in distinguishing between the link itself "
16097 "and the referenced object. On historical systems, commands and system calls "
16098 "adopted their own link-following conventions in a somewhat ad-hoc fashion. "
16099 "Rules for a more uniform approach, as they are implemented on Linux and "
16100 "other systems, are outlined here. It is important that site-local "
16101 "applications also conform to these rules, so that the user interface can be "
16102 "as consistent as possible."
16104 "シンボリックリンクとその参照先のオブジェクトは一つのファイルシステムの名前空"
16105 "間内に共存するので、 リンクそのものと参照先のオブジェクトの間で混乱が生じる可"
16106 "能性がある。 かなり昔からあるシステムでは、 コマンドやシステムコールはいくら"
16107 "かアドホックな方法の独自のリンクの辿り方の決まり事を採用している。 ここで"
16108 "は、 Linux や他のシステムで実装されている、 もっと広く使われている方法のルー"
16109 "ルについて概要を説明する。 サイト固有のアプリケーションもこれらのルールに準拠"
16110 "し、 可能な限りユーザインターフェースが一貫したものになるようにすることが重要"
16114 #: build/C/man7/symlink.7:87
16116 msgid "Symbolic link ownership, permissions, and timestamps"
16117 msgstr "シンボリックリンクの所有権、アクセス許可、タイムスタンプ"
16119 #. type: Plain text
16120 #: build/C/man7/symlink.7:95
16122 "The owner and group of an existing symbolic link can be changed using "
16123 "B<lchown>(2). The only time that the ownership of a symbolic link matters "
16124 "is when the link is being removed or renamed in a directory that has the "
16125 "sticky bit set (see B<stat>(2))."
16127 "既存のシンボリックリンクの所有者とグループは B<lchown>(2) を使って変更するこ"
16128 "とができる。 シンボリックリンクの所有権が問題となる場面は、 スティッキービッ"
16129 "ト (B<stat>(2) 参照) がセットされたディレクトリで、 そのリンクの削除や名前の"
16130 "変更を行おうとしている場合だけである。"
16132 #. type: Plain text
16133 #: build/C/man7/symlink.7:101
16135 "The last access and last modification timestamps of a symbolic link can be "
16136 "changed using B<utimensat>(2) or B<lutimes>(3)."
16138 "シンボリックリンクの最終アクセス時刻と最終修正時刻は B<utimensat>(2) や "
16139 "B<lutimes>(3) で変更できる。"
16141 #. Linux does not currently implement an lchmod(2).
16144 #. system differs from historical
16146 #. systems in that the system call
16148 #. has been changed to follow symbolic links.
16151 #. system call was added later when the limitations of the new
16153 #. became apparent.
16154 #. type: Plain text
16155 #: build/C/man7/symlink.7:120
16157 "On Linux, the permissions of a symbolic link are not used in any operations; "
16158 "the permissions are always 0777 (read, write, and execute for all user "
16159 "categories), and can't be changed."
16161 "Linux では、シンボリックリンクのアクセス許可 (permission) はどの操作でも使用"
16162 "されない。 アクセス許可は常に 0777 (すべてのユーザカテゴリにおいて読み出し、"
16163 "書き込み、実行が可能) で、変更できない。"
16166 #: build/C/man7/symlink.7:120
16168 msgid "Obtaining a file descriptor that refers to a symbolic link"
16171 #. type: Plain text
16172 #: build/C/man7/symlink.7:138
16174 "Using the combination of the B<O_PATH> and B<O_NOFOLLOW> flags to "
16175 "B<open>(2) yields a file descriptor that can be passed as the I<dirfd> "
16176 "argument in system calls such as B<fstatat>(2), B<fchownat>(2), "
16177 "B<fchmodat>(2), B<linkat>(2), and B<readlinkat>(2), in order to operate on "
16178 "the symbolic link itself (rather than the file to which it refers)."
16180 "B<open>(2) に B<O_PATH> と B<O_NOFOLLOW> の両方のフラグを指定すると、ファイル"
16181 "ディスクリプターが得られる。このファイルディスクリプターは B<fstatat>(2), "
16182 "B<fchownat>(2), B<fchmodat>(2), B<linkat> (2), B<readlinkat>(2) などのシステ"
16183 "ムコールの I<dirfd> 引き数として渡して、 (シンボリックリンクが参照するファイ"
16184 "ルではなく) シンボリックリンク自身に対する操作を行うことができる。"
16186 #. type: Plain text
16187 #: build/C/man7/symlink.7:154
16189 "By default (i.e., if the B<AT_SYMLINK_FOLLOW> flag is not specified), if "
16190 "B<name_to_handle_at>(2) is applied to a symbolic link, it yields a handle "
16191 "for the symbolic link (rather than the file to which it refers). One can "
16192 "then obtain a file descriptor for the symbolic link (rather than the file to "
16193 "which it refers) by specifying the B<O_PATH> flag in a subsequent call to "
16194 "B<open_by_handle_at>(2). Again, that file descriptor can be used in the "
16195 "aforementioned system calls to operate on the symbolic link itself."
16199 #: build/C/man7/symlink.7:154
16201 msgid "Handling of symbolic links by system calls and commands"
16202 msgstr "システムコールやコマンドによるシンボリックリンクの取り扱い"
16204 #. type: Plain text
16205 #: build/C/man7/symlink.7:169
16207 "Symbolic links are handled either by operating on the link itself, or by "
16208 "operating on the object referred to by the link. In the latter case, an "
16209 "application or system call is said to I<follow> the link. Symbolic links "
16210 "may refer to other symbolic links, in which case the links are dereferenced "
16211 "until an object that is not a symbolic link is found, a symbolic link that "
16212 "refers to a file which does not exist is found, or a loop is detected. "
16213 "(Loop detection is done by placing an upper limit on the number of links "
16214 "that may be followed, and an error results if this limit is exceeded.)"
16217 #. type: Plain text
16218 #: build/C/man7/symlink.7:172
16220 "There are three separate areas that need to be discussed. They are as "
16222 msgstr "3 つの領域に分けて議論する必要がある。以下の 3 つである。"
16225 #: build/C/man7/symlink.7:172
16230 #. type: Plain text
16231 #: build/C/man7/symlink.7:174
16232 msgid "Symbolic links used as filename arguments for system calls."
16234 "システムコールのファイル名引き数としてシンボリックリンクが使用される場合。"
16237 #: build/C/man7/symlink.7:174
16242 #. type: Plain text
16243 #: build/C/man7/symlink.7:177
16245 "Symbolic links specified as command-line arguments to utilities that are not "
16246 "traversing a file tree."
16248 "ファイルツリーを辿っていないユーティリティのコマンドライン引き数としてシンボ"
16252 #: build/C/man7/symlink.7:177
16257 #. type: Plain text
16258 #: build/C/man7/symlink.7:181
16260 "Symbolic links encountered by utilities that are traversing a file tree "
16261 "(either specified on the command line or encountered as part of the file "
16264 "ファイルツリーを辿っているユーティリティがシンボリックリンクを見つけた場合 "
16265 "(コマンドラインで指定される場合もあれば、 ファイル階層を辿っている途中で遭遇"
16269 #: build/C/man7/symlink.7:181
16271 msgid "System calls"
16274 #. type: Plain text
16275 #: build/C/man7/symlink.7:184
16277 "The first area is symbolic links used as filename arguments for system calls."
16279 "最初の領域は、システムコールのファイル名引き数としてシンボリックリンクが使用"
16282 #. type: Plain text
16283 #: build/C/man7/symlink.7:194
16285 "Except as noted below, all system calls follow symbolic links. For example, "
16286 "if there were a symbolic link I<slink> which pointed to a file named "
16287 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
16288 "descriptor referring to the file I<afile>."
16290 "以下に述べる場合を除くと、 すべてのシステムコールはシンボリックリンクを辿"
16291 "る。 例えば、 I<afile> という名前のファイルを指しているシンボリックリンク "
16292 "I<slink> があったとすると、 システムコール I<open(\"slink\" ...\\&)> はファイ"
16293 "ル I<afile> を参照するファイルディスクリプタを返す。"
16295 #. type: Plain text
16296 #: build/C/man7/symlink.7:209
16298 "Various system calls do not follow links, and operate on the symbolic link "
16299 "itself. They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
16300 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
16301 "B<rename>(2), B<rmdir>(2), and B<unlink>(2)."
16304 #. Maybe one day: .BR fchownat (2)
16305 #. type: Plain text
16306 #: build/C/man7/symlink.7:233
16308 "Certain other system calls optionally follow symbolic links. They are: "
16309 "B<faccessat>(2), B<fchownat>(2), B<fstatat>(2), B<linkat>(2), "
16310 "B<name_to_handle_at>(2), B<open>(2), B<openat>(2), B<open_by_handle_at>(2), "
16311 "and B<utimensat>(2); see their manual pages for details. Because "
16312 "B<remove>(3) is an alias for B<unlink>(2), that library function also does "
16313 "not follow symbolic links. When B<rmdir>(2) is applied to a symbolic link, "
16314 "it fails with the error B<ENOTDIR>."
16317 #. type: Plain text
16318 #: build/C/man7/symlink.7:248
16320 "The B<link>(2) warrants special discussion. POSIX.1-2001 specifies that "
16321 "B<link>(2) should dereference I<oldpath> if it is a symbolic link. "
16322 "However, Linux does not do this. (By default Solaris is the same, but the "
16323 "POSIX.1-2001 specified behavior can be obtained with suitable compiler "
16324 "options.) The upcoming POSIX.1 revision changes the specification to allow "
16325 "either behavior in an implementation."
16329 #: build/C/man7/symlink.7:248
16331 msgid "Commands not traversing a file tree"
16332 msgstr "ファイルツリーを辿らないコマンド"
16334 #. type: Plain text
16335 #: build/C/man7/symlink.7:251
16337 "The second area is symbolic links, specified as command-line filename "
16338 "arguments, to commands which are not traversing a file tree."
16340 "二つ目の領域は、ファイルツリーを辿らないコマンドの、コマンドライン引き数の"
16341 "ファイル名としてシンボリックリンクが指定される場合である。"
16343 #. type: Plain text
16344 #: build/C/man7/symlink.7:262
16346 "Except as noted below, commands follow symbolic links named as command-line "
16347 "arguments. For example, if there were a symbolic link I<slink> which "
16348 "pointed to a file named I<afile>, the command I<cat slink> would display the "
16349 "contents of the file I<afile>."
16351 "以下に述べる場合を除くと、 コマンドはコマンドライン引き数で指定された名前のシ"
16352 "ンボリックリンクを辿る。 例えば、 I<afile> という名前のファイルを指しているシ"
16353 "ンボリックリンク I<slink> があったとすると、 コマンド I<cat slink> は "
16354 "I<afile> の内容を表示することになる。"
16356 #. type: Plain text
16357 #: build/C/man7/symlink.7:270
16359 "It is important to realize that this rule includes commands which may "
16360 "optionally traverse file trees; for example, the command I<chown file> is "
16361 "included in this rule, while the command I<chown\\ -R file>, which performs "
16362 "a tree traversal, is not. (The latter is described in the third area, "
16366 #. type: Plain text
16367 #: build/C/man7/symlink.7:288
16369 "If it is explicitly intended that the command operate on the symbolic link "
16370 "instead of following the symbolic link\\(emfor example, it is desired that "
16371 "I<chown slink> change the ownership of the file that I<slink> is, whether it "
16372 "is a symbolic link or not\\(emthe I<-h> option should be used. In the above "
16373 "example, I<chown root slink> would change the ownership of the file referred "
16374 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
16378 #. type: Plain text
16379 #: build/C/man7/symlink.7:290
16380 msgid "There are some exceptions to this rule:"
16381 msgstr "このルールにはいくつかの例外がある。"
16383 #. type: Plain text
16384 #: build/C/man7/symlink.7:300
16386 "The B<mv>(1) and B<rm>(1) commands do not follow symbolic links named as "
16387 "arguments, but respectively attempt to rename and delete them. (Note, if "
16388 "the symbolic link references a file via a relative path, moving it to "
16389 "another directory may very well cause it to stop working, since the path may "
16390 "no longer be correct.)"
16392 "コマンド B<mv>(1) と B<rm>(1) は引き数で指定された名前のシンボリックリンクを"
16393 "辿らないが、 それぞれシンボリックリンク自身の名前変更と削除を行おうとする。 "
16394 "(シンボリックリンクが相対パスでファイルを参照している場合、 そのシンボリック"
16395 "リンクを別のディレクトリに移動すると、動かなくなることが非常によくある。 移動"
16396 "の結果、 パスが正しくないものになってしまうからである。)"
16398 #. type: Plain text
16399 #: build/C/man7/symlink.7:330
16401 "The B<ls>(1) command is also an exception to this rule. For compatibility "
16402 "with historic systems (when B<ls>(1) is not doing a tree walk\\(emthat is, "
16403 "I<-R> option is not specified), the B<ls>(1) command follows symbolic links "
16404 "named as arguments if the I<-H> or I<-L> option is specified, or if the I<-"
16405 "F>, I<-d>, or I<-l> options are not specified. (The B<ls>(1) command is "
16406 "the only command where the I<-H> and I<-L> options affect its behavior even "
16407 "though it is not doing a walk of a file tree.)"
16410 #. The 4.4BSD system differs from historical 4BSD systems in that the
16414 #. commands follow symbolic links specified on the command line.
16415 #. type: Plain text
16416 #: build/C/man7/symlink.7:348
16418 "The B<file>(1) command is also an exception to this rule. The B<file>(1) "
16419 "command does not follow symbolic links named as argument by default. The "
16420 "B<file>(1) command does follow symbolic links named as argument if the I<-"
16421 "L> option is specified."
16425 #: build/C/man7/symlink.7:348
16427 msgid "Commands traversing a file tree"
16428 msgstr "ファイルツリーを辿るコマンド"
16430 #. type: Plain text
16431 #: build/C/man7/symlink.7:361
16433 "The following commands either optionally or always traverse file trees: "
16434 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
16435 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
16438 #. type: Plain text
16439 #: build/C/man7/symlink.7:365
16441 "It is important to realize that the following rules apply equally to "
16442 "symbolic links encountered during the file tree traversal and symbolic links "
16443 "listed as command-line arguments."
16446 #. type: Plain text
16447 #: build/C/man7/symlink.7:370
16449 "The I<first rule> applies to symbolic links that reference files other than "
16450 "directories. Operations that apply to symbolic links are performed on the "
16451 "links themselves, but otherwise the links are ignored."
16454 #. type: Plain text
16455 #: build/C/man7/symlink.7:382
16457 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
16458 "symbolic links encountered in the tree traversal of I<directory>, because "
16459 "symbolic links may be removed. In no case will B<rm>(1) affect the file "
16460 "referred to by I<slink>."
16463 #. type: Plain text
16464 #: build/C/man7/symlink.7:387
16466 "The I<second rule> applies to symbolic links that refer to directories. "
16467 "Symbolic links that refer to directories are never followed by default. "
16468 "This is often referred to as a \"physical\" walk, as opposed to a \"logical"
16469 "\" walk (where symbolic links the refer to directories are followed)."
16472 #. type: Plain text
16473 #: build/C/man7/symlink.7:390
16475 "Certain conventions are (should be) followed as consistently as possible by "
16476 "commands that perform file tree walks:"
16479 #. type: Plain text
16480 #: build/C/man7/symlink.7:403
16482 "A command can be made to follow any symbolic links named on the command "
16483 "line, regardless of the type of file they reference, by specifying the I<-H> "
16484 "(for \"half-logical\") flag. This flag is intended to make the command-line "
16485 "name space look like the logical name space. (Note, for commands that do "
16486 "not always do file tree traversals, the I<-H> flag will be ignored if the I<-"
16487 "R> flag is not also specified.)"
16490 #. type: Plain text
16491 #: build/C/man7/symlink.7:419
16493 "For example, the command I<chown\\ -HR user slink> will traverse the file "
16494 "hierarchy rooted in the file pointed to by I<slink>. Note, the I<-H> is not "
16495 "the same as the previously discussed I<-h> flag. The I<-H> flag causes "
16496 "symbolic links specified on the command line to be dereferenced for the "
16497 "purposes of both the action to be performed and the tree walk, and it is as "
16498 "if the user had specified the name of the file to which the symbolic link "
16502 #. type: Plain text
16503 #: build/C/man7/symlink.7:433
16505 "A command can be made to follow any symbolic links named on the command "
16506 "line, as well as any symbolic links encountered during the traversal, "
16507 "regardless of the type of file they reference, by specifying the I<-L> (for "
16508 "\"logical\") flag. This flag is intended to make the entire name space look "
16509 "like the logical name space. (Note, for commands that do not always do file "
16510 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
16514 #. type: Plain text
16515 #: build/C/man7/symlink.7:448
16517 "For example, the command I<chown\\ -LR user slink> will change the owner of "
16518 "the file referred to by I<slink>. If I<slink> refers to a directory, "
16519 "B<chown> will traverse the file hierarchy rooted in the directory that it "
16520 "references. In addition, if any symbolic links are encountered in any file "
16521 "tree that B<chown> traverses, they will be treated in the same fashion as "
16525 #. type: Plain text
16526 #: build/C/man7/symlink.7:455
16528 "A command can be made to provide the default behavior by specifying the I<-"
16529 "P> (for \"physical\") flag. This flag is intended to make the entire name "
16530 "space look like the physical name space."
16533 #. type: Plain text
16534 #: build/C/man7/symlink.7:473
16536 "For commands that do not by default do file tree traversals, the I<-H>, I<-"
16537 "L>, and I<-P> flags are ignored if the I<-R> flag is not also specified. In "
16538 "addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
16539 "once; the last one specified determines the command's behavior. This is "
16540 "intended to permit you to alias commands to behave one way or the other, and "
16541 "then override that behavior on the command line."
16544 #. type: Plain text
16545 #: build/C/man7/symlink.7:479
16546 msgid "The B<ls>(1) and B<rm>(1) commands have exceptions to these rules:"
16548 "コマンド B<ls>(1) と B<rm>(1) には、 これらのルールに対する例外がある。"
16550 #. type: Plain text
16551 #: build/C/man7/symlink.7:492
16553 "The B<rm>(1) command operates on the symbolic link, and not the file it "
16554 "references, and therefore never follows a symbolic link. The B<rm>(1) "
16555 "command does not support the I<-H>, I<-L>, or I<-P> options."
16557 "B<rm>(1) コマンドは、 参照先のファイルではなく、シンボリックリンクに対して操"
16558 "作を行う。 したがって、 シンボリックリンクを辿ることはない。 B<rm>(1) コマン"
16559 "ドはオプション I<-H>, I<-L>, I<-P> をサポートしていない。"
16561 #. type: Plain text
16562 #: build/C/man7/symlink.7:512
16564 "To maintain compatibility with historic systems, the B<ls>(1) command acts "
16565 "a little differently. If you do not specify the I<-F>, I<-d> or I<-l> "
16566 "options, B<ls>(1) will follow symbolic links specified on the command "
16567 "line. If the I<-L> flag is specified, B<ls>(1) follows all symbolic links, "
16568 "regardless of their type, whether specified on the command line or "
16569 "encountered in the tree walk."
16572 #. type: Plain text
16573 #: build/C/man7/symlink.7:530
16575 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
16576 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
16577 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
16578 "B<path_resolution>(7)"
16580 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1),\n"
16581 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2),\n"
16582 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2),\n"
16583 "B<lutimes>(3), B<path_resolution>(7)"
16586 #: build/C/man3/tempnam.3:25
16592 #: build/C/man3/tempnam.3:25 build/C/man3/tmpnam.3:27
16595 msgstr "2014-02-27"
16597 #. type: Plain text
16598 #: build/C/man3/tempnam.3:28
16599 msgid "tempnam - create a name for a temporary file"
16600 msgstr "tempnam - テンポラリファイルの名前を作成する"
16602 #. type: Plain text
16603 #: build/C/man3/tempnam.3:33
16605 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
16606 msgstr "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
16608 #. type: Plain text
16609 #: build/C/man3/tempnam.3:42
16610 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
16611 msgstr "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
16613 #. type: Plain text
16614 #: build/C/man3/tempnam.3:49
16616 "I<Never use this function.> Use B<mkstemp>(3) or B<tmpfile>(3) instead."
16618 "I<決してこの関数を使用しないこと。> 代わりに B<mkstemp>(3) か B<tmpfile>(3) "
16621 #. type: Plain text
16622 #: build/C/man3/tempnam.3:63
16624 "The B<tempnam>() function returns a pointer to a string that is a valid "
16625 "filename, and such that a file with this name did not exist when "
16626 "B<tempnam>() checked. The filename suffix of the pathname generated will "
16627 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
16628 "bytes. The directory prefix part of the pathname generated is required to "
16629 "be \"appropriate\" (often that at least implies writable)."
16631 "B<tempnam>() 関数はファイル名として正しい文字列へのポインタを返す。 このファ"
16632 "イル名を持つファイルは、 B<tempnam>() がチェックした時点においては存在しな"
16633 "い (しなかった)。 I<pfx> が NULL でない 5 バイト以内の文字列であれば、 生成さ"
16634 "れるパス名のうちのファイル名の部分は I<pfx> から始まるものになる。 生成される"
16635 "ディレクトリの部分は、「適切」でなければならない (大抵の場合、「適切」である"
16636 "ためにはまず少なくとも 書き込み可能でなければならない)。"
16638 #. type: Plain text
16639 #: build/C/man3/tempnam.3:66
16641 "Attempts to find an appropriate directory go through the following steps:"
16642 msgstr "適切なディレクトリの探索は、以下の手順にしたがって行われる。"
16645 #: build/C/man3/tempnam.3:66
16650 #. type: Plain text
16651 #: build/C/man3/tempnam.3:72
16653 "In case the environment variable B<TMPDIR> exists and contains the name of "
16654 "an appropriate directory, that is used."
16656 "環境変数 B<TMPDIR> が設定されていて、 その内容が適切なディレクトリの名前な"
16660 #: build/C/man3/tempnam.3:72
16665 #. type: Plain text
16666 #: build/C/man3/tempnam.3:77
16668 "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
16670 "それ以外の場合、 I<dir> 引き数が NULL でない文字列でかつ適切なら、それを用い"
16674 #: build/C/man3/tempnam.3:77
16679 #. type: Plain text
16680 #: build/C/man3/tempnam.3:84
16682 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>) is used when "
16685 "それ以外の場合、 (I<E<lt>stdio.hE<gt>> で定義されている) I<P_tmpdir> が適切"
16689 #: build/C/man3/tempnam.3:84
16694 #. type: Plain text
16695 #: build/C/man3/tempnam.3:87
16696 msgid "Finally an implementation-defined directory may be used."
16697 msgstr "最後に実装で定義されたディレクトリが用いられることになる。"
16699 #. type: Plain text
16700 #: build/C/man3/tempnam.3:94
16702 "The string returned by B<tempnam>() is allocated using B<malloc>(3) and "
16703 "hence should be freed by B<free>(3)."
16705 "B<tempnam>() が返す文字列は B<malloc>(3) を使って確保される。そのため、 "
16706 "B<free>(3) で解放すべきである。"
16708 #. type: Plain text
16709 #: build/C/man3/tempnam.3:101
16711 "On success, the B<tempnam>() function returns a pointer to a unique "
16712 "temporary filename. It returns NULL if a unique name cannot be generated, "
16713 "with I<errno> set to indicate the cause of the error."
16715 "成功すると B<tempnam>() 関数は、一意なテンポラリファイル名へのポインタを返"
16716 "す。 一意な名前が生成できなければ NULL を返し、 I<errno> にエラーの原因を示す"
16719 #. type: Plain text
16720 #: build/C/man3/tempnam.3:105
16721 msgid "Allocation of storage failed."
16722 msgstr "保存領域の割り当てに失敗した。"
16724 #. type: Plain text
16725 #: build/C/man3/tempnam.3:110
16727 "SVr4, 4.3BSD, POSIX.1-2001. POSIX.1-2008 marks B<tempnam>() as obsolete."
16729 "SVr4, 4.3BSD, POSIX.1-2001. POSIX.1-2008 は B<tempnam>() を廃止予定としてい"
16732 #. type: Plain text
16733 #: build/C/man3/tempnam.3:129
16735 "Although B<tempnam>() generates names that are difficult to guess, it is "
16736 "nevertheless possible that between the time that B<tempnam>() returns a "
16737 "pathname, and the time that the program opens it, another program might "
16738 "create that pathname using B<open>(2), or create it as a symbolic link. "
16739 "This can lead to security holes. To avoid such possibilities, use the "
16740 "B<open>(2) B<O_EXCL> flag to open the pathname. Or better yet, use "
16741 "B<mkstemp>(3) or B<tmpfile>(3)."
16743 "B<tempnam>() は推測が難しい名前を生成するが、それにもかかわらず、 "
16744 "B<tempnam>() がパス名を返してから、プログラムがそのファイルをオープンする ま"
16745 "での間に、別のプログラムが同じパス名で、ファイルを B<open>(2) で作成したり、"
16746 "シンボリックリンクを作成したりする可能性がある。 これはセキュリティホールにつ"
16747 "ながる可能性がある。 そのような可能性を回避するためには、 B<open>(2) の "
16748 "B<O_EXCL> フラグを使ってパス名をオープンすればよい。 もっといいのは、 "
16749 "B<mkstemp>(3) や B<tmpfile>(3) を使うことである。"
16751 #. type: Plain text
16752 #: build/C/man3/tempnam.3:137
16754 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
16755 "program is not set-user-ID. On SVr4, the directory used under B<d)> is I</"
16756 "tmp> (and this is what glibc does)."
16758 "SUSv2 では B<TMPDIR> に付いて言及されていない。 glibc は、プログラムが set-"
16759 "user-ID されていない場合に限ってこれを用いる。 SVr4 では B<d)> で使用される"
16760 "ディレクトリを I</tmp> と定めている (glibc もこの通りである)。"
16762 #. type: Plain text
16763 #: build/C/man3/tempnam.3:142
16765 "Because it dynamically allocates memory used to return the pathname, "
16766 "B<tempnam>() is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
16768 "パス名を返すのに使用するメモリを動的に確保するので、 B<tmpnam>(3) と違い、 "
16769 "B<tempnam>() はリエントラントであり、スレッドセーフである。"
16771 #. type: Plain text
16772 #: build/C/man3/tempnam.3:155
16774 "The B<tempnam>() function generates a different string each time it is "
16775 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>) times. If it is "
16776 "called more than B<TMP_MAX> times, the behavior is implementation defined."
16778 "B<tempnam>() 関数は最大 B<TMP_MAX> 回まで、呼び出される度に異なる文字列を作"
16779 "成する (B<TMP_MAX> は I<E<lt>stdio.hE<gt>> で定義されている)。 もし "
16780 "B<TMP_MAX> 回以上呼び出された場合、動作は実装依存である。"
16782 #. type: Plain text
16783 #: build/C/man3/tempnam.3:159
16784 msgid "B<tempnam>() uses at most the first five bytes from I<pfx>."
16785 msgstr "B<tempnam>() は最大で I<pfx> の先頭 5 バイトを使用する。"
16787 #. type: Plain text
16788 #: build/C/man3/tempnam.3:165
16790 "The glibc implementation of B<tempnam>() will fail with the error B<EEXIST> "
16791 "upon failure to find a unique name."
16793 "他と重ならない名前が見つけられなかった場合、glibc の B<tempnam>() の実装はエ"
16794 "ラー B<EEXIST> で失敗する。"
16796 #. type: Plain text
16797 #: build/C/man3/tempnam.3:168
16799 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
16800 "accessibility of a directory is determined."
16802 "「適切」という言葉の正確な意味は定義されていない。 ディレクトリに対してどの程"
16803 "度のアクセス権限が必要なのかは指定されていない。"
16805 #. type: Plain text
16806 #: build/C/man3/tempnam.3:173
16807 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
16808 msgstr "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
16811 #: build/C/man3/tmpfile.3:31
16816 #. type: Plain text
16817 #: build/C/man3/tmpfile.3:34
16818 msgid "tmpfile - create a temporary file"
16819 msgstr "tmpfile - テンポラリファイルを作成する"
16821 #. type: Plain text
16822 #: build/C/man3/tmpfile.3:39
16824 msgid "B<FILE *tmpfile(void);>\n"
16825 msgstr "B<FILE *tmpfile(void);>\n"
16827 #. type: Plain text
16828 #: build/C/man3/tmpfile.3:47
16830 "The B<tmpfile>() function opens a unique temporary file in binary read/"
16831 "write (w+b) mode. The file will be automatically deleted when it is closed "
16832 "or the program terminates."
16834 "B<tmpfile>() 関数はユニークなテンポラリファイルを バイナリリードライトモー"
16835 "ド (w+b) でオープンする。 このファイルはクローズ時またはプログラムの終了時に"
16838 #. type: Plain text
16839 #: build/C/man3/tmpfile.3:56
16841 "The B<tmpfile>() function returns a stream descriptor, or NULL if a unique "
16842 "filename cannot be generated or the unique file cannot be opened. In the "
16843 "latter case, I<errno> is set to indicate the error."
16845 "B<tmpfile>() 関数はファイルポインタを返すか、 ユニークなファイルが作れなかっ"
16846 "たかオープンできなかった場合は NULL を返す。 後者の場合、エラーを表す "
16849 #. type: Plain text
16850 #: build/C/man3/tmpfile.3:60
16851 msgid "Search permission denied for directory in file's path prefix."
16853 "ファイルのあるディレクトリにサーチのアクセス権 (search permission) がない。"
16855 #. type: Plain text
16856 #: build/C/man3/tmpfile.3:63
16857 msgid "Unable to generate a unique filename."
16858 msgstr "ユニークなファイル名が作成できなかった。"
16860 #. type: Plain text
16861 #: build/C/man3/tmpfile.3:66
16862 msgid "The call was interrupted by a signal."
16863 msgstr "呼び出しがシグナルによって中断された。"
16865 #. type: Plain text
16866 #: build/C/man3/tmpfile.3:69
16867 msgid "Too many file descriptors in use by the process."
16868 msgstr "1 つのプロセスで使用可能なファイルディスクリプタ数を超過した。"
16870 #. type: Plain text
16871 #: build/C/man3/tmpfile.3:72
16872 msgid "Too many files open in the system."
16873 msgstr "システム全体でオープン可能なファイル数を超過した。"
16875 #. type: Plain text
16876 #: build/C/man3/tmpfile.3:75
16877 msgid "There was no room in the directory to add the new filename."
16878 msgstr "ディレクトリに新しいファイルを追加するための空き領域がない。"
16880 #. type: Plain text
16881 #: build/C/man3/tmpfile.3:78
16882 msgid "Read-only filesystem."
16883 msgstr "読みだし専用ファイルシステムである。"
16885 #. type: Plain text
16886 #: build/C/man3/tmpfile.3:80
16887 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
16888 msgstr "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
16890 #. type: Plain text
16891 #: build/C/man3/tmpfile.3:86
16893 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
16894 "stream cannot be opened."
16896 "POSIX.1-2001 では、 ストリームをオープンできなかった場合、 I<stdout> にエラー"
16897 "メッセージが書き出される、と規定されている。"
16899 #. type: Plain text
16900 #: build/C/man3/tmpfile.3:97
16902 "The standard does not specify the directory that B<tmpfile>() will use. "
16903 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
16904 "and if that fails the directory I</tmp>."
16906 "規格では B<tmpfile>() が使うディレクトリは指定されていない。 glibc では "
16907 "I<E<lt>stdio.hE<gt>> で定義されている I<P_tmpdir> をパスの先頭に使おうとす"
16908 "る。 これが失敗した場合は、ディレクトリ I</tmp> を使う。"
16910 #. type: Plain text
16911 #: build/C/man3/tmpfile.3:103
16912 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
16913 msgstr "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
16916 #: build/C/man3/tmpnam.3:27
16921 #. type: Plain text
16922 #: build/C/man3/tmpnam.3:30
16923 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
16924 msgstr "tmpnam, tmpnam_r - 一時ファイルの名前を作成する"
16926 #. type: Plain text
16927 #: build/C/man3/tmpnam.3:35
16929 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
16930 msgstr "B<char *tmpnam(char *>I<s>B<);>\n"
16932 #. type: Plain text
16933 #: build/C/man3/tmpnam.3:45
16935 "B<Note:> Avoid use of B<tmpnam>(); use B<mkstemp>(3) or B<tmpfile>(3) "
16938 "B<注意:> B<tmpnam>() の使用は避けること。代わりに B<mkstemp>(3) か "
16939 "B<tmpfile>(3) を使うこと。"
16941 #. type: Plain text
16942 #: build/C/man3/tmpnam.3:67
16944 "The B<tmpnam>() function returns a pointer to a string that is a valid "
16945 "filename, and such that a file with this name did not exist at some point in "
16946 "time, so that naive programmers may think it a suitable name for a temporary "
16947 "file. If the argument I<s> is NULL, this name is generated in an internal "
16948 "static buffer and may be overwritten by the next call to B<tmpnam>(). If "
16949 "I<s> is not NULL, the name is copied to the character array (of length at "
16950 "least I<L_tmpnam>) pointed to by I<s> and the value I<s> is returned in "
16953 "B<tmpnam>() 関数は、ファイル名に使える文字列へのポインタを返す。 ある時点で"
16954 "は同じ名前を持つファイルが存在しないファイル名が返されるので、 幼稚なプログラ"
16955 "マはこの文字列が一時ファイルのファイル名として 適していると考えるかもしれな"
16956 "い。 引き数 I<s> が NULL なら、この名前は内部の静的バッファに作成され、 次に "
16957 "B<tmpnam>() 関数が呼び出された時に上書きされる。 I<s> が NULL でなければ、"
16958 "ファイル名は I<s> が指す (少なくとも I<L_tmpnam> の長さを持つ) 文字配列にコ"
16959 "ピーされ、 成功した場合は I<s> が返される。"
16961 #. type: Plain text
16962 #: build/C/man3/tmpnam.3:79
16964 "The pathname that is created, has a directory prefix I<P_tmpdir>. (Both "
16965 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
16966 "the B<TMP_MAX> mentioned below.)"
16968 "作成されるパス名は、ディレクトリの部分に I<P_tmpdir> が使われる。 "
16969 "(I<L_tmpnam> と I<P_tmpdir> は、以下で説明する B<TMP_MAX> 同様 I<E<lt>stdio."
16970 "hE<gt>> で定義されている。)"
16972 #. type: Plain text
16973 #: build/C/man3/tmpnam.3:84
16975 "The B<tmpnam>() function returns a pointer to a unique temporary filename, "
16976 "or NULL if a unique name cannot be generated."
16978 "B<tmpnam>() 関数は一意な一時ファイル名へのポインタを返す。 一意なファイル名"
16979 "が作成できなかった場合は NULL を返す。"
16981 #. type: Plain text
16982 #: build/C/man3/tmpnam.3:86
16983 msgid "No errors are defined."
16984 msgstr "エラーは定義されていない。"
16986 #. type: Plain text
16987 #: build/C/man3/tmpnam.3:92
16989 "The B<tmpnam>() function is thread-safe with exceptions. It is not thread-"
16990 "safe if called with a NULL parameter."
16992 "B<tmpnam>() 関数は例外付きでスレッドセーフである。 NULL パラメータで呼び出さ"
16993 "れた場合はスレッドセーフではない。"
16995 #. type: Plain text
16996 #: build/C/man3/tmpnam.3:96
16997 msgid "The B<tmpnam_r>() function is thread-safe."
16998 msgstr "B<tmpnam_r>() 関数はスレッドセーフである。"
17000 #. type: Plain text
17001 #: build/C/man3/tmpnam.3:101
17003 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001. POSIX.1-2008 marks B<tmpnam>() as "
17006 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001. POSIX.1-2008 は B<tmpnam>() を廃止予"
17009 #. type: Plain text
17010 #: build/C/man3/tmpnam.3:112
17012 "The B<tmpnam>() function generates a different string each time it is "
17013 "called, up to B<TMP_MAX> times. If it is called more than B<TMP_MAX> times, "
17014 "the behavior is implementation defined."
17016 "B<tmpnam>() 関数は最大 B<TMP_MAX> 回まで、呼び出される度に異なる文字列を作成"
17017 "する。 B<TMP_MAX> 回以上呼び出された場合、その動作は実装依存である。"
17019 #. type: Plain text
17020 #: build/C/man3/tmpnam.3:131
17022 "Although B<tmpnam>() generates names that are difficult to guess, it is "
17023 "nevertheless possible that between the time that B<tmpnam>() returns a "
17024 "pathname, and the time that the program opens it, another program might "
17025 "create that pathname using B<open>(2), or create it as a symbolic link. "
17026 "This can lead to security holes. To avoid such possibilities, use the "
17027 "B<open>(2) B<O_EXCL> flag to open the pathname. Or better yet, use "
17028 "B<mkstemp>(3) or B<tmpfile>(3)."
17030 "B<tmpnam>() は推測が難しい名前を生成するが、それにもかかわらず、 "
17031 "B<tmpnam>() がパス名を返してから、プログラムがそのファイルをオープンする ま"
17032 "での間に、別のプログラムが同じパス名で、ファイルを B<open>(2) で作成したり、"
17033 "シンボリックリンクを作成したりする可能性がある。 これはセキュリティホールにつ"
17034 "ながる可能性がある。 そのような可能性を回避するためには、 B<open>(2) の "
17035 "B<O_EXCL> フラグを使ってパス名をオープンすればよい。 もっといいのは、 "
17036 "B<mkstemp>(3) や B<tmpfile>(3) を使うことである。"
17038 #. type: Plain text
17039 #: build/C/man3/tmpnam.3:139
17041 "Portable applications that use threads cannot call B<tmpnam>() with a NULL "
17042 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
17045 "移植性が必要な、スレッドを使ったアプリケーションでは、 B<_POSIX_THREADS> か "
17046 "B<_POSIX_THREAD_SAFE_FUNCTIONS> が定義されている場合に、 B<tmpnam>() 関数を "
17047 "NULL 引き数で呼び出してはならない。"
17049 #. type: Plain text
17050 #: build/C/man3/tmpnam.3:143
17051 msgid "A POSIX draft proposed to use a function B<tmpnam_r>() defined by"
17053 "POSIX 草案では、関数 B<tmpnam_r>() を使うことを提案している。 この関数は、以"
17054 "下のように定義されており、 NULL を使わないようにという警告の意味で NULL を別"
17057 #. type: Plain text
17058 #: build/C/man3/tmpnam.3:151
17062 "tmpnam_r(char *s)\n"
17064 " return s ? tmpnam(s) : NULL;\n"
17068 "tmpnam_r(char *s)\n"
17070 " return s ? tmpnam(s) : NULL;\n"
17073 #. type: Plain text
17074 #: build/C/man3/tmpnam.3:165
17076 "apparently as a warning not to use NULL. A few systems implement it. To "
17077 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
17078 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
17080 "数は少ないが、この関数を実装しているシステムもある。 この関数の glibc のプロ"
17081 "トタイプを I<E<lt>stdio.hE<gt>> から得るには、 (「どの」ヘッダファイルをイン"
17082 "クルードするよりも前に) B<_SVID_SOURCE> か B<_BSD_SOURCE> を定義しておく必要"
17085 #. type: Plain text
17086 #: build/C/man3/tmpnam.3:172
17087 msgid "Never use this function. Use B<mkstemp>(3) or B<tmpfile>(3) instead."
17089 "決してこの関数を使ってはならない。代わりに B<mkstemp>(3) か B<tmpfile>(3) "
17092 #. type: Plain text
17093 #: build/C/man3/tmpnam.3:177
17094 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
17095 msgstr "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
17098 #: build/C/man2/unlink.2:33
17104 #: build/C/man2/unlink.2:33
17107 msgstr "2014-02-21"
17109 #. type: Plain text
17110 #: build/C/man2/unlink.2:36
17111 msgid "unlink, unlinkat - delete a name and possibly the file it refers to"
17113 "unlink, unlinkat - 名前を削除し、場合によってはそれが参照しているファイルも削"
17116 #. type: Plain text
17117 #: build/C/man2/unlink.2:41
17119 msgid "B<int unlink(const char *>I<pathname>B<);>\n"
17120 msgstr "B<int unlink(const char *>I<pathname>B<);>\n"
17122 #. type: Plain text
17123 #: build/C/man2/unlink.2:46
17125 msgid "B<int unlinkat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<);>\n"
17126 msgstr "B<int unlinkat(int >I<dirfd>B<, const char *>I<pathname>B<, int >I<flags>B<);>\n"
17128 #. type: Plain text
17129 #: build/C/man2/unlink.2:54
17130 msgid "B<unlinkat>():"
17131 msgstr "B<unlinkat>():"
17133 #. type: Plain text
17134 #: build/C/man2/unlink.2:72
17136 "B<unlink>() deletes a name from the filesystem. If that name was the last "
17137 "link to a file and no processes have the file open, the file is deleted and "
17138 "the space it was using is made available for reuse."
17140 "B<unlink>() はファイルシステム上の名前を削除する。 もしその名前がファイルへ"
17141 "の最後のリンク (link) であり、 どのプロセスもそのファイルをオープン (open) し"
17142 "ていなければ、 ファイルは削除される。 ファイルが使用していたディスク上の領域"
17145 #. type: Plain text
17146 #: build/C/man2/unlink.2:76
17148 "If the name was the last link to a file but any processes still have the "
17149 "file open, the file will remain in existence until the last file descriptor "
17150 "referring to it is closed."
17152 "名前がファイルへの最後のリンクであっても、どこかのプロセスが そのファイルを開"
17153 "いているなら、ファイルの最後のファイル記述子 (file descriptor) が閉じられるま"
17156 #. type: Plain text
17157 #: build/C/man2/unlink.2:82
17159 "If the name referred to a socket, FIFO, or device, the name for it is "
17160 "removed but processes which have the object open may continue to use it."
17162 "名前が指しているのがソケット、FIFO、デバイスの場合、名前は削除されるが、 その"
17163 "ソケットなどを開いているプロセスはそのまま使い続けることができる。"
17166 #: build/C/man2/unlink.2:82
17169 msgstr "unlinkat()"
17171 #. type: Plain text
17172 #: build/C/man2/unlink.2:95
17174 "The B<unlinkat>() system call operates in exactly the same way as either "
17175 "B<unlink>() or B<rmdir>(2) (depending on whether or not I<flags> includes "
17176 "the B<AT_REMOVEDIR> flag) except for the differences described here."
17178 "B<unlinkat>() システムコールは、B<unlink>() と B<rmdir>(2) のいずれかと全く同"
17179 "じ動作をする (どちらと同じになるかは I<flags> に B<AT_REMOVEDIR> フラグが指定"
17180 "されたかにより決まる) が、以下で説明する点が異なる。"
17182 #. type: Plain text
17183 #: build/C/man2/unlink.2:107
17185 "If the pathname given in I<pathname> is relative, then it is interpreted "
17186 "relative to the directory referred to by the file descriptor I<dirfd> "
17187 "(rather than relative to the current working directory of the calling "
17188 "process, as is done by B<unlink>() and B<rmdir>(2) for a relative "
17191 "I<pathname> で指定されたパス名が相対パスの場合、このパス名はファイルディスク"
17192 "リプター I<dirfd> が参照するディレクトリに対する相対パスと解釈される "
17193 "(B<unlink>() や B<rmdir>(2) に相対パス名を渡した場合のように、呼び出したプロ"
17194 "セスのカレントワーキングディレクトリに対する相対パスではない)。"
17196 #. type: Plain text
17197 #: build/C/man2/unlink.2:121
17199 "If the pathname given in I<pathname> is relative and I<dirfd> is the special "
17200 "value B<AT_FDCWD>, then I<pathname> is interpreted relative to the current "
17201 "working directory of the calling process (like B<unlink>() and B<rmdir>(2))."
17203 "I<pathname> で指定されたパス名が相対パスで、 I<dirfd> が特別な値 B<AT_FDCWD> "
17204 "の場合、 (B<unlink>() や B<rmdir>(2) と同様に) I<pathname> は呼び出したプロセ"
17205 "スのカレントワーキングディレクトリに対する相対パスと解釈される。"
17207 #. type: Plain text
17208 #: build/C/man2/unlink.2:127
17210 "If the pathname given in I<pathname> is absolute, then I<dirfd> is ignored."
17212 "I<pathname> で指定されたパス名が絶対パスの場合、 I<dirfd> は無視される。"
17214 #. type: Plain text
17215 #: build/C/man2/unlink.2:133
17217 "I<flags> is a bit mask that can either be specified as 0, or by ORing "
17218 "together flag values that control the operation of B<unlinkat>(). Currently "
17219 "only one such flag is defined:"
17221 "I<flags> はビットマスクで、0 もしくは B<unlinkat>() の動作を制御するフラグ値"
17222 "を論理和の形で指定することができる。現在のところ、定義されているフラグはひと"
17226 #: build/C/man2/unlink.2:133
17228 msgid "B<AT_REMOVEDIR>"
17229 msgstr "B<AT_REMOVEDIR>"
17231 #. type: Plain text
17232 #: build/C/man2/unlink.2:148
17234 "By default, B<unlinkat>() performs the equivalent of B<unlink>() on "
17235 "I<pathname>. If the B<AT_REMOVEDIR> flag is specified, then performs the "
17236 "equivalent of B<rmdir>(2) on I<pathname>."
17238 "デフォルトでは、 B<unlinkat>() は I<pathname> に対して B<unlink>() と等価な動"
17239 "作をする。 B<AT_REMOVEDIR> フラグが指定された場合、 I<pathname> に対して "
17240 "B<rmdir>(2) と等価な動作をする。"
17242 #. type: Plain text
17243 #: build/C/man2/unlink.2:153
17244 msgid "See B<openat>(2) for an explanation of the need for B<unlinkat>()."
17245 msgstr "B<unlinkat>() の必要性についての説明については B<openat>(2) を参照。"
17247 #. type: Plain text
17248 #: build/C/man2/unlink.2:169
17250 "Write access to the directory containing I<pathname> is not allowed for the "
17251 "process's effective UID, or one of the directories in I<pathname> did not "
17252 "allow search permission. (See also B<path_resolution>(7).)"
17254 "I<pathname> を含んでいるディレクトリの書き込み許可がプロセスの実効 "
17255 "(effective) ユーザー ID に与えられていないか、 I<pathname> の中のディレクト"
17256 "リのどれかに検索許可が与えられていない (B<path_resolution>(7) も参照するこ"
17259 #. type: Plain text
17260 #: build/C/man2/unlink.2:178
17262 "The file I<pathname> cannot be unlinked because it is being used by the "
17263 "system or another process; for example, it is a mount point or the NFS "
17264 "client software created it to represent an active but otherwise nameless "
17265 "inode (\"NFS silly renamed\")."
17267 "システムか別のプロセスがそのファイルを使用中のため、\n"
17268 "ファイル I<pathname> を unlink できない。\n"
17269 "例えば、そのファイルがマウントポイントの場合や、\n"
17270 "NFS クライアントソフトウェアがそのファイルがアクティブであるが\n"
17271 "名前なし inode (nameless inode) であることを示すために作成した\n"
17272 "場合 (\"NFS silly renamed\") などがある。"
17274 #. type: Plain text
17275 #: build/C/man2/unlink.2:190
17277 "I<pathname> refers to a directory. (This is the non-POSIX value returned by "
17278 "Linux since 2.1.132.)"
17280 "I<pathname> がディレクトリを参照している。 (これは POSIX で規定されていない値"
17281 "で、Linux 2.1.132 以降で返される。)"
17283 #. type: Plain text
17284 #: build/C/man2/unlink.2:194
17285 msgid "Too many symbolic links were encountered in translating I<pathname>."
17286 msgstr "I<pathname> を解決する際に遭遇したシンボリックリンクが多過ぎる。"
17288 #. type: Plain text
17289 #: build/C/man2/unlink.2:204
17291 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
17292 "I<pathname> is empty."
17294 "I<pathname> に対応するものが存在しないか、壊れたシンボリックリンクであるか、 "
17295 "I<pathname> が空である。"
17297 #. type: Plain text
17298 #: build/C/man2/unlink.2:212
17300 "A component used as a directory in I<pathname> is not, in fact, a directory."
17301 msgstr "I<pathname> のディレクトリ部分が、実際には、ディレクトリでない。"
17303 #. type: Plain text
17304 #: build/C/man2/unlink.2:221
17306 "The system does not allow unlinking of directories, or unlinking of "
17307 "directories requires privileges that the calling process doesn't have. "
17308 "(This is the POSIX prescribed error return; as noted above, Linux returns "
17309 "B<EISDIR> for this case.)"
17311 "システムがディレクトリに対する unlink 操作を許可していない。 またはディレクト"
17312 "リに対する unlink 操作のために必要な特権を 呼び出し元のプロセスが持っていな"
17313 "い。 (これは POSIX で規定されているエラーの返し方である。 上述の通り、この場"
17314 "合には Linux は B<EISDIR> を返す。)"
17317 #: build/C/man2/unlink.2:221
17319 msgid "B<EPERM> (Linux only)"
17320 msgstr "B<EPERM> (Linux のみ)"
17322 #. type: Plain text
17323 #: build/C/man2/unlink.2:224
17324 msgid "The filesystem does not allow unlinking of files."
17325 msgstr "ファイルシステムがファイルに対する unlink 操作を許していない。"
17327 #. type: Plain text
17328 #: build/C/man2/unlink.2:235
17330 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>) set "
17331 "and the process's effective UID is neither the UID of the file to be deleted "
17332 "nor that of the directory containing it, and the process is not privileged "
17333 "(Linux: does not have the B<CAP_FOWNER> capability)."
17335 "I<pathname> を含んでいるディレクトリにスティッキービット (sticky-bit) "
17336 "(B<S_ISVTX>) が設定されていて、プロセスの実効ユーザー ID が削除しようとする"
17337 "ファイルの UID でもそれを含んでいるディレクトリのものでもなく、 かつプロセス"
17338 "に特権がない (Linux では B<CAP_FOWNER> ケーパビリティ (capability) がない)。"
17340 #. type: Plain text
17341 #: build/C/man2/unlink.2:239
17342 msgid "I<pathname> refers to a file on a read-only filesystem."
17343 msgstr "I<pathname> が読み込み専用のファイルシステムのファイルを参照している。"
17345 #. type: Plain text
17346 #: build/C/man2/unlink.2:248
17348 "The same errors that occur for B<unlink>() and B<rmdir>(2) can also occur "
17349 "for B<unlinkat>(). The following additional errors can occur for "
17352 "B<unlink>() と B<rmdir>(2) で発生するのと同じエラーが B<unlinkat>() でも起こ"
17353 "る。 B<unlinkat>() では以下のエラーも発生する。"
17355 #. type: Plain text
17356 #: build/C/man2/unlink.2:263
17358 "I<pathname> refers to a directory, and B<AT_REMOVEDIR> was not specified in "
17361 "I<pathname> がディレクトリを参照していて、 I<flags> に B<AT_REMOVEDIR> がされ"
17364 #. type: Plain text
17365 #: build/C/man2/unlink.2:273
17367 "B<unlinkat>() was added to Linux in kernel 2.6.16; library support was "
17368 "added to glibc in version 2.4."
17370 "B<unlinkat>() はカーネル 2.6.16 で Linux に追加された。 ライブラリによるサ"
17371 "ポートはバージョン 2.4 で glibc に追加された。"
17373 #. SVr4 documents additional error
17374 #. conditions EINTR, EMULTIHOP, ETXTBSY, ENOLINK.
17375 #. type: Plain text
17376 #: build/C/man2/unlink.2:278
17377 msgid "B<unlink>(): SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
17378 msgstr "B<unlink>(): SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008."
17380 #. type: Plain text
17381 #: build/C/man2/unlink.2:281
17382 msgid "B<unlinkat>(): POSIX.1-2008."
17383 msgstr "B<unlinkat>(): POSIX.1-2008."
17385 #. type: Plain text
17386 #: build/C/man2/unlink.2:296
17388 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
17389 "B<rmdir>(2), B<mkfifo>(3), B<remove>(3), B<path_resolution>(7), B<symlink>(7)"
17391 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
17392 "B<rmdir>(2), B<mkfifo>(3), B<remove>(3), B<path_resolution>(7), B<symlink>(7)"
17395 #: build/C/man3/unlocked_stdio.3:25
17397 msgid "UNLOCKED_STDIO"
17398 msgstr "UNLOCKED_STDIO"
17401 #: build/C/man3/unlocked_stdio.3:25
17404 msgstr "2008-08-29"
17406 #. type: Plain text
17407 #: build/C/man3/unlocked_stdio.3:29
17409 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
17410 "nonlocking stdio functions"
17412 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - ロックを行"
17415 #. type: Plain text
17416 #: build/C/man3/unlocked_stdio.3:37
17419 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
17420 "B<int getchar_unlocked(void);>\n"
17421 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
17422 "B<int putchar_unlocked(int >I<c>B<);>\n"
17424 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
17425 "B<int getchar_unlocked(void);>\n"
17426 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
17427 "B<int putchar_unlocked(int >I<c>B<);>\n"
17429 #. type: Plain text
17430 #: build/C/man3/unlocked_stdio.3:49
17433 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
17434 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
17435 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
17436 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
17437 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
17438 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
17439 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
17440 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<n>B<,>\n"
17441 "B< FILE *>I<stream>B<);>\n"
17442 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t >I<n>B<,>\n"
17443 "B< FILE *>I<stream>B<);>\n"
17445 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
17446 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
17447 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
17448 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
17449 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
17450 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
17451 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
17452 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<n>B<,>\n"
17453 "B< FILE *>I<stream>B<);>\n"
17454 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t >I<n>B<,>\n"
17455 "B< FILE *>I<stream>B<);>\n"
17457 #. type: Plain text
17458 #: build/C/man3/unlocked_stdio.3:52
17461 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
17462 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
17464 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
17465 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
17467 #. type: Plain text
17468 #: build/C/man3/unlocked_stdio.3:63
17471 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
17472 "B<wint_t getwchar_unlocked(void);>\n"
17473 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
17474 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
17475 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
17476 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
17477 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
17478 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
17480 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
17481 "B<wint_t getwchar_unlocked(void);>\n"
17482 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
17483 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
17484 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
17485 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
17486 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
17487 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
17489 #. type: Plain text
17490 #: build/C/man3/unlocked_stdio.3:75
17492 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
17493 "B<putchar_unlocked>():"
17495 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
17496 "B<putchar_unlocked>():"
17498 #. type: Plain text
17499 #: build/C/man3/unlocked_stdio.3:78
17501 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
17502 "_BSD_SOURCE || _SVID_SOURCE"
17504 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
17505 "_BSD_SOURCE || _SVID_SOURCE"
17507 #. type: Plain text
17508 #: build/C/man3/unlocked_stdio.3:89
17510 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
17511 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
17512 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
17514 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
17515 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
17516 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
17518 #. type: Plain text
17519 #: build/C/man3/unlocked_stdio.3:91
17520 msgid "_BSD_SOURCE || _SVID_SOURCE"
17521 msgstr "_BSD_SOURCE || _SVID_SOURCE"
17523 #. type: Plain text
17524 #: build/C/man3/unlocked_stdio.3:102
17526 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
17527 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
17528 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
17530 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
17531 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
17532 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
17534 #. type: Plain text
17535 #: build/C/man3/unlocked_stdio.3:113
17537 "Each of these functions has the same behavior as its counterpart without the "
17538 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
17539 "locks themselves, and do not test for the presence of locks set by others) "
17540 "and hence are thread-unsafe. See B<flockfile>(3)."
17542 "これらの関数は、末尾に \"_unlocked\" がついていない関数と同じ動作をするが、 "
17543 "ファイルのロックを使用しない点が異なる。(これらの関数自身はファイルのロック "
17544 "をセットせず、他の関数によってロックがセットされているかどうかのチェックも 行"
17545 "わない) それゆえ、スレッド(thread)で安全に使用することができない。 "
17546 "B<flockfile>(3) を参照のこと。"
17548 #. type: Plain text
17549 #: build/C/man3/unlocked_stdio.3:120
17551 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
17552 "B<putc_unlocked>(), B<putchar_unlocked>() are in POSIX.1-2001."
17554 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
17555 "B<putchar_unlocked>() の 4 つの関数は POSIX.1-2001 に規定されている。"
17557 #. E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
17558 #. moved to a compatibility library.
17559 #. Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
17560 #. feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
17561 #. fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
17562 #. fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
17563 #. ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
17564 #. getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
17565 #. putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
17566 #. putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
17567 #. ungetc_unlocked, ungetwc_unlocked.
17568 #. type: Plain text
17569 #: build/C/man3/unlocked_stdio.3:136
17571 "The nonstandard B<*_unlocked>() variants occur on a few UNIX systems, and "
17572 "are available in recent glibc. They should probably not be used."
17574 "非標準の B<*_unlocked>() の仲間は 2、3 の UNIX システムで定義されており、 最"
17575 "近の glibc では使用可能であるが、 これらの関数は使わない方がよいだろう。"
17577 #. type: Plain text
17578 #: build/C/man3/unlocked_stdio.3:139
17579 msgid "B<flockfile>(3), B<stdio>(3)"
17580 msgstr "B<flockfile>(3), B<stdio>(3)"
17583 #: build/C/man3/wprintf.3:16
17589 #: build/C/man3/wprintf.3:16
17592 msgstr "2014-03-19"
17594 #. type: Plain text
17595 #: build/C/man3/wprintf.3:20
17597 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted wide-"
17598 "character output conversion"
17600 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - ワイド文字を "
17603 #. type: Plain text
17604 #: build/C/man3/wprintf.3:24
17607 "B<#include E<lt>stdio.hE<gt>>\n"
17608 "B<#include E<lt>wchar.hE<gt>>\n"
17610 "B<#include E<lt>stdio.hE<gt>>\n"
17611 "B<#include E<lt>wchar.hE<gt>>\n"
17613 #. type: Plain text
17614 #: build/C/man3/wprintf.3:29
17617 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
17618 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
17619 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
17620 "B< const wchar_t *>I<format>B<, ...);>\n"
17622 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
17623 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
17624 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
17625 "B< const wchar_t *>I<format>B<, ...);>\n"
17627 #. type: Plain text
17628 #: build/C/man3/wprintf.3:34
17631 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17632 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17633 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
17634 "B< const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17636 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17637 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17638 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
17639 "B< const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
17642 #. .BR fwprintf (),
17643 #. .BR swprintf (),
17644 #. .BR vwprintf (),
17645 #. .BR vfwprintf (),
17646 #. .BR vswprintf ():
17647 #. type: Plain text
17648 #: build/C/man3/wprintf.3:51
17649 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
17650 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
17652 #. type: Plain text
17653 #: build/C/man3/wprintf.3:53
17654 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
17655 msgstr "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
17657 #. type: Plain text
17658 #: build/C/man3/wprintf.3:56
17659 msgid "or I<cc\\ -std=c99>"
17660 msgstr "or I<cc\\ -std=c99>"
17662 #. type: Plain text
17663 #: build/C/man3/wprintf.3:67
17665 "The B<wprintf>() family of functions is the wide-character equivalent of "
17666 "the B<printf>(3) family of functions. It performs formatted output of wide "
17669 "B<wprintf>() ファミリーの関数は B<printf>(3) ファミリーの関数の ワイド文字"
17670 "版である。これらはワイド文字をフォーマットして出力する。"
17672 #. type: Plain text
17673 #: build/C/man3/wprintf.3:79
17675 "The B<wprintf>() and B<vwprintf>() functions perform wide-character output "
17676 "to I<stdout>. I<stdout> must not be byte oriented; see B<fwide>(3) for "
17677 "more information."
17679 "B<wprintf>() と B<vwprintf>() 関数は I<stdout> に出力を行なう。 I<stdout> "
17680 "がバイト単位入出力であってはいけない。より詳しい説明は B<fwide>(3) を参照す"
17683 #. type: Plain text
17684 #: build/C/man3/wprintf.3:91
17686 "The B<fwprintf>() and B<vfwprintf>() functions perform wide-character "
17687 "output to I<stream>. I<stream> must not be byte oriented; see B<fwide>(3) "
17688 "for more information."
17690 "B<fwprintf>() と B<vfwprintf>() 関数は I<stream> にワイド文字出力 を行な"
17691 "う。 I<stream> がバイト単位入出力であってはいけない。 より詳しい説明は "
17692 "B<fwide>(3) を参照すること。"
17694 #. type: Plain text
17695 #: build/C/man3/wprintf.3:105
17697 "The B<swprintf>() and B<vswprintf>() functions perform wide-character "
17698 "output to an array of wide characters. The programmer must ensure that "
17699 "there is room for at least I<maxlen> wide characters at I<wcs>."
17701 "B<swprintf>() と B<vswprintf>() 関数はワイド文字の配列に ワイド文字出力を行"
17702 "なう。プログラマーは I<wcs> に最低でも I<maxlen> 文字のワイド文字を出力できる"
17703 "空きがあることを保証しなければ ならない。"
17705 #. type: Plain text
17706 #: build/C/man3/wprintf.3:116
17708 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
17709 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3) functions except for the "
17710 "following differences:"
17712 "これらの関数は B<printf>(3), B<vprintf>(3), B<fprintf>(3), B<vfprintf>(3), "
17713 "B<sprintf>(3), B<vsprintf>(3) 関数に似ているが以下の 点で異っている。"
17716 #: build/C/man3/wprintf.3:116 build/C/man3/wprintf.3:121
17717 #: build/C/man3/wprintf.3:124
17722 #. type: Plain text
17723 #: build/C/man3/wprintf.3:121
17724 msgid "The I<format> string is a wide-character string."
17725 msgstr "I<format> がワイド文字列で与えられる。"
17727 #. type: Plain text
17728 #: build/C/man3/wprintf.3:124
17729 msgid "The output consists of wide characters, not bytes."
17730 msgstr "出力がバイトではなくワイド文字で構成される。"
17732 #. type: Plain text
17733 #: build/C/man3/wprintf.3:143
17735 "B<swprintf>() and B<vswprintf>() take a I<maxlen> argument, B<sprintf>(3) "
17736 "and B<vsprintf>(3) do not. (B<snprintf>(3) and B<vsnprintf>(3) take a "
17737 "I<maxlen> argument, but these functions do not return -1 upon buffer "
17738 "overflow on Linux.)"
17740 "B<swprintf>() と B<vswprintf>() は I<maxlen> 引き数を取るが、 "
17741 "B<sprintf>() と B<vsprintf>() は取らない (B<snprintf>() と "
17742 "B<vsnprintf>() は I<maxlen> 引き数を取るが これらの関数が Linux では、バッ"
17743 "ファーが溢れた場合でも -1 を返さない)。"
17745 #. type: Plain text
17746 #: build/C/man3/wprintf.3:149
17747 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
17748 msgstr "B<c> と B<s> 変換文字の扱いが異っている:"
17750 #. type: Plain text
17751 #: build/C/man3/wprintf.3:163
17753 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
17754 "character by a call to the B<btowc>(3) function, and the resulting wide "
17755 "character is written. If an B<l> modifier is present, the I<wint_t> (wide "
17756 "character) argument is written."
17758 "もし B<l> 修飾子が存在しない場合は I<int> 引き数は B<btowc>(3) 関数によって"
17759 "ワイド文字に変換される。そして結果のワイド文字が出力される。 B<l> 修飾子が存"
17760 "在する場合は I<wint_t> (ワイド文字)引き数が出力される。"
17762 #. type: Plain text
17763 #: build/C/man3/wprintf.3:203
17765 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
17766 "to be a pointer to an array of character type (pointer to a string) "
17767 "containing a multibyte character sequence beginning in the initial shift "
17768 "state. Characters from the array are converted to wide characters (each by "
17769 "a call to the B<mbrtowc>(3) function with a conversion state starting in "
17770 "the initial state before the first byte). The resulting wide characters are "
17771 "written up to (but not including) the terminating null wide character (L\\(aq"
17772 "\\e0\\(aq). If a precision is specified, no more wide characters than the "
17773 "number specified are written. Note that the precision determines the number "
17774 "of I<wide characters> written, not the number of I<bytes> or I<screen "
17775 "positions>. The array must contain a terminating null byte (\\(aq"
17776 "\\e0\\(aq), unless a precision is given and it is so small that the number "
17777 "of converted wide characters reaches it before the end of the array is "
17778 "reached. If an B<l> modifier is present: The I<const\\ wchar_t\\ *> "
17779 "argument is expected to be a pointer to an array of wide characters. Wide "
17780 "characters from the array are written up to (but not including) a "
17781 "terminating null wide character. If a precision is specified, no more than "
17782 "the number specified are written. The array must contain a terminating null "
17783 "wide character, unless a precision is given and it is smaller than or equal "
17784 "to the number of wide characters in the array."
17786 "もし B<l> 修飾子が存在しない場合、 I<const\\ char\\ *> 引き数は初期状態より始"
17787 "まるマルチバイト文字列を含んだ char 型の配列へのポインタ(文字列へのポインタ)"
17788 "とみなされる。 配列の文字は(最初のバイト前に初期状態で変換を開始し、それぞれ"
17789 "の文字を B<mbrtowc>(3) 関数によって)ワイド文字へと変換される。結果のワイド文"
17790 "字は終端の ナルワイド文字 (L\\(aq\\e0\\(aq) の手前までが書き込まれる。精度"
17791 "(precision)が指定された 場合、指定された数字を超えるワイド文字は書き込まれな"
17792 "い。精度は 書き込まれる I<バイト> 数や I<画面上の位置> ではなく I<ワイド文字"
17793 "> の数を指定することに注意すること。 精度がない場合には配列の終端にナルバイ"
17794 "ト (\\(aq\\e0\\(aq) を含む必要がある。 精度を指定する場合には、配列の最後に到"
17795 "着する前に変換されたワイド文字の 数がそれに到達するよう、精度は十分に小さな数"
17796 "でなければならない。 もし B<l> 修飾子が存在する場合、 I<const\\ wchar_t\\ *> "
17797 "引き数はワイド文字の配列へのポインタとみなされる。 配列のワイド文字列は終端の"
17798 "ナルワイド文字の手間まで出力される。 もし精度が指定された場合には指定された精"
17799 "度以上の文字は出力されない。 精度を指定しない場合には終端のナルワイド文字を含"
17800 "む必要がある。 精度を指定する場合にはそれはワイド文字の配列の大きさよりも小さ"
17803 #. type: Plain text
17804 #: build/C/man3/wprintf.3:211
17806 "The functions return the number of wide characters written, excluding the "
17807 "terminating null wide character in case of the functions B<swprintf>() and "
17808 "B<vswprintf>(). They return -1 when an error occurs."
17810 "これらの関数は書き込まれたワイド文字の文字数を返す。 B<swprintf>() と "
17811 "B<vswprintf>() 関数の場合は 終端のナルワイド文字は含まない。エラーが起こった"
17814 #. type: Plain text
17815 #: build/C/man3/wprintf.3:213
17819 #. type: Plain text
17820 #: build/C/man3/wprintf.3:221
17822 "The behavior of B<wprintf>() et al. depends on the B<LC_CTYPE> category of "
17823 "the current locale."
17825 "B<wprintf>() 等の動作は現在のロケールの B<LC_CTYPE> カテゴリに依存している。"
17827 #. type: Plain text
17828 #: build/C/man3/wprintf.3:251
17830 "If the I<format> string contains non-ASCII wide characters, the program will "
17831 "work correctly only if the B<LC_CTYPE> category of the current locale at run "
17832 "time is the same as the B<LC_CTYPE> category of the current locale at "
17833 "compile time. This is because the I<wchar_t> representation is platform- "
17834 "and locale-dependent. (The glibc represents wide characters using their "
17835 "Unicode (ISO-10646) code point, but other platforms don't do this. Also, "
17836 "the use of C99 universal character names of the form \\eunnnn does not solve "
17837 "this problem.) Therefore, in internationalized programs, the I<format> "
17838 "string should consist of ASCII wide characters only, or should be "
17839 "constructed at run time in an internationalized way (e.g., using "
17840 "B<gettext>(3) or B<iconv>(3), followed by B<mbstowcs>(3))."
17842 "I<format> 文字列が ASCII 以外のワイド文字を含んでいる場合、 実行時のロケール"
17843 "の B<LC_CTYPE> カテゴリがコンパイル時の B<LC_CTYPE> カテゴリと 一致している場"
17844 "合にのみプログラムは正常に動作する。これは I<wchar_t> の表現がロケールやプ"
17845 "ラットホームに依存していることに原因がある。 (glibc ではワイド文字として "
17846 "Unicode (ISO-10646) のコードポイントを 使用している。他のプラットホームではそ"
17847 "うではない。同様に ISO C99 の \\eunnnn 形式の汎用文字名称はこの問題を解決しな"
17848 "い。) このため国際化されたプログラムでは I<format> 文字列を ASCII ワイド 文"
17849 "字のみにするか、実行時に国際化された方法で構成する必要がある (例えば "
17850 "B<gettext>() と B<iconv>() や B<mbstowcs>() を組み合わて使用する)。"
17853 #. type: Plain text
17854 #: build/C/man3/wprintf.3:258
17855 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
17856 msgstr "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
17859 #: build/C/man2/write.2:39
17864 #. type: Plain text
17865 #: build/C/man2/write.2:42
17866 msgid "write - write to a file descriptor"
17867 msgstr "write - ファイルディスクリプタ (file descriptor) に書き込む"
17869 #. type: Plain text
17870 #: build/C/man2/write.2:46
17872 "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
17874 "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
17876 #. type: Plain text
17877 #: build/C/man2/write.2:54
17879 "B<write>() writes up to I<count> bytes from the buffer pointed I<buf> to "
17880 "the file referred to by the file descriptor I<fd>."
17882 "B<write>() は、 I<buf> が指すバッファから、ファイルディスクリプタ I<fd> が参"
17883 "照するファイルへ、最大 I<count> バイトを書き込む。"
17885 #. type: Plain text
17886 #: build/C/man2/write.2:68
17888 "The number of bytes written may be less than I<count> if, for example, there "
17889 "is insufficient space on the underlying physical medium, or the "
17890 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
17891 "call was interrupted by a signal handler after having written less than "
17892 "I<count> bytes. (See also B<pipe>(7).)"
17894 "書き込まれるバイト数は I<count> よりも小さくなることがある。 例えば、書き込み"
17895 "対象の物理メディアに十分な領域がない場合、 リソース上限 B<RLIMIT_FSIZE> に達"
17896 "した場合 (B<setrlimit>(2) 参照)、 I<count> バイト未満の書き込みが行われた後"
17897 "で 呼び出しがシグナルハンドラにより割り込まれた場合、 などである。 "
17898 "(B<pipe>(7) も参照のこと。)"
17900 #. type: Plain text
17901 #: build/C/man2/write.2:82
17903 "For a seekable file (i.e., one to which B<lseek>(2) may be applied, for "
17904 "example, a regular file) writing takes place at the current file offset, "
17905 "and the file offset is incremented by the number of bytes actually written. "
17906 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
17907 "to the end of the file before writing. The adjustment of the file offset "
17908 "and the write operation are performed as an atomic step."
17910 "seek 可能なファイル (つまり B<lseek>(2) が適用できるファイル、例えば通常の"
17911 "ファイル) では、 書き込みは現在のファイルオフセットから行われ、 ファイルオフ"
17912 "セットは実際に書き込みが行われたバイト数分 加算される。ファイルが "
17913 "B<O_APPEND> で B<open>(2) された場合、ファイルオフセットは書き込み前に ファ"
17914 "イルの末尾に設定される。 ファイルオフセットの調整と書き込み操作はアトミックな"
17917 #. type: Plain text
17918 #: build/C/man2/write.2:89
17920 "POSIX requires that a B<read>(2) which can be proved to occur after a "
17921 "B<write>() has returned returns the new data. Note that not all "
17922 "filesystems are POSIX conforming."
17924 "POSIX は B<write>() が行なわれた後に実行した B<read>(2) が 新しいデータを返"
17925 "すことを要求している。 全てのファイルシステムが POSIX 準拠ではない点に注意す"
17928 #. type: Plain text
17929 #: build/C/man2/write.2:94
17931 "On success, the number of bytes written is returned (zero indicates nothing "
17932 "was written). On error, -1 is returned, and I<errno> is set appropriately."
17934 "成功した場合、書き込まれたバイト数が返される (ゼロは何も書き込まれなかったこ"
17935 "とを示す)。 エラーならば -1 が返され、I<errno> が適切に設定される。"
17937 #. type: Plain text
17938 #: build/C/man2/write.2:107
17940 "If I<count> is zero and I<fd> refers to a regular file, then B<write>() may "
17941 "return a failure status if one of the errors below is detected. If no "
17942 "errors are detected, 0 will be returned without causing any other effect. "
17943 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
17944 "the results are not specified."
17946 "I<count> が 0 で、 I<fd> が通常のファイル (regular file) を参照している場"
17947 "合、 B<write>() は後述のエラーのいずれかを検出した場合、失敗を返すことがあ"
17948 "る。 エラーが検出されなかった場合は、 0 を返し、他に何の影響も与えない。 "
17949 "I<count> が 0 で、 I<fd> が通常のファイル以外のファイルを参照している場合、 "
17952 #. type: Plain text
17953 #: build/C/man2/write.2:115
17955 "The file descriptor I<fd> refers to a file other than a socket and has been "
17956 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
17958 "ファイルディスクリプタ I<fd> がソケット以外のファイルを参照していて、 非停止 "
17959 "(nonblocking) モード (B<O_NONBLOCK>) に設定されており、書き込みを行うと停止"
17962 #. Actually EAGAIN on Linux
17963 #. type: Plain text
17964 #: build/C/man2/write.2:126
17966 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
17967 "(B<O_NONBLOCK>), and the write would block. POSIX.1-2001 allows either "
17968 "error to be returned for this case, and does not require these constants to "
17969 "have the same value, so a portable application should check for both "
17972 "ファイルディスクリプタ I<fd> がソケットを参照していて、非停止 (nonblocking) "
17973 "モード (B<O_NONBLOCK>) に設定されており、書き込みを行うと停止する状況にあ"
17974 "る。 POSIX.1-2001 は、この場合にどちらのエラーを返すことも認めており、 これ"
17975 "ら 2 つの定数が同じ値を持つことも求めていない。 したがって、移植性が必要なア"
17976 "プリケーションでは、両方の可能性を 確認すべきである。"
17978 #. type: Plain text
17979 #: build/C/man2/write.2:130
17980 msgid "I<fd> is not a valid file descriptor or is not open for writing."
17982 "I<fd> が有効なファイルディスクリプタでないか書き込みのためにオープン (open) "
17986 #: build/C/man2/write.2:130
17988 msgid "B<EDESTADDRREQ>"
17989 msgstr "B<EDESTADDRREQ>"
17991 #. type: Plain text
17992 #: build/C/man2/write.2:135
17994 "I<fd> refers to a datagram socket for which a peer address has not been set "
17995 "using B<connect>(2)."
17997 "I<fd> が、 B<connect>(2) を使って通信相手のアドレスが設定されていないデータ"
18000 #. type: Plain text
18001 #: build/C/man2/write.2:141
18003 "The user's quota of disk blocks on the filesystem containing the file "
18004 "referred to by I<fd> has been exhausted."
18006 "I<fd> が参照するファイルを含むファイルシステムのディスクブロックのユーザ"
18009 #. type: Plain text
18010 #: build/C/man2/write.2:150
18012 "An attempt was made to write a file that exceeds the implementation-defined "
18013 "maximum file size or the process's file size limit, or to write at a "
18014 "position past the maximum allowed offset."
18016 "実装定義の最大ファイルサイズまたはプロセスのファイルサイズ制限を 超えてファイ"
18017 "ルに書き込もうとした。 または許可されたオフセット値の限界を超えた先の位置に "
18020 #. type: Plain text
18021 #: build/C/man2/write.2:154
18023 "The call was interrupted by a signal before any data was written; see "
18026 "何のデータも書かない間にシグナルにより割り込まれた (interrupt)。 "
18029 #. type: Plain text
18030 #: build/C/man2/write.2:165
18032 "I<fd> is attached to an object which is unsuitable for writing; or the file "
18033 "was opened with the B<O_DIRECT> flag, and either the address specified in "
18034 "I<buf>, the value specified in I<count>, or the current file offset is not "
18035 "suitably aligned."
18037 "I<fd> が書き込みが不適切なオブジェクトを参照している。 もしくは、ファイルが "
18038 "B<O_DIRECT> フラグを指定してオープンされているが、 I<buf> に指定されたアドレ"
18039 "ス、 I<count> に指定された値、 現在のファイルオフセットのいずれかの アライン"
18042 #. type: Plain text
18043 #: build/C/man2/write.2:168
18044 msgid "A low-level I/O error occurred while modifying the inode."
18045 msgstr "inode の修正中に低レべル (low-level) I/O エラーが発生した。"
18047 #. type: Plain text
18048 #: build/C/man2/write.2:173
18050 "The device containing the file referred to by I<fd> has no room for the data."
18052 "I<fd> によって参照されるファイルを含むデバイス (device) に十分な空きがない。"
18055 #: build/C/man2/write.2:173
18060 #. type: Plain text
18061 #: build/C/man2/write.2:182
18063 "I<fd> is connected to a pipe or socket whose reading end is closed. When "
18064 "this happens the writing process will also receive a B<SIGPIPE> signal. "
18065 "(Thus, the write return value is seen only if the program catches, blocks or "
18066 "ignores this signal.)"
18068 "I<fd> がパイプ (pipe) かソケット (socket) に接続されており、 その反対側 (読み"
18069 "込み側) がクローズ (close) されている。 これが発生した場合には、書き込みを行"
18070 "なうプロセスは B<SIGPIPE> シグナル (signal)も受ける。 (したがって、プログラム"
18071 "がこのシグナルを捕獲 (catch)、停止 (block)、無視 (ignore) した場合のみ、"
18072 "write の返り値を参照できる。)"
18074 #. type: Plain text
18075 #: build/C/man2/write.2:185
18076 msgid "Other errors may occur, depending on the object connected to I<fd>."
18078 "I<fd> に接続されたオブジェクトによっては、他のエラーが起こるかもしれない。"
18080 #. type: Plain text
18081 #: build/C/man2/write.2:194
18083 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
18084 "just before any data is written."
18086 "SVr4 では write が割り込まれると、データが書き込まれる直前ではなく、 その時点"
18089 #. type: Plain text
18090 #: build/C/man2/write.2:203
18092 "A successful return from B<write>() does not make any guarantee that data "
18093 "has been committed to disk. In fact, on some buggy implementations, it does "
18094 "not even guarantee that space has successfully been reserved for the data. "
18095 "The only way to be sure is to call B<fsync>(2) after you are done writing "
18098 "B<write>() が成功して返ってきても、データがディスクに記録されたことを 保証す"
18099 "るものではない。 実際、データのためのスペースが確保されたことすら保証されない"
18100 "という バグっぽい実装もある。 これを確実にする唯一の方法は、 全てのデータを "
18101 "write した後に B<fsync>(2) を呼び出すことである。"
18103 #. type: Plain text
18104 #: build/C/man2/write.2:211
18106 "If a B<write>() is interrupted by a signal handler before any bytes are "
18107 "written, then the call fails with the error B<EINTR>; if it is interrupted "
18108 "after at least one byte has been written, the call succeeds, and returns the "
18109 "number of bytes written."
18111 "B<write>() が 1 バイトも書き込まないうちにシグナルハンドラにより割り込まれた"
18112 "場合、 B<write>() はエラー B<EINTR> で失敗する。 1バイトでも書き込んだ後で割"
18113 "り込まれた場合には、 B<write>() は成功し、書き込んだバイト数を返す。"
18116 #. http://thread.gmane.org/gmane.linux.kernel/1649458
18117 #. From: Michael Kerrisk (man-pages <mtk.manpages <at> gmail.com>
18118 #. Subject: Update of file offset on write() etc. is non-atomic with I/O
18119 #. Date: 2014-02-17 15:41:37 GMT
18120 #. Newsgroups: gmane.linux.kernel, gmane.linux.file-systems
18121 #. commit 9c225f2655e36a470c4f58dbbc99244c5fc7f2d4
18122 #. Author: Linus Torvalds <torvalds@linux-foundation.org>
18123 #. Date: Mon Mar 3 09:36:58 2014 -0800
18124 #. vfs: atomic f_pos accesses as per POSIX
18125 #. type: Plain text
18126 #: build/C/man2/write.2:250
18128 "Among the APIs subsequently listed are B<write>() and B<writev>(2). And "
18129 "among the effects that should be atomic across threads (and processes) are "
18130 "updates of the file offset. However, on Linux before version 3.14, this was "
18131 "not the case: if two processes that share an open file description (see "
18132 "B<open>(2)) perform a B<write>() (or B<writev>(2)) at the same time, then "
18133 "the I/O operations were not atomic with respect updating the file offset, "
18134 "with the result that the blocks of data output by the two processes might "
18135 "(incorrectly) overlap. This problem was fixed in Linux 3.14."
18138 #. type: Plain text
18139 #: build/C/man2/write.2:262
18141 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
18142 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
18144 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
18145 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
18147 #~ msgid "2014-04-02"
18148 #~ msgstr "2014-04-02"
18150 #~ msgid "2012-04-17"
18151 #~ msgstr "2012-04-17"
18153 #~ msgid "B<int >I<errno>B<;>"
18154 #~ msgstr "B<int >I<errno>B<;>"
18156 #~ msgid "2014-04-20"
18157 #~ msgstr "2014-04-20"
18160 #~ "If the pathname given in I<pathname> is relative, then it is interpreted "
18161 #~ "relative to the directory relative to by the file descriptor I<dirfd> "
18162 #~ "(rather than relative to the current working directory of the calling "
18163 #~ "process, as is done by B<open>() for a relative pathname)."
18165 #~ "I<pathname> で指定されたパス名が相対パスの場合、このパス名はファイルディス"
18166 #~ "クリプター I<dirfd> が参照するディレクトリに対する相対パスと解釈される "
18167 #~ "(B<open>() に相対パス名を渡した場合のように、呼び出したプロセスのカレント"
18168 #~ "ワーキングディレクトリに対する相対パスではない)。"
18170 #~ msgid "2014-03-24"
18171 #~ msgstr "2014-03-24"
18173 #~ msgid "2013-02-12"
18174 #~ msgstr "2013-02-12"
18176 #~ msgid "2013-01-27"
18177 #~ msgstr "2013-01-27"
18180 #~ "Enable the close-on-exec flag for the new file descriptor. Specifying "
18181 #~ "this flag permits a program to avoid additional B<fcntl>(2) B<F_SETFD> "
18182 #~ "operations to set the B<FD_CLOEXEC> flag. Additionally, use of this flag "
18183 #~ "is essential in some multithreaded programs since using a separate "
18184 #~ "B<fcntl>(2) B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not "
18185 #~ "suffice to avoid race conditions where one thread opens a file descriptor "
18186 #~ "at the same time as another thread does a B<fork>(2) plus B<execve>(2)."
18188 #~ "新しいファイルディスクリプタに対して close-on-exec フラグを有効にする。 こ"
18189 #~ "のフラグを指定することで、プログラムは B<FD_CLOEXEC> フラグをセットするた"
18190 #~ "めの B<fcntl>(2) B<F_SETFD> 操作を別途呼び出す必要がなくなる。 また、ある"
18191 #~ "種のマルチスレッドのプログラムはこのフラグの使用は 不可欠である。なぜな"
18192 #~ "ら、個別に B<FD_CLOEXEC> フラグを設定する B<fcntl>(2) B<F_SETFD> 操作を呼"
18193 #~ "び出したとしても、あるスレッドがファイルディスクリプタを オープンするのと"
18194 #~ "同時に別のスレッドが B<fork>(2) と B<execve>(2) を実行するという競合条件"
18195 #~ "を避けるのには十分ではないからである。"
18197 #~ msgid "SYMBOLIC LINK HANDLING"
18198 #~ msgstr "シンボリックリンクの取り扱い"
18201 #~ "Various system calls do not follow links, and operate on the symbolic "
18202 #~ "link itself. They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
18203 #~ "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
18204 #~ "B<rename>(2), B<rmdir>(2), and B<unlink>(2). Certain other system calls "
18205 #~ "optionally follow symbolic links. They are: B<faccessat>(2), "
18206 #~ "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), "
18207 #~ "and B<utimensat>(2); see their manual pages for details. Because "
18208 #~ "B<remove>(3) is an alias for B<unlink>(2), that library function also "
18209 #~ "does not follow symbolic links. When B<rmdir>(2) is applied to a "
18210 #~ "symbolic link, it fails with the error B<ENOTDIR>. The B<link>(2) "
18211 #~ "warrants special discussion. POSIX.1-2001 specifies that B<link>(2) "
18212 #~ "should dereference I<oldpath> if it is a symbolic link. However, Linux "
18213 #~ "does not do this. (By default Solaris is the same, but the POSIX.1-2001 "
18214 #~ "specified behavior can be obtained with suitable compiler options.) The "
18215 #~ "upcoming POSIX.1 revision changes the specification to allow either "
18216 #~ "behavior in an implementation."
18218 #~ "いくつかのシステムコールは、 シンボリックリンクを辿らず、 シンボリックリン"
18219 #~ "ク自身に対して操作を行う。 B<lchown>(2), B<lgetxattr>(2), "
18220 #~ "B<llistxattr>(2), B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), "
18221 #~ "B<readlink>(2), B<rename>(2), B<rmdir>(2), B<unlink>(2) が該当する。 他の"
18222 #~ "いくつかのシステムコールは、 シンボリックリンクを辿る場合と辿らない場合が"
18223 #~ "ある。 該当するのは B<faccessat>(2), B<fchownat>(2), B<fstatat>(2), "
18224 #~ "B<linkat>(2), B<open>(2), B<openat>(2), B<utimensat>(2) である。 詳細はそ"
18225 #~ "れぞれのマニュアルページを参照。 ライブラリ関数 B<remove>(3) は "
18226 #~ "B<unlink>(2) の別名なので、 この関数もシンボリックリンクを辿らない。 "
18227 #~ "B<rmdir>(2) をシンボリックリンクに対して行った場合、 エラー B<ENOTDIR> で"
18228 #~ "失敗する。 B<link>(2) は特別に議論が必要である。 POSIX.1-2001 は、 "
18229 #~ "B<link>(2) は I<oldpath> がシンボリックリンクの場合にはこのリンクを展開す"
18230 #~ "べきだと規定している。 しかし、 Linux はこれを行っていない。 (デフォルトで"
18231 #~ "は Solaris も同じだが、 適切なコンパイルオプションを指定することで "
18232 #~ "POSIX.1-2001 で規定された動作にすることもできる。) POSIX.1-2001 の次の版で"
18233 #~ "は、仕様が変更され、 どちらの動作の実装も認められるようになる。"
18236 #~ "If the name was the last link to a file but any processes still have the "
18237 #~ "file open the file will remain in existence until the last file "
18238 #~ "descriptor referring to it is closed."
18240 #~ "もし削除する名前がファイルへの最後のリンクだが、どれかのプロセスが その"
18241 #~ "ファイルをまだオープンしている場合は、 そのファイルを参照している最後の"
18242 #~ "ファイルディスクリプタ (file descriptor) がクローズ (close) されるまで"
18245 #~ msgid "If the name referred to a symbolic link the link is removed."
18247 #~ "もしその名前がシンボリックリンク (symbolic link) を参照していれば、 リンク"
18251 #~ "If the name referred to a socket, fifo or device the name for it is "
18252 #~ "removed but processes which have the object open may continue to use it."
18254 #~ "もし名前がソケット (socket) や fifo やデバイス (device) を参照していれば "
18255 #~ "名前は削除されるがそのオブジェクトをオープンしていたプロセスは それを使い"
18259 #~ "The file is opened for synchronous I/O. Any B<write>(2)s on the "
18260 #~ "resulting file descriptor will block the calling process until the data "
18261 #~ "has been physically written to the underlying hardware. I<But see NOTES "
18264 #~ "ファイルは同期 (synchronous) I/O モードでオープンされる。 B<open>() が返"
18265 #~ "したファイルディスクリプタに対して B<write>(2) を行うと、必ず呼び出したプ"
18266 #~ "ロセスをブロックし、 該当ハードウェアに物理的に書き込まれるまで返らない。 "
18267 #~ "I<以下の「注意」の章も参照。>"
18270 #~ "Some of these optional flags can be altered using B<fcntl>(2) after the "
18271 #~ "file has been opened."
18273 #~ "これらの選択フラグのいくつかはファイルをオープンした後でも B<fcntl>(2) を"
18274 #~ "使用して変更することができる。"
18277 #~ "Too many symbolic links were encountered in resolving I<pathname>, or "
18278 #~ "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
18280 #~ "I<pathname> を解決する際に遭遇したシンボリックリンクが多過ぎる。 または "
18281 #~ "B<O_NOFOLLOW> が指定されており、 I<pathname> がシンボリックリンクだった。"
18284 #~ "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified "
18285 #~ "in POSIX.1-2008."
18287 #~ "B<O_CLOEXEC> フラグは POSIX.1-2001 では規定されていないが、 POSIX.1-2008 "
18291 #~ "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
18292 #~ "(before including I<any> header files) to get its definition."
18294 #~ "B<O_DIRECT> は POSIX では規定されていない。 B<O_DIRECT> の定義を得るには "
18295 #~ "(「どの」ヘッダファイルをインクルードするよりも前に) B<_GNU_SOURCE> を定"
18299 #~ "POSIX provides for three different variants of synchronized I/O, "
18300 #~ "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>. "
18301 #~ "Currently (2.6.31), Linux implements only B<O_SYNC>, but glibc maps "
18302 #~ "B<O_DSYNC> and B<O_RSYNC> to the same numerical value as B<O_SYNC>. Most "
18303 #~ "Linux filesystems don't actually implement the POSIX B<O_SYNC> semantics, "
18304 #~ "which require all metadata updates of a write to be on disk on returning "
18305 #~ "to user space, but only the B<O_DSYNC> semantics, which require only "
18306 #~ "actual file data and metadata necessary to retrieve it to be on disk by "
18307 #~ "the time the system call returns."
18309 #~ "POSIX では、3 種類の同期 I/O が提供されており、 B<O_SYNC>, B<O_DSYNC>, "
18310 #~ "B<O_RSYNC> フラグがこれに対応するものである。 今のところ (カーネル "
18311 #~ "2.6.31)、 Linux では B<O_SYNC> だけが実装されているが、 glibc は "
18312 #~ "B<O_DSYNC> と B<O_RSYNC> に B<O_SYNC> と同じ数値を割り当てている。 ほとん"
18313 #~ "どの Linux のファイルシステムは、実際には POSIX の B<O_SYNC> の動作ではな"
18314 #~ "く B<O_DSYNC> の動作だけを実装している。 POSIX の B<O_SYNC> では、 "
18315 #~ "B<open>() がユーザ空間に返る際に、書き込みに関する全てのメタデータの 更新"
18316 #~ "がディスクに書き込まれている必要がある。 一方、 B<O_DSYNC> では、 "
18317 #~ "B<open>() が返るまでに、実際のファイルのデータとそのデータを取得するため"
18318 #~ "に 必要なメタデータだけがディスクに書き込まれていればよい。"