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: 2021-03-12 14:01+0900\n"
10 "PO-Revision-Date: 2021-03-26 13:34+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/man2/alloc_hugepages.2:25
21 msgid "ALLOC_HUGEPAGES"
22 msgstr "ALLOC_HUGEPAGES"
25 #: build/C/man2/alloc_hugepages.2:25 build/C/man3/malloc_get_state.3:25
26 #: build/C/man3/malloc_usable_size.3:25 build/C/man2/mmap2.2:29
27 #: build/C/man3/posix_madvise.3:20 build/C/man2/remap_file_pages.2:28
28 #: build/C/man2/sync_file_range.2:30 build/C/man2/s390_pci_mmio_write.2:25
34 #: build/C/man2/alloc_hugepages.2:25 build/C/man2/cacheflush.2:25
35 #: build/C/man2/fallocate.2:11 build/C/man2/madvise.2:35
36 #: build/C/man3/mallinfo.3:25 build/C/man3/malloc_stats.3:25
37 #: build/C/man3/malloc_trim.3:25 build/C/man3/mallopt.3:25
38 #: build/C/man2/mlock.2:26 build/C/man2/mmap.2:40 build/C/man2/mmap2.2:29
39 #: build/C/man2/mprotect.2:33 build/C/man2/mremap.2:30 build/C/man2/msync.2:25
40 #: build/C/man2/posix_fadvise.2:29 build/C/man3/posix_madvise.3:20
41 #: build/C/man2/readahead.2:28 build/C/man2/remap_file_pages.2:28
42 #: build/C/man3/shm_open.3:25 build/C/man7/shm_overview.7:26
43 #: build/C/man2/shmctl.2:46 build/C/man2/shmget.2:38 build/C/man2/shmop.2:40
44 #: build/C/man2/subpage_prot.2:30 build/C/man2/sync_file_range.2:30
45 #: build/C/man2/memfd_create.2:21 build/C/man2/membarrier.2:25
46 #: build/C/man2/pkey_alloc.2:25 build/C/man7/pkeys.7:25
52 #: build/C/man2/alloc_hugepages.2:25 build/C/man3/alloca.3:43
53 #: build/C/man2/cacheflush.2:25 build/C/man2/fallocate.2:11
54 #: build/C/man2/madvise.2:35 build/C/man3/mallinfo.3:25
55 #: build/C/man3/malloc_get_state.3:25 build/C/man3/malloc_hook.3:10
56 #: build/C/man3/malloc_info.3:25 build/C/man3/malloc_stats.3:25
57 #: build/C/man3/malloc_trim.3:25 build/C/man3/malloc_usable_size.3:25
58 #: build/C/man3/mallopt.3:25 build/C/man3/mcheck.3:25 build/C/man2/mlock.2:26
59 #: build/C/man2/mmap.2:40 build/C/man2/mmap2.2:29 build/C/man2/mprotect.2:33
60 #: build/C/man2/mremap.2:30 build/C/man2/msync.2:25 build/C/man3/mtrace.3:25
61 #: build/C/man2/posix_fadvise.2:29 build/C/man3/posix_fallocate.3:25
62 #: build/C/man3/posix_madvise.3:20 build/C/man3/posix_memalign.3:29
63 #: build/C/man2/readahead.2:28 build/C/man2/remap_file_pages.2:28
64 #: build/C/man3/shm_open.3:25 build/C/man7/shm_overview.7:26
65 #: build/C/man2/shmctl.2:46 build/C/man2/shmget.2:38 build/C/man2/shmop.2:40
66 #: build/C/man2/subpage_prot.2:30 build/C/man2/sync_file_range.2:30
67 #: build/C/man2/memfd_create.2:21 build/C/man2/s390_pci_mmio_write.2:25
68 #: build/C/man2/membarrier.2:25 build/C/man2/pkey_alloc.2:25
69 #: build/C/man7/pkeys.7:25
71 msgid "Linux Programmer's Manual"
72 msgstr "Linux Programmer's Manual"
75 #: build/C/man2/alloc_hugepages.2:26 build/C/man3/alloca.3:44
76 #: build/C/man2/cacheflush.2:26 build/C/man2/fallocate.2:12
77 #: build/C/man2/madvise.2:36 build/C/man3/mallinfo.3:26
78 #: build/C/man3/malloc_get_state.3:26 build/C/man3/malloc_hook.3:11
79 #: build/C/man3/malloc_info.3:26 build/C/man3/malloc_stats.3:26
80 #: build/C/man3/malloc_trim.3:26 build/C/man3/malloc_usable_size.3:26
81 #: build/C/man3/mallopt.3:26 build/C/man3/mcheck.3:26 build/C/man2/mlock.2:27
82 #: build/C/man2/mmap.2:41 build/C/man2/mmap2.2:30 build/C/man2/mprotect.2:34
83 #: build/C/man2/mremap.2:31 build/C/man2/msync.2:26 build/C/man3/mtrace.3:26
84 #: build/C/man2/posix_fadvise.2:30 build/C/man3/posix_fallocate.3:26
85 #: build/C/man3/posix_madvise.3:21 build/C/man3/posix_memalign.3:30
86 #: build/C/man2/readahead.2:29 build/C/man2/remap_file_pages.2:29
87 #: build/C/man3/shm_open.3:26 build/C/man7/shm_overview.7:27
88 #: build/C/man2/shmctl.2:47 build/C/man2/shmget.2:39 build/C/man2/shmop.2:41
89 #: build/C/man2/subpage_prot.2:31 build/C/man2/sync_file_range.2:31
90 #: build/C/man2/memfd_create.2:22 build/C/man2/s390_pci_mmio_write.2:26
91 #: build/C/man2/membarrier.2:26 build/C/man2/pkey_alloc.2:26
92 #: build/C/man7/pkeys.7:26
98 #: build/C/man2/alloc_hugepages.2:28
99 msgid "alloc_hugepages, free_hugepages - allocate or free huge pages"
101 "alloc_hugepages, free_hugepages - 大きなサイズのページの割り当てと解放を行う"
104 #: build/C/man2/alloc_hugepages.2:28 build/C/man3/alloca.3:46
105 #: build/C/man2/cacheflush.2:28 build/C/man2/fallocate.2:14
106 #: build/C/man2/madvise.2:38 build/C/man3/mallinfo.3:28
107 #: build/C/man3/malloc_get_state.3:28 build/C/man3/malloc_hook.3:15
108 #: build/C/man3/malloc_info.3:28 build/C/man3/malloc_stats.3:28
109 #: build/C/man3/malloc_trim.3:28 build/C/man3/malloc_usable_size.3:28
110 #: build/C/man3/mallopt.3:28 build/C/man3/mcheck.3:28 build/C/man2/mlock.2:29
111 #: build/C/man2/mmap.2:43 build/C/man2/mmap2.2:32 build/C/man2/mprotect.2:36
112 #: build/C/man2/mremap.2:33 build/C/man2/msync.2:28 build/C/man3/mtrace.3:28
113 #: build/C/man2/posix_fadvise.2:32 build/C/man3/posix_fallocate.3:28
114 #: build/C/man3/posix_madvise.3:23 build/C/man3/posix_memalign.3:32
115 #: build/C/man2/readahead.2:31 build/C/man2/remap_file_pages.2:31
116 #: build/C/man3/shm_open.3:28 build/C/man2/shmctl.2:49 build/C/man2/shmget.2:41
117 #: build/C/man2/shmop.2:43 build/C/man2/subpage_prot.2:33
118 #: build/C/man2/sync_file_range.2:33 build/C/man2/memfd_create.2:24
119 #: build/C/man2/s390_pci_mmio_write.2:29 build/C/man2/membarrier.2:28
120 #: build/C/man2/pkey_alloc.2:28
125 #. asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr,
126 #. unsigned long len, int prot, int flag);
128 #: build/C/man2/alloc_hugepages.2:34
131 "B<void *alloc_hugepages(int >I<key>B<, void *>I<addr>B<, size_t >I<len>B<,>\n"
132 "B< int >I<prot>B<, int >I<flag>B<);>\n"
134 "B<void *alloc_hugepages(int >I<key>B<, void *>I<addr>B<, size_t >I<len>B<,>\n"
135 "B< int >I<prot>B<, int >I<flag>B<);>\n"
137 #. asmlinkage int sys_free_hugepages(unsigned long addr);
139 #: build/C/man2/alloc_hugepages.2:37
141 msgid "B<int free_hugepages(void *>I<addr>B<);>\n"
142 msgstr "B<int free_hugepages(void *>I<addr>B<);>\n"
145 #: build/C/man2/alloc_hugepages.2:38 build/C/man3/alloca.3:50
146 #: build/C/man2/cacheflush.2:38 build/C/man2/fallocate.2:22
147 #: build/C/man2/madvise.2:59 build/C/man3/mallinfo.3:32
148 #: build/C/man3/malloc_get_state.3:36 build/C/man3/malloc_hook.3:33
149 #: build/C/man3/malloc_info.3:34 build/C/man3/malloc_stats.3:32
150 #: build/C/man3/malloc_trim.3:32 build/C/man3/malloc_usable_size.3:32
151 #: build/C/man3/mallopt.3:32 build/C/man3/mcheck.3:40 build/C/man2/mlock.2:40
152 #: build/C/man2/mmap.2:54 build/C/man2/mmap2.2:39 build/C/man2/mprotect.2:47
153 #: build/C/man2/mremap.2:41 build/C/man2/msync.2:32 build/C/man3/mtrace.3:34
154 #: build/C/man2/posix_fadvise.2:51 build/C/man3/posix_fallocate.3:46
155 #: build/C/man3/posix_madvise.3:42 build/C/man3/posix_memalign.3:83
156 #: build/C/man2/readahead.2:38 build/C/man2/remap_file_pages.2:39
157 #: build/C/man3/shm_open.3:40 build/C/man7/shm_overview.7:29
158 #: build/C/man2/shmctl.2:57 build/C/man2/shmget.2:49 build/C/man2/shmop.2:52
159 #: build/C/man2/subpage_prot.2:41 build/C/man2/sync_file_range.2:41
160 #: build/C/man2/memfd_create.2:31 build/C/man2/s390_pci_mmio_write.2:38
161 #: build/C/man2/membarrier.2:38 build/C/man2/pkey_alloc.2:36
162 #: build/C/man7/pkeys.7:28
168 #: build/C/man2/alloc_hugepages.2:49
170 "The system calls B<alloc_hugepages>() and B<free_hugepages>() were "
171 "introduced in Linux 2.5.36 and removed again in 2.5.54. They existed only "
172 "on i386 and ia64 (when built with B<CONFIG_HUGETLB_PAGE>). In Linux 2.4.20, "
173 "the syscall numbers exist, but the calls fail with the error B<ENOSYS>."
175 "システムコール B<alloc_hugepages>() と B<free_hugepages>() は Linux 2.5.36 "
176 "で導入され、2.5.54 で再び削除された。 これらのシステムコールは i386 と ia64 "
177 "のみで (かつ B<CONFIG_HUGETLB_PAGE> を指定してビルドされた場合に) 存在する。 "
178 "Linux 2.4.20 では syscall 番号が存在するが、 呼び出すとエラー B<ENOSYS> で失"
182 #: build/C/man2/alloc_hugepages.2:57
185 #| "On i386 the memory management hardware knows about ordinary pages (4 "
186 #| "KiB) and huge pages (2 or 4 MiB). Similarly ia64 knows about huge pages "
187 #| "of several sizes. These system calls serve to map huge pages into the "
188 #| "process's memory or to free them again. Huge pages are locked into "
189 #| "memory, and are not swapped."
191 "On i386 the memory management hardware knows about ordinary pages (4\\ KiB) "
192 "and huge pages (2 or 4\\ MiB). Similarly ia64 knows about huge pages of "
193 "several sizes. These system calls serve to map huge pages into the "
194 "process's memory or to free them again. Huge pages are locked into memory, "
195 "and are not swapped."
197 "i386 では、メモリー管理ハードウェアは通常のページ (4 KiB) と 大きなサイズの"
198 "ページ (以下、ヒュージページ; 2MiB または 4 MiB) を 扱うことができる。 同様"
199 "に、ia64 もいくつかのサイズのヒュージページを扱うことができる。 これらのシス"
200 "テムコールは、ヒュージページをプロセスのメモリーにマップしたり、 再び解放した"
201 "りする。 ヒュージページはメモリー内にロックされ、スワップされない。"
204 #: build/C/man2/alloc_hugepages.2:66
206 "The I<key> argument is an identifier. When zero the pages are private, and "
207 "not inherited by children. When positive the pages are shared with other "
208 "applications using the same I<key>, and inherited by child processes."
210 "I<key> 引き数は識別子である。 0 の場合、ページは非公開になり、子プロセスに継"
211 "承されない。 正の場合、ページは同じ I<key> を使う他のアプリケーションと共有さ"
215 #: build/C/man2/alloc_hugepages.2:81
217 "The I<addr> argument of B<free_hugepages>() tells which page is being "
218 "freed: it was the return value of a call to B<alloc_hugepages>(). (The "
219 "memory is first actually freed when all users have released it.) The "
220 "I<addr> argument of B<alloc_hugepages>() is a hint, that the kernel may or "
221 "may not follow. Addresses must be properly aligned."
223 "B<free_hugepages>() の I<addr> 引き数は、どのページを解放するかを指定する: "
224 "I<addr> は B<alloc_hugepages>() の呼び出しの返り値である (全てのユーザーがメ"
225 "モリーを解放したときに、 そのメモリーは初めて実際に解放される)。 "
226 "B<alloc_hugepages>() の I<addr> 引き数はヒントであり、カーネルはそれに従うか"
227 "もしれないし、 従わないかもしれない。 アドレスは正しく配置されなければならな"
231 #: build/C/man2/alloc_hugepages.2:86
233 "The I<len> argument is the length of the required segment. It must be a "
234 "multiple of the huge page size."
236 "I<len> 引き数は要求されたセグメントの長さである。 これはヒュージページのサイ"
240 #: build/C/man2/alloc_hugepages.2:94
242 "The I<prot> argument specifies the memory protection of the segment. It is "
243 "one of B<PROT_READ>, B<PROT_WRITE>, B<PROT_EXEC>."
245 "I<prot> 引き数はセグメントのメモリー保護を指定する。 これは B<PROT_READ>, "
246 "B<PROT_WRITE>, B<PROT_EXEC> のいずれかである。"
249 #: build/C/man2/alloc_hugepages.2:109
251 "The I<flag> argument is ignored, unless I<key> is positive. In that case, "
252 "if I<flag> is B<IPC_CREAT>, then a new huge page segment is created when "
253 "none with the given key existed. If this flag is not set, then B<ENOENT> is "
254 "returned when no segment with the given key exists."
256 "I<key> が正でない限り、 I<flag> 引き数は無視される。 I<key> が正で、かつ "
257 "I<flag> が B<IPC_CREAT> であり、かつ指定された I<key> で (セグメントが) 何も"
258 "存在しない場合、 新しいヒュージページセグメントが作成される。 I<flag> が設定"
259 "されておらず、かつ指定された I<key> のセグメントが存在しない場合、 B<ENOENT> "
263 #: build/C/man2/alloc_hugepages.2:109 build/C/man3/alloca.3:60
264 #: build/C/man2/cacheflush.2:57 build/C/man2/fallocate.2:301
265 #: build/C/man2/madvise.2:455 build/C/man3/malloc_get_state.3:64
266 #: build/C/man3/malloc_info.3:48 build/C/man3/malloc_trim.3:52
267 #: build/C/man3/malloc_usable_size.3:40 build/C/man3/mallopt.3:436
268 #: build/C/man3/mcheck.3:129 build/C/man2/mlock.2:177 build/C/man2/mmap.2:490
269 #: build/C/man2/mmap2.2:54 build/C/man2/mprotect.2:139
270 #: build/C/man2/mremap.2:160 build/C/man2/msync.2:71
271 #: build/C/man2/posix_fadvise.2:127 build/C/man3/posix_fallocate.3:66
272 #: build/C/man3/posix_madvise.3:83 build/C/man3/posix_memalign.3:142
273 #: build/C/man2/readahead.2:66 build/C/man2/remap_file_pages.2:138
274 #: build/C/man3/shm_open.3:170 build/C/man2/shmctl.2:364
275 #: build/C/man2/shmget.2:215 build/C/man2/shmop.2:167
276 #: build/C/man2/subpage_prot.2:66 build/C/man2/sync_file_range.2:141
277 #: build/C/man2/memfd_create.2:158 build/C/man2/s390_pci_mmio_write.2:67
278 #: build/C/man2/membarrier.2:236 build/C/man2/pkey_alloc.2:70
284 #: build/C/man2/alloc_hugepages.2:118
286 "On success, B<alloc_hugepages>() returns the allocated virtual address, and "
287 "B<free_hugepages>() returns zero. On error, -1 is returned, and I<errno> "
288 "is set appropriately."
290 "成功した場合、 B<alloc_hugepages>() は割り当てられた仮想アドレスを返し、 "
291 "B<free_hugepages>() は 0 を返す。 失敗した場合、-1 を返し、 I<errno> が適切"
295 #: build/C/man2/alloc_hugepages.2:118 build/C/man2/cacheflush.2:63
296 #: build/C/man2/fallocate.2:308 build/C/man2/madvise.2:462
297 #: build/C/man3/malloc_info.3:55 build/C/man3/malloc_trim.3:57
298 #: build/C/man3/mallopt.3:441 build/C/man2/mlock.2:183 build/C/man2/mmap.2:509
299 #: build/C/man2/mmap2.2:61 build/C/man2/mprotect.2:148
300 #: build/C/man2/mremap.2:168 build/C/man2/msync.2:76
301 #: build/C/man2/posix_fadvise.2:130 build/C/man3/posix_fallocate.3:72
302 #: build/C/man3/posix_madvise.3:88 build/C/man3/posix_memalign.3:165
303 #: build/C/man2/readahead.2:72 build/C/man2/remap_file_pages.2:145
304 #: build/C/man3/shm_open.3:179 build/C/man2/shmctl.2:388
305 #: build/C/man2/shmget.2:220 build/C/man2/shmop.2:181
306 #: build/C/man2/subpage_prot.2:71 build/C/man2/sync_file_range.2:147
307 #: build/C/man2/memfd_create.2:165 build/C/man2/s390_pci_mmio_write.2:76
308 #: build/C/man2/membarrier.2:263 build/C/man2/pkey_alloc.2:80
314 #: build/C/man2/alloc_hugepages.2:119 build/C/man2/fallocate.2:415
315 #: build/C/man2/membarrier.2:278
321 #: build/C/man2/alloc_hugepages.2:122
322 msgid "The system call is not supported on this kernel."
323 msgstr "このシステムコールはカーネルでサポートされていない。"
326 #: build/C/man2/alloc_hugepages.2:122
332 #: build/C/man2/alloc_hugepages.2:123
334 msgid "I</proc/sys/vm/nr_hugepages>"
338 #: build/C/man2/alloc_hugepages.2:127
341 #| "I</proc/sys/vm/nr_hugepages> Number of configured hugetlb pages. This "
342 #| "can be read and written."
343 msgid "Number of configured hugetlb pages. This can be read and written."
345 "I</proc/sys/vm/nr_hugepages> 設定された hugetlb ページの数。 このファイルは読"
349 #: build/C/man2/alloc_hugepages.2:127
351 msgid "I</proc/meminfo>"
355 #: build/C/man2/alloc_hugepages.2:131
358 #| "I</proc/meminfo> Gives info on the number of configured hugetlb pages and "
359 #| "on their size in the three variables HugePages_Total, HugePages_Free, "
362 "Gives info on the number of configured hugetlb pages and on their size in "
363 "the three variables HugePages_Total, HugePages_Free, Hugepagesize."
365 "I</proc/meminfo> 設定された hugetlb ページの数と、 3 つの変数 "
366 "HugePages_Total, HugePages_Free, Hugepagesize の サイズについての情報を提供す"
370 #: build/C/man2/alloc_hugepages.2:131 build/C/man3/alloca.3:77
371 #: build/C/man2/cacheflush.2:80 build/C/man2/fallocate.2:475
372 #: build/C/man2/madvise.2:548 build/C/man3/mallinfo.3:148
373 #: build/C/man3/malloc_get_state.3:103 build/C/man3/malloc_hook.3:82
374 #: build/C/man3/malloc_info.3:76 build/C/man3/malloc_stats.3:67
375 #: build/C/man3/malloc_trim.3:74 build/C/man3/malloc_usable_size.3:60
376 #: build/C/man3/mallopt.3:449 build/C/man3/mcheck.3:166
377 #: build/C/man2/mlock.2:272 build/C/man2/mmap.2:656 build/C/man2/mmap2.2:77
378 #: build/C/man2/mprotect.2:215 build/C/man2/mremap.2:261
379 #: build/C/man2/msync.2:99 build/C/man3/mtrace.3:100
380 #: build/C/man2/posix_fadvise.2:162 build/C/man3/posix_fallocate.3:126
381 #: build/C/man3/posix_madvise.3:107 build/C/man3/posix_memalign.3:212
382 #: build/C/man2/readahead.2:88 build/C/man2/remap_file_pages.2:167
383 #: build/C/man3/shm_open.3:263 build/C/man2/shmctl.2:462
384 #: build/C/man2/shmget.2:280 build/C/man2/shmop.2:227
385 #: build/C/man2/subpage_prot.2:96 build/C/man2/sync_file_range.2:177
386 #: build/C/man2/memfd_create.2:204 build/C/man2/s390_pci_mmio_write.2:99
387 #: build/C/man2/membarrier.2:301 build/C/man2/pkey_alloc.2:109
389 msgid "CONFORMING TO"
393 #: build/C/man2/alloc_hugepages.2:134
395 "These calls are specific to Linux on Intel processors, and should not be "
396 "used in programs intended to be portable."
398 "このシステムコールは Intel プロセッサ上の Linux に固有のものであり、 移植性が"
402 #: build/C/man2/alloc_hugepages.2:134 build/C/man3/alloca.3:85
403 #: build/C/man2/cacheflush.2:93 build/C/man2/madvise.2:569
404 #: build/C/man3/malloc_get_state.3:105 build/C/man3/malloc_hook.3:84
405 #: build/C/man3/malloc_info.3:78 build/C/man3/malloc_stats.3:69
406 #: build/C/man3/malloc_trim.3:76 build/C/man3/malloc_usable_size.3:62
407 #: build/C/man3/mcheck.3:168 build/C/man2/mlock.2:302 build/C/man2/mmap.2:674
408 #: build/C/man2/mmap2.2:79 build/C/man2/mprotect.2:228
409 #: build/C/man2/mremap.2:267 build/C/man2/msync.2:123 build/C/man3/mtrace.3:102
410 #: build/C/man2/posix_fadvise.2:171 build/C/man3/posix_fallocate.3:151
411 #: build/C/man3/posix_madvise.3:109 build/C/man3/posix_memalign.3:252
412 #: build/C/man2/readahead.2:93 build/C/man2/remap_file_pages.2:171
413 #: build/C/man3/shm_open.3:273 build/C/man7/shm_overview.7:100
414 #: build/C/man2/shmctl.2:467 build/C/man2/shmget.2:288 build/C/man2/shmop.2:242
415 #: build/C/man2/subpage_prot.2:98 build/C/man2/sync_file_range.2:180
416 #: build/C/man2/memfd_create.2:208 build/C/man2/s390_pci_mmio_write.2:102
417 #: build/C/man2/membarrier.2:308 build/C/man2/pkey_alloc.2:115
423 #: build/C/man2/alloc_hugepages.2:142
425 "These system calls are gone; they existed only in Linux 2.5.36 through to "
426 "2.5.54. Now the hugetlbfs filesystem can be used instead. Memory backed by "
427 "huge pages (if the CPU supports them) is obtained by using B<mmap>(2) to "
428 "map files in this virtual filesystem."
430 "これらのシステムコールはなくなった。 これらは Linux 2.5.36 から 2.5.54 にのみ"
431 "存在する。 代わりに今は hugetlbfs ファイルシステムを使うことができる。 (CPU "
432 "がサポートしている場合) ヒュージページを持つメモリーは、 B<mmap>(2) を使って"
433 "この仮想ファイルシステムでファイルをマップすることで取得できる。"
436 #. requires CONFIG_HUGETLB_PAGE (under "Processor type and features")
437 #. and CONFIG_HUGETLBFS (under "Filesystems").
438 #. mount \-t hugetlbfs hugetlbfs /huge
441 #: build/C/man2/alloc_hugepages.2:151
443 "The maximal number of huge pages can be specified using the B<hugepages=> "
446 "ヒュージページの最大数は、 B<hugepages=> 起動パラメーターを使って指定できる。"
449 #: build/C/man2/alloc_hugepages.2:151 build/C/man3/alloca.3:178
450 #: build/C/man2/cacheflush.2:161 build/C/man2/fallocate.2:483
451 #: build/C/man2/madvise.2:596 build/C/man3/mallinfo.3:324
452 #: build/C/man3/malloc_get_state.3:131 build/C/man3/malloc_hook.3:147
453 #: build/C/man3/malloc_info.3:272 build/C/man3/malloc_stats.3:79
454 #: build/C/man3/malloc_trim.3:104 build/C/man3/malloc_usable_size.3:76
455 #: build/C/man3/mallopt.3:627 build/C/man3/mcheck.3:229
456 #: build/C/man2/mlock.2:499 build/C/man2/mmap.2:1022 build/C/man2/mmap2.2:101
457 #: build/C/man2/mprotect.2:373 build/C/man2/mremap.2:369
458 #: build/C/man2/msync.2:154 build/C/man3/mtrace.3:192
459 #: build/C/man2/posix_fadvise.2:243 build/C/man3/posix_fallocate.3:193
460 #: build/C/man3/posix_madvise.3:129 build/C/man3/posix_memalign.3:308
461 #: build/C/man2/readahead.2:113 build/C/man2/remap_file_pages.2:191
462 #: build/C/man3/shm_open.3:517 build/C/man7/shm_overview.7:124
463 #: build/C/man2/shmctl.2:520 build/C/man2/shmget.2:426 build/C/man2/shmop.2:508
464 #: build/C/man2/subpage_prot.2:134 build/C/man2/sync_file_range.2:224
465 #: build/C/man2/memfd_create.2:552 build/C/man2/s390_pci_mmio_write.2:108
466 #: build/C/man2/membarrier.2:471 build/C/man2/pkey_alloc.2:140
467 #: build/C/man7/pkeys.7:297
473 #: build/C/man2/alloc_hugepages.2:159 build/C/man3/alloca.3:186
474 #: build/C/man2/cacheflush.2:169 build/C/man2/fallocate.2:491
475 #: build/C/man2/madvise.2:604 build/C/man3/mallinfo.3:332
476 #: build/C/man3/malloc_get_state.3:139 build/C/man3/malloc_hook.3:155
477 #: build/C/man3/malloc_info.3:280 build/C/man3/malloc_stats.3:87
478 #: build/C/man3/malloc_trim.3:112 build/C/man3/malloc_usable_size.3:84
479 #: build/C/man3/mallopt.3:635 build/C/man3/mcheck.3:237
480 #: build/C/man2/mlock.2:507 build/C/man2/mmap.2:1030 build/C/man2/mmap2.2:109
481 #: build/C/man2/mprotect.2:381 build/C/man2/mremap.2:377
482 #: build/C/man2/msync.2:162 build/C/man3/mtrace.3:200
483 #: build/C/man2/posix_fadvise.2:251 build/C/man3/posix_fallocate.3:201
484 #: build/C/man3/posix_madvise.3:137 build/C/man3/posix_memalign.3:316
485 #: build/C/man2/readahead.2:121 build/C/man2/remap_file_pages.2:199
486 #: build/C/man3/shm_open.3:525 build/C/man7/shm_overview.7:132
487 #: build/C/man2/shmctl.2:528 build/C/man2/shmget.2:434 build/C/man2/shmop.2:516
488 #: build/C/man2/subpage_prot.2:142 build/C/man2/sync_file_range.2:232
489 #: build/C/man2/memfd_create.2:560 build/C/man2/s390_pci_mmio_write.2:116
490 #: build/C/man2/membarrier.2:479 build/C/man2/pkey_alloc.2:148
491 #: build/C/man7/pkeys.7:305
493 "This page is part of release 5.10 of the Linux I<man-pages> project. A "
494 "description of the project, information about reporting bugs, and the latest "
495 "version of this page, can be found at \\%https://www.kernel.org/doc/man-"
497 msgstr "この man ページは Linux I<man-pages> プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \\%https://www.kernel.org/doc/man-pages/ に書かれている。"
500 #: build/C/man3/alloca.3:43
506 #: build/C/man3/alloca.3:43 build/C/man2/posix_fadvise.2:29
507 #: build/C/man2/readahead.2:28
509 #| msgid "2014-03-15"
514 #: build/C/man3/alloca.3:43 build/C/man3/malloc_get_state.3:25
515 #: build/C/man3/malloc_hook.3:10 build/C/man3/malloc_info.3:25
516 #: build/C/man3/malloc_usable_size.3:25 build/C/man3/mcheck.3:25
517 #: build/C/man3/mtrace.3:25 build/C/man3/posix_fallocate.3:25
518 #: build/C/man3/posix_memalign.3:29
524 #: build/C/man3/alloca.3:46
525 msgid "alloca - allocate memory that is automatically freed"
526 msgstr "alloca - 自動的に解放されるメモリーを割り当てる"
529 #: build/C/man3/alloca.3:48
530 msgid "B<#include E<lt>alloca.hE<gt>>"
531 msgstr "B<#include E<lt>alloca.hE<gt>>"
534 #: build/C/man3/alloca.3:50
535 msgid "B<void *alloca(size_t >I<size>B<);>"
536 msgstr "B<void *alloca(size_t >I<size>B<);>"
539 #: build/C/man3/alloca.3:60
541 "The B<alloca>() function allocates I<size> bytes of space in the stack "
542 "frame of the caller. This temporary space is automatically freed when the "
543 "function that called B<alloca>() returns to its caller."
545 "B<alloca>() 関数は、 I<size> バイトの領域を呼出元のスタックフレームに割り付"
546 "ける。 この一時的な領域は、 B<alloca>() を呼び出した関数が呼出元に返るときに"
550 #: build/C/man3/alloca.3:65
552 "The B<alloca>() function returns a pointer to the beginning of the "
553 "allocated space. If the allocation causes stack overflow, program behavior "
556 "B<alloca>() 関数は、割り付けた領域の始まりを指すポインターを返す。 割り付け"
557 "によってスタックオーバーフローが起った場合の プログラムの動作は定義されていな"
561 #: build/C/man3/alloca.3:65 build/C/man3/mallinfo.3:122
562 #: build/C/man3/malloc_get_state.3:89 build/C/man3/malloc_info.3:63
563 #: build/C/man3/malloc_stats.3:54 build/C/man3/malloc_trim.3:61
564 #: build/C/man3/malloc_usable_size.3:48 build/C/man3/mcheck.3:145
565 #: build/C/man2/mmap.2:643 build/C/man3/mtrace.3:78
566 #: build/C/man3/posix_fallocate.3:114 build/C/man3/posix_memalign.3:190
567 #: build/C/man3/shm_open.3:249
573 #: build/C/man3/alloca.3:68 build/C/man3/mallinfo.3:125
574 #: build/C/man3/malloc_get_state.3:92 build/C/man3/malloc_info.3:66
575 #: build/C/man3/malloc_stats.3:57 build/C/man3/malloc_trim.3:64
576 #: build/C/man3/malloc_usable_size.3:51 build/C/man3/mcheck.3:148
577 #: build/C/man2/mmap.2:646 build/C/man3/mtrace.3:81
578 #: build/C/man3/posix_fallocate.3:117 build/C/man3/posix_memalign.3:193
579 #: build/C/man3/shm_open.3:252
581 "For an explanation of the terms used in this section, see B<attributes>(7)."
582 msgstr "この節で使用されている用語の説明については、 B<attributes>(7) を参照。"
585 #: build/C/man3/alloca.3:72 build/C/man3/mallinfo.3:129
586 #: build/C/man3/malloc_get_state.3:96 build/C/man3/malloc_info.3:70
587 #: build/C/man3/malloc_stats.3:61 build/C/man3/malloc_trim.3:68
588 #: build/C/man3/malloc_usable_size.3:55 build/C/man3/mcheck.3:152
589 #: build/C/man2/mmap.2:650 build/C/man3/mtrace.3:85
590 #: build/C/man3/posix_fallocate.3:121 build/C/man3/posix_memalign.3:197
591 #: build/C/man3/shm_open.3:256
597 #: build/C/man3/alloca.3:72 build/C/man3/mallinfo.3:129
598 #: build/C/man3/malloc_get_state.3:96 build/C/man3/malloc_info.3:70
599 #: build/C/man3/malloc_stats.3:61 build/C/man3/malloc_trim.3:68
600 #: build/C/man3/malloc_usable_size.3:55 build/C/man3/mcheck.3:152
601 #: build/C/man2/mmap.2:650 build/C/man3/mtrace.3:85
602 #: build/C/man3/posix_fallocate.3:121 build/C/man3/posix_memalign.3:197
603 #: build/C/man3/shm_open.3:256
609 #: build/C/man3/alloca.3:72 build/C/man3/mallinfo.3:129
610 #: build/C/man3/malloc_get_state.3:96 build/C/man3/malloc_info.3:70
611 #: build/C/man3/malloc_stats.3:61 build/C/man3/malloc_trim.3:68
612 #: build/C/man3/malloc_usable_size.3:55 build/C/man3/mcheck.3:152
613 #: build/C/man2/mmap.2:650 build/C/man3/mtrace.3:85
614 #: build/C/man3/posix_fallocate.3:121 build/C/man3/posix_memalign.3:197
615 #: build/C/man3/shm_open.3:256
621 #: build/C/man3/alloca.3:75
627 #: build/C/man3/alloca.3:75 build/C/man3/mallinfo.3:132
628 #: build/C/man3/malloc_get_state.3:100 build/C/man3/malloc_info.3:73
629 #: build/C/man3/malloc_stats.3:64 build/C/man3/malloc_trim.3:71
630 #: build/C/man3/malloc_usable_size.3:58 build/C/man3/mcheck.3:159
631 #: build/C/man2/mmap.2:654 build/C/man3/mtrace.3:89
632 #: build/C/man3/posix_fallocate.3:124 build/C/man3/posix_memalign.3:204
633 #: build/C/man3/posix_memalign.3:209 build/C/man3/shm_open.3:260
635 msgid "Thread safety"
636 msgstr "Thread safety"
639 #: build/C/man3/alloca.3:75 build/C/man3/malloc_get_state.3:100
640 #: build/C/man3/malloc_info.3:73 build/C/man3/malloc_stats.3:64
641 #: build/C/man3/malloc_trim.3:71 build/C/man3/malloc_usable_size.3:58
642 #: build/C/man2/mmap.2:654 build/C/man3/posix_memalign.3:204
648 #: build/C/man3/alloca.3:79
650 #| msgid "This function is not in POSIX.1-2001."
651 msgid "This function is not in POSIX.1."
652 msgstr "この関数は POSIX.1-2001 にはない。"
655 #: build/C/man3/alloca.3:85
657 "There is evidence that the B<alloca>() function appeared in 32V, PWB, "
658 "PWB.2, 3BSD, and 4BSD. There is a man page for it in 4.3BSD. Linux uses "
661 "32V, PWB, PWB.2, 3BSD, 4BSD に B<alloca>() 関数が登場した証拠がある。 "
662 "4.3BSD には、マニュアルページがある。 Linux は、GNU 版を使っている。 この関数"
663 "は POSIX.1-2001 にはない。"
666 #: build/C/man3/alloca.3:100
668 "The B<alloca>() function is machine- and compiler-dependent. For certain "
669 "applications, its use can improve efficiency compared to the use of "
670 "B<malloc>(3) plus B<free>(3). In certain cases, it can also simplify "
671 "memory deallocation in applications that use B<longjmp>(3) or "
672 "B<siglongjmp>(3). Otherwise, its use is discouraged."
674 "B<alloca>() 関数は、機種とコンパイラに依存する。 特定のアプリケーションで"
675 "は、この関数を使うと B<malloc>(3) と B<free>(3) を組み合わせて使った場合に"
676 "比べて効率を改善することができる。 特定の場合では、この関数を使うことで、 "
677 "B<longjmp>(3) や B<siglongjmp>(3) を使うアプリケーションでのメモリーの開放"
678 "を簡単にすることができる。 それ以外の場合では、この関数の使用は推奨されない。"
681 #: build/C/man3/alloca.3:109
683 "Because the space allocated by B<alloca>() is allocated within the stack "
684 "frame, that space is automatically freed if the function return is jumped "
685 "over by a call to B<longjmp>(3) or B<siglongjmp>(3)."
687 "B<alloca>() により割り当てられる空間はスタックフレームから割り当てらるの"
688 "で、 関数の戻り先が B<longjmp>(3) や B<siglongjmp>(3) の呼び出しによりジャ"
689 "ンプした場合には、 割り当てられた空間は自動的に解放される。"
692 #: build/C/man3/alloca.3:116
694 "The space allocated by B<alloca>() is I<not> automatically deallocated if "
695 "the pointer that refers to it simply goes out of scope."
699 #: build/C/man3/alloca.3:121
700 msgid "Do not attempt to B<free>(3) space allocated by B<alloca>()!"
702 "B<alloca>() で割り当てられた空間を B<free>(3) しようとすることのないよう"
706 #: build/C/man3/alloca.3:121
708 msgid "Notes on the GNU version"
709 msgstr "GNU 版についての注意"
712 #: build/C/man3/alloca.3:143
714 "Normally, B<gcc>(1) translates calls to B<alloca>() with inlined code. "
715 "This is not done when either the I<-ansi>, I<-std=c89>, I<-std=c99>, or the "
716 "I<-std=c11> option is given B<and> the header I<E<lt>alloca.hE<gt>> is not "
717 "included. Otherwise, (without an -ansi or -std=c* option) the glibc version "
718 "of I<E<lt>stdlib.hE<gt>> includes I<E<lt>alloca.hE<gt>> and that contains "
721 "通常 B<gcc>(1) は B<alloca>() の呼び出しをインラインコードに変換する。 I<-"
722 "ansi>, I<-std=c89>, I<-std=c99>, I<-std=c11> のいずれかのオプションが指定さ"
723 "れ、B<かつ> I<E<lt>alloca.hE<gt>> がインクルードされていない場合、 この変換は"
724 "行われない。 それ以外の場合 (-ansi オプションも -std=c* オプションも指定され"
725 "ない場合) には、 glibc 版の I<E<lt>stdlib.hE<gt>> は I<E<lt>alloca.hE<gt>> を"
726 "インクルードするが、このファイルには以下の行が含まれており、"
729 #: build/C/man3/alloca.3:149
732 #| " #ifdef __GNUC__\n"
733 #| " #define alloca(size) __builtin_alloca (size)\n"
737 "#define alloca(size) __builtin_alloca (size)\n"
741 " #define alloca(size) __builtin_alloca (size)\n"
745 #: build/C/man3/alloca.3:153
746 msgid "with messy consequences if one has a private version of this function."
747 msgstr "独自版の __builtin_alloca (size) 関数がある場合、厄介な結果になる。"
750 #: build/C/man3/alloca.3:157
752 "The fact that the code is inlined means that it is impossible to take the "
753 "address of this function, or to change its behavior by linking with a "
756 "このコードはインライン化されているので、 この関数のアドレスを取得したり、 他"
757 "のライブラリをリンクして動作を変更することはできない。"
760 #: build/C/man3/alloca.3:161
762 "The inlined code often consists of a single instruction adjusting the stack "
763 "pointer, and does not check for stack overflow. Thus, there is no NULL "
766 "通常このインラインコードはスタックポインターを移動する 1 つの命令 "
767 "(instruction) から構成されており、 スタックオーバーフローをチェックしない。 "
768 "よって NULL エラーが返されることはない。"
771 #: build/C/man3/alloca.3:161 build/C/man2/cacheflush.2:146
772 #: build/C/man3/mallinfo.3:152 build/C/man3/mallopt.3:463
773 #: build/C/man2/mlock.2:443 build/C/man2/mmap.2:866 build/C/man2/mremap.2:333
774 #: build/C/man3/mtrace.3:124 build/C/man2/posix_fadvise.2:231
775 #: build/C/man2/readahead.2:98 build/C/man2/shmget.2:408
781 #: build/C/man3/alloca.3:166
783 "There is no error indication if the stack frame cannot be extended. "
784 "(However, after a failed allocation, the program is likely to receive a "
785 "B<SIGSEGV> signal if it attempts to access the unallocated space.)"
787 "スタックフレームが拡張できなかった場合、エラー通知は行われない。 (しかしなが"
788 "ら、割り当てに失敗した後で、プログラムが割り当てられなかった 空間にアクセスし"
789 "ようとした場合に B<SIGSEGV> シグナルを受信することだろう。)"
792 #: build/C/man3/alloca.3:174
794 "On many systems B<alloca>() cannot be used inside the list of arguments of "
795 "a function call, because the stack space reserved by B<alloca>() would "
796 "appear on the stack in the middle of the space for the function arguments."
798 "多くのシステムにおいて、関数コールの引き数のリスト内では B<alloca>() が使え"
799 "ない。 これは、 B<alloca>() によって予約されるスタック領域が、 関数引き数に"
800 "使われるスタック領域の中に現れてしまうためである。"
803 #: build/C/man3/alloca.3:174 build/C/man2/fallocate.2:478
804 #: build/C/man2/madvise.2:586 build/C/man3/mallinfo.3:315
805 #: build/C/man3/malloc_get_state.3:128 build/C/man3/malloc_hook.3:142
806 #: build/C/man3/malloc_info.3:266 build/C/man3/malloc_stats.3:73
807 #: build/C/man3/malloc_trim.3:100 build/C/man3/malloc_usable_size.3:74
808 #: build/C/man3/mallopt.3:613 build/C/man3/mcheck.3:225
809 #: build/C/man2/mlock.2:491 build/C/man2/mmap.2:994 build/C/man2/mmap2.2:95
810 #: build/C/man2/mprotect.2:369 build/C/man2/mremap.2:354
811 #: build/C/man2/msync.2:150 build/C/man3/mtrace.3:187
812 #: build/C/man2/posix_fadvise.2:236 build/C/man3/posix_fallocate.3:188
813 #: build/C/man3/posix_madvise.3:126 build/C/man3/posix_memalign.3:303
814 #: build/C/man2/readahead.2:107 build/C/man2/remap_file_pages.2:184
815 #: build/C/man3/shm_open.3:505 build/C/man7/shm_overview.7:111
816 #: build/C/man2/shmctl.2:513 build/C/man2/shmget.2:417 build/C/man2/shmop.2:500
817 #: build/C/man2/subpage_prot.2:128 build/C/man2/sync_file_range.2:219
818 #: build/C/man2/memfd_create.2:546 build/C/man2/s390_pci_mmio_write.2:106
819 #: build/C/man2/pkey_alloc.2:137 build/C/man7/pkeys.7:292
825 #: build/C/man3/alloca.3:178
826 msgid "B<brk>(2), B<longjmp>(3), B<malloc>(3)"
827 msgstr "B<brk>(2), B<longjmp>(3), B<malloc>(3)"
830 #: build/C/man2/cacheflush.2:25
836 #: build/C/man2/cacheflush.2:25 build/C/man2/mmap.2:40
837 #: build/C/man3/posix_memalign.3:29 build/C/man2/shmctl.2:46
838 #: build/C/man2/subpage_prot.2:30
840 #| msgid "2014-12-31"
845 #: build/C/man2/cacheflush.2:28
846 msgid "cacheflush - flush contents of instruction and/or data cache"
847 msgstr "cacheflush - 命令キャッシュやデータキャッシュの内容をフラッシュする"
850 #: build/C/man2/cacheflush.2:31
852 msgid "B<#include E<lt>asm/cachectl.hE<gt>>\n"
853 msgstr "B<#include E<lt>asm/cachectl.hE<gt>>\n"
856 #: build/C/man2/cacheflush.2:33
858 msgid "B<int cacheflush(char *>I<addr>B<, int >I<nbytes>B<, int >I<cache>B<);>\n"
859 msgstr "B<int cacheflush(char *>I<addr>B<, int >I<nbytes>B<, int >I<cache>B<);>\n"
862 #: build/C/man2/cacheflush.2:38
864 #| msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
866 "I<Note>: On some architectures, there is no glibc wrapper for this system "
869 "I<注>: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節"
873 #: build/C/man2/cacheflush.2:47
875 "B<cacheflush>() flushes the contents of the indicated cache(s) for the user "
876 "addresses in the range I<addr> to I<(addr+nbytes-1)>. I<cache> may be one "
879 "B<cacheflush>() は I<addr> から I<(addr+nbytes-1)> の範囲のユーザーアドレス"
880 "に対応する 指定されたキャッシュをフラッシュする。 I<cache> には以下のいずれか"
884 #: build/C/man2/cacheflush.2:47
890 #: build/C/man2/cacheflush.2:50
891 msgid "Flush the instruction cache."
892 msgstr "命令 (instruction) キャッシュをフラッシュする。"
895 #: build/C/man2/cacheflush.2:50
901 #: build/C/man2/cacheflush.2:53
902 msgid "Write back to memory and invalidate the affected valid cache lines."
903 msgstr "変更があったキャッシュラインをメモリーに書き戻し、無効にする。"
906 #: build/C/man2/cacheflush.2:53
912 #: build/C/man2/cacheflush.2:57
913 msgid "Same as B<(ICACHE|DCACHE)>."
914 msgstr "B<(ICACHE|DCACHE)> と同じ。"
917 #: build/C/man2/cacheflush.2:63
919 "B<cacheflush>() returns 0 on success or -1 on error. If errors are "
920 "detected, I<errno> will indicate the error."
922 "B<cacheflush>() は成功した場合は 0 を、失敗した場合は -1 を返す。エラーが検"
923 "出された場合は I<errno> にエラーが指示される。"
926 #: build/C/man2/cacheflush.2:64 build/C/man2/mmap2.2:62
927 #: build/C/man2/mremap.2:175 build/C/man2/shmctl.2:397
928 #: build/C/man2/subpage_prot.2:72 build/C/man2/memfd_create.2:166
929 #: build/C/man2/s390_pci_mmio_write.2:77 build/C/man2/s390_pci_mmio_write.2:82
935 #: build/C/man2/cacheflush.2:71
937 "Some or all of the address range I<addr> to I<(addr+nbytes-1)> is not "
940 "I<addr> から I<(addr+nbytes-1)> の範囲のアドレスの全てまたは一部が アクセス可"
944 #: build/C/man2/cacheflush.2:71 build/C/man2/fallocate.2:327
945 #: build/C/man2/fallocate.2:339 build/C/man2/fallocate.2:349
946 #: build/C/man2/fallocate.2:357 build/C/man2/fallocate.2:369
947 #: build/C/man2/fallocate.2:381 build/C/man2/madvise.2:475
948 #: build/C/man2/madvise.2:483 build/C/man2/madvise.2:487
949 #: build/C/man2/madvise.2:497 build/C/man2/madvise.2:506
950 #: build/C/man3/malloc_info.3:56 build/C/man2/mlock.2:219
951 #: build/C/man2/mlock.2:226 build/C/man2/mlock.2:247 build/C/man2/mlock.2:253
952 #: build/C/man2/mmap.2:548 build/C/man2/mmap.2:556 build/C/man2/mmap.2:561
953 #: build/C/man2/mmap2.2:65 build/C/man2/mprotect.2:158
954 #: build/C/man2/mprotect.2:162 build/C/man2/mprotect.2:167
955 #: build/C/man2/mprotect.2:175 build/C/man2/mprotect.2:179
956 #: build/C/man2/mremap.2:184 build/C/man2/msync.2:83
957 #: build/C/man2/posix_fadvise.2:134 build/C/man3/posix_fallocate.3:84
958 #: build/C/man3/posix_madvise.3:89 build/C/man3/posix_madvise.3:95
959 #: build/C/man3/posix_memalign.3:166 build/C/man2/readahead.2:77
960 #: build/C/man2/remap_file_pages.2:146 build/C/man2/remap_file_pages.2:153
961 #: build/C/man3/shm_open.3:212 build/C/man2/shmctl.2:411
962 #: build/C/man2/shmget.2:239 build/C/man2/shmget.2:247 build/C/man2/shmop.2:196
963 #: build/C/man2/shmop.2:219 build/C/man2/subpage_prot.2:77
964 #: build/C/man2/sync_file_range.2:152 build/C/man2/memfd_create.2:171
965 #: build/C/man2/memfd_create.2:175 build/C/man2/memfd_create.2:182
966 #: build/C/man2/s390_pci_mmio_write.2:86 build/C/man2/membarrier.2:264
967 #: build/C/man2/pkey_alloc.2:81
973 #: build/C/man2/cacheflush.2:80
975 #| msgid "I<cache> is not one of B<ICACHE>, B<DCACHE>, or B<BCACHE>."
977 "I<cache> is not one of B<ICACHE>, B<DCACHE>, or B<BCACHE> (but see BUGS)."
979 "I<cache> パラメーターが B<ICACHE>, B<DCACHE>, B<BCACHE> のどれでもない。"
982 #: build/C/man2/cacheflush.2:86
984 "Historically, this system call was available on all MIPS UNIX variants "
985 "including RISC/os, IRIX, Ultrix, NetBSD, OpenBSD, and FreeBSD (and also on "
986 "some non-UNIX MIPS operating systems), so that the existence of this call in "
987 "MIPS operating systems is a de-facto standard."
991 #: build/C/man2/cacheflush.2:86
997 #: build/C/man2/cacheflush.2:93
999 "B<cacheflush>() should not be used in programs intended to be portable. On "
1000 "Linux, this call first appeared on the MIPS architecture, but nowadays, "
1001 "Linux provides a B<cacheflush>() system call on some other architectures, "
1002 "but with different arguments."
1006 #: build/C/man2/cacheflush.2:94 build/C/man2/posix_fadvise.2:199
1008 msgid "Architecture-specific variants"
1009 msgstr "アーキテクチャー固有の派生バージョン"
1012 #: build/C/man2/cacheflush.2:99
1014 "Glibc provides a wrapper for this system call, with the prototype shown in "
1015 "SYNOPSIS, for the following architectures: ARC, CSKY, MIPS, and NIOS2."
1019 #: build/C/man2/cacheflush.2:102
1021 "On some other architectures, Linux provides this system call, with different "
1026 #: build/C/man2/cacheflush.2:102
1032 #: build/C/man2/cacheflush.2:107
1035 #| "B<int sync_file_range(int >I<fd>B<, off64_t >I<offset>B<, off64_t >I<nbytes>B<,>\n"
1036 #| "B< unsigned int >I<flags>B<);>\n"
1038 "B<int cacheflush(unsigned long >I<addr>B<, int >I<scope>B<, int >I<cache>B<,>\n"
1039 "B< unsigned long >I<len>B<);>\n"
1041 "B<int sync_file_range(int >I<fd>B<, off64_t >I<offset>B<, off64_t >I<nbytes>B<,>\n"
1042 "B< unsigned int >I<flags>B<);>\n"
1045 #: build/C/man2/cacheflush.2:108
1051 #: build/C/man2/cacheflush.2:112
1054 #| "B<long subpage_prot(unsigned long >I<addr>B<, unsigned long >I<len>B<,>\n"
1055 #| "B< uint32_t *>I<map>B<);>\n"
1056 msgid "B<int cacheflush(unsigned long >I<addr>B<, unsigned long >I<len>B<, int >I<op>B<);>\n"
1058 "B<long subpage_prot(unsigned long >I<addr>B<, unsigned long >I<len>B<,>\n"
1059 "B< uint32_t *>I<map>B<);>\n"
1062 #: build/C/man2/cacheflush.2:113
1068 #: build/C/man2/cacheflush.2:117
1070 #| msgid "B<int cacheflush(char *>I<addr>B<, int >I<nbytes>B<, int >I<cache>B<);>\n"
1071 msgid "B<int cacheflush(unsigned int >I<start>B<, unsigned int >I<end>B<, int >I<cache>B<);>\n"
1072 msgstr "B<int cacheflush(char *>I<addr>B<, int >I<nbytes>B<, int >I<cache>B<);>\n"
1075 #: build/C/man2/cacheflush.2:122
1078 #| "On some 32-bit architectures, the calling signature for this system call "
1079 #| "differs, for the reasons described in B<syscall>(2)."
1081 "On the above architectures, glibc does not provide a wrapper for this system "
1082 "call; call it using B<syscall>(2)."
1084 "いくつかの 32 ビットアーキテクチャーでは、このシステムコールの呼び出しシグネ"
1085 "チャーが違っている。 理由は B<syscall>(2) で説明されている。"
1088 #: build/C/man2/cacheflush.2:122
1090 msgid "GCC alternative"
1094 #: build/C/man2/cacheflush.2:128
1096 "Unless you need the finer grained control that this system call provides, "
1097 "you probably want to use the GCC built-in function "
1098 "B<__builtin___clear_cache>(), which provides a portable interface across "
1099 "platforms supported by GCC and compatible compilers:"
1103 #: build/C/man2/cacheflush.2:132
1105 #| msgid "B<void (*__free_hook)(void *>I<ptr>B<, const void *>I<caller>B<);>\n"
1106 msgid "B<void __builtin___clear_cache(void *>I<begin>B<, void *>I<end>B<);>\n"
1107 msgstr "B<void (*__free_hook)(void *>I<ptr>B<, const void *>I<caller>B<);>\n"
1110 #: build/C/man2/cacheflush.2:138
1112 "On platforms that don't require instruction cache flushes, "
1113 "B<__builtin___clear_cache>() has no effect."
1117 #: build/C/man2/cacheflush.2:146
1119 "I<Note>: On some GCC-compatible compilers, the prototype for this built-in "
1120 "function uses I<char *> instead of I<void *> for the parameters."
1124 #: build/C/man2/cacheflush.2:153
1127 #| "The current implementation ignores the I<addr> and I<nbytes> arguments. "
1128 #| "Therefore, the whole cache is always flushed."
1130 "Linux kernels older than version 2.6.11 ignore the I<addr> and I<nbytes> "
1131 "arguments, making this function fairly expensive. Therefore, the whole "
1132 "cache is always flushed."
1134 "現在の実装では、引き数 I<addr> と I<nbytes> は無視される。そのため、 常に全て"
1138 #: build/C/man2/cacheflush.2:161
1140 "This function always behaves as if B<BCACHE> has been passed for the "
1141 "I<cache> argument and does not do any error checking on the I<cache> "
1146 #: build/C/man2/fallocate.2:11
1152 #: build/C/man2/fallocate.2:11
1158 #: build/C/man2/fallocate.2:14
1159 msgid "fallocate - manipulate file space"
1160 msgstr "fallocate - ファイル空間の操作"
1163 #: build/C/man2/fallocate.2:18 build/C/man2/readahead.2:35
1166 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
1167 "B<#include E<lt>fcntl.hE<gt>>\n"
1169 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
1170 "B<#include E<lt>fcntl.hE<gt>>\n"
1173 #: build/C/man2/fallocate.2:21
1175 msgid "B<int fallocate(int >I<fd>B<, int >I<mode>B<, off_t >I<offset>B<, off_t >I<len>B<);>\n"
1176 msgstr "B<int fallocate(int >I<fd>B<, int >I<mode>B<, off_t >I<offset>B<, off_t >I<len>B<);>\n"
1179 #: build/C/man2/fallocate.2:27
1181 "This is a nonportable, Linux-specific system call. For the portable, "
1182 "POSIX.1-specified method of ensuring that space is allocated for a file, see "
1183 "B<posix_fallocate>(3)."
1185 "このシステムコールは、移植性のない、Linux 固有のシステムコールである。 移植性"
1186 "が必要な場合は、ファイルに対してディスク空間を確実に確保するために、 POSIX.1 "
1187 "で規定された方法である B<posix_fallocate>(3) を使うこと。"
1190 #: build/C/man2/fallocate.2:37
1192 "B<fallocate>() allows the caller to directly manipulate the allocated disk "
1193 "space for the file referred to by I<fd> for the byte range starting at "
1194 "I<offset> and continuing for I<len> bytes."
1196 "B<fallocate>() を使うと、 I<fd> が参照するファイルに割り当てられたディスク空"
1197 "間を直接操作できる。 操作対象は、 I<offset> から始まる長さ I<len> バイトの領"
1201 #: build/C/man2/fallocate.2:42
1203 "The I<mode> argument determines the operation to be performed on the given "
1204 "range. Details of the supported operations are given in the subsections "
1207 "I<mode> 引き数は、指定された領域に対して実行する操作を指定する。\n"
1208 "サポートされている操作の詳細は以下のサブセクションで説明する。"
1211 #: build/C/man2/fallocate.2:42
1213 msgid "Allocating disk space"
1214 msgstr "ディスク領域の割り当て"
1217 #: build/C/man2/fallocate.2:65
1219 "The default operation (i.e., I<mode> is zero) of B<fallocate>() allocates "
1220 "the disk space within the range specified by I<offset> and I<len>. The file "
1221 "size (as reported by B<stat>(2)) will be changed if I<offset>+I<len> is "
1222 "greater than the file size. Any subregion within the range specified by "
1223 "I<offset> and I<len> that did not contain data before the call will be "
1224 "initialized to zero. This default behavior closely resembles the behavior "
1225 "of the B<posix_fallocate>(3) library function, and is intended as a method "
1226 "of optimally implementing that function."
1228 "B<fallocate>() のデフォルトの動作 (つまり I<mode> が 0 の場合) は、 "
1229 "I<offset> と I<len> で指定された範囲のディスク領域の割り当てを行う。 "
1230 "I<offset>+I<len> がファイルサイズよりも大きかった場合、 (B<stat>(2) で報告さ"
1231 "れる) ファイルサイズが変更される。 I<offset> と I<len> で指定される範囲のサブ"
1232 "領域で、 呼び出し前にデータを保持していなかった場合、そのサブ領域は 0 で初期"
1233 "化される。 このデフォルトの動作は、 ライブラリ関数 B<posix_fallocate>(3) の動"
1234 "作と非常に似ている。 これは、 このシステムコールが B<posix_fallocate>(3) を最"
1235 "適に実装する手段を提供することを目的としているからである。"
1238 #: build/C/man2/fallocate.2:71
1240 "After a successful call, subsequent writes into the range specified by "
1241 "I<offset> and I<len> are guaranteed not to fail because of lack of disk "
1245 "I<offset> と I<len> で指定された範囲へのそれ以降の書き込みでは、\n"
1246 "ディスクの領域不足での書き込み失敗が起こらないことが保証される。"
1249 #: build/C/man2/fallocate.2:82
1251 "If the B<FALLOC_FL_KEEP_SIZE> flag is specified in I<mode>, the behavior of "
1252 "the call is similar, but the file size will not be changed even if I<offset>"
1253 "+I<len> is greater than the file size. Preallocating zeroed blocks beyond "
1254 "the end of the file in this manner is useful for optimizing append workloads."
1256 "B<FALLOC_FL_KEEP_SIZE> フラグが I<mode> に指定された場合、このシステムコー"
1258 "の動作は似ているが、 I<offset>+I<len> がファイルサイズよりも大きい場合で\n"
1259 "あってもファイルサイズは変更されない点が異なる。この場合のファイルの末尾\n"
1260 "よりも後ろの前もって割り当てられた 0 で埋められたブロックは、ファイルへの\n"
1264 #: build/C/man2/fallocate.2:92
1266 "If the B<FALLOC_FL_UNSHARE> flag is specified in I<mode>, shared file data "
1267 "extents will be made private to the file to guarantee that a subsequent "
1268 "write will not fail due to lack of space. Typically, this will be done by "
1269 "performing a copy-on-write operation on all shared data in the file. This "
1270 "flag may not be supported by all filesystems."
1274 #: build/C/man2/fallocate.2:96
1276 "Because allocation is done in block size chunks, B<fallocate>() may "
1277 "allocate a larger range of disk space than was specified."
1279 "割り当てはブロックサイズ単位で行われるため、 B<fallocate>() は指定されたよ"
1281 "も大きなディスク領域を割り当てることがある。"
1284 #: build/C/man2/fallocate.2:96
1286 msgid "Deallocating file space"
1287 msgstr "ファイル空間の割り当て解除"
1290 #: build/C/man2/fallocate.2:111
1293 #| "Specifying the B<FALLOC_FL_PUNCH_HOLE> flag (available since Linux "
1294 #| "2.6.38) in I<mode> deallocates space (i.e., creates a hole) in the byte "
1295 #| "range starting at I<offset> and continuing for I<len> bytes. Within the "
1296 #| "specified range, partial filesystem blocks are zeroed, and whole "
1297 #| "filesystem blocks are removed from the file. After a successful call, "
1298 #| "subsequent reads from this range will return zeroes."
1300 "Specifying the B<FALLOC_FL_PUNCH_HOLE> flag (available since Linux 2.6.38) "
1301 "in I<mode> deallocates space (i.e., creates a hole) in the byte range "
1302 "starting at I<offset> and continuing for I<len> bytes. Within the specified "
1303 "range, partial filesystem blocks are zeroed, and whole filesystem blocks are "
1304 "removed from the file. After a successful call, subsequent reads from this "
1305 "range will return zeros."
1307 "B<FALLOC_FL_PUNCH_HOLE> フラグ (Linux 2.6.38 以降で利用可能) を I<mode> に指"
1308 "定すると、 I<offset> で始まる I<len> バイトの領域の空間を解放する (ホールを作"
1309 "成する)。 指定された範囲のうち、 部分的に使用しているファイルシステムブロック"
1310 "は 0 で埋められ、 全体を使用しているファイルシステムブロックはそのファイルか"
1311 "ら削除される。 呼び出しが成功すると、 これ以降のこの範囲からの読み出しでは 0 "
1315 #: build/C/man2/fallocate.2:122
1317 "The B<FALLOC_FL_PUNCH_HOLE> flag must be ORed with B<FALLOC_FL_KEEP_SIZE> in "
1318 "I<mode>; in other words, even when punching off the end of the file, the "
1319 "file size (as reported by B<stat>(2)) does not change."
1321 "B<FALLOC_FL_PUNCH_HOLE> フラグは B<FALLOC_FL_KEEP_SIZE> と論理和 (OR) をとっ"
1322 "て I<mode> に指定しなければならない。 つまり、 ファイル末尾の punch off を"
1323 "行った場合でも、 (B<stat>(2) で報告される) ファイルサイズが変化しない。"
1326 #: build/C/man2/fallocate.2:127
1328 "Not all filesystems support B<FALLOC_FL_PUNCH_HOLE>; if a filesystem doesn't "
1329 "support the operation, an error is returned. The operation is supported on "
1330 "at least the following filesystems:"
1332 "すべてのファイルシステムで B<FALLOC_FL_PUNCH_HOLE> がサポートされているわけで"
1333 "はない。 ファイルシステムがこの操作をサポートしていない場合は、 エラーが返"
1334 "る。 この操作は少なくとも以下のファイルシステムでサポートされている。"
1337 #: build/C/man2/fallocate.2:127 build/C/man2/fallocate.2:129
1338 #: build/C/man2/fallocate.2:132 build/C/man2/fallocate.2:134
1339 #: build/C/man2/fallocate.2:138 build/C/man2/fallocate.2:237
1340 #: build/C/man2/fallocate.2:240 build/C/man2/fallocate.2:243
1341 #: build/C/man2/fallocate.2:246 build/C/man3/mallopt.3:297
1342 #: build/C/man3/mallopt.3:303 build/C/man2/mremap.2:189
1343 #: build/C/man2/mremap.2:192 build/C/man2/mremap.2:201
1344 #: build/C/man2/mremap.2:204 build/C/man2/mremap.2:209
1345 #: build/C/man2/mremap.2:218 build/C/man2/mremap.2:224
1346 #: build/C/man2/mremap.2:231 build/C/man2/mremap.2:237
1347 #: build/C/man2/mremap.2:240 build/C/man2/mremap.2:250
1348 #: build/C/man2/mremap.2:255 build/C/man2/mremap.2:311
1349 #: build/C/man2/mremap.2:320 build/C/man3/posix_fallocate.3:160
1350 #: build/C/man3/posix_fallocate.3:162 build/C/man3/posix_fallocate.3:165
1351 #: build/C/man3/posix_fallocate.3:169 build/C/man2/memfd_create.2:299
1352 #: build/C/man2/memfd_create.2:309 build/C/man2/memfd_create.2:317
1358 #: build/C/man2/fallocate.2:129
1359 msgid "XFS (since Linux 2.6.38)"
1360 msgstr "XFS (Linux 2.6.38 以降)"
1362 #. commit a4bb6b64e39abc0e41ca077725f2a72c868e7622
1364 #: build/C/man2/fallocate.2:132
1365 msgid "ext4 (since Linux 3.0)"
1366 msgstr "ext4 (Linux 3.0 以降)"
1369 #: build/C/man2/fallocate.2:134
1370 msgid "Btrfs (since Linux 3.7)"
1371 msgstr "Btrfs (Linux 3.7 以降)"
1373 #. commit 83e4fa9c16e4af7122e31be3eca5d57881d236fe
1375 #: build/C/man2/fallocate.2:138
1377 #| msgid "tmpfs (since Linux 3.5)"
1378 msgid "B<tmpfs>(5) (since Linux 3.5)"
1379 msgstr "tmpfs (Linux 3.5 以降)"
1381 #. commit 4e56a6411fbce6f859566e17298114c2434391a4
1383 #: build/C/man2/fallocate.2:142
1385 #| msgid "Btrfs (since Linux 3.7)"
1386 msgid "B<gfs2>(5) (since Linux 4.16)"
1387 msgstr "Btrfs (Linux 3.7 以降)"
1390 #: build/C/man2/fallocate.2:142
1392 msgid "Collapsing file space"
1393 msgstr "ファイル空間の一部削除"
1395 #. commit 00f5e61998dd17f5375d9dfc01331f104b83f841
1397 #: build/C/man2/fallocate.2:162
1399 "Specifying the B<FALLOC_FL_COLLAPSE_RANGE> flag (available since Linux 3.15) "
1400 "in I<mode> removes a byte range from a file, without leaving a hole. The "
1401 "byte range to be collapsed starts at I<offset> and continues for I<len> "
1402 "bytes. At the completion of the operation, the contents of the file "
1403 "starting at the location I<offset+len> will be appended at the location "
1404 "I<offset>, and the file will be I<len> bytes smaller."
1406 "B<FALLOC_FL_COLLAPSE_RANGE> フラグ (Linux 3.15 以降で利用可能) を I<mode> に"
1407 "指定すると、 指定したバイト範囲をファイルから削除する。 その際、ホールを残さ"
1408 "ない。 削除されるバイト範囲は I<offset> から始まる I<len> バイトの範囲であ"
1409 "る。 操作が完了すると、 ファイルの I<offset+len> の位置から始まる内容が "
1410 "I<offset> の位置に見えるようになり、 ファイルのサイズは I<len> バイトだけ小さ"
1414 #: build/C/man2/fallocate.2:176
1417 #| "A filesystem may place limitations on the granularity of the operation, "
1418 #| "in order to ensure efficient implementation. Typically, I<offset> and "
1419 #| "I<len> must be a multiple of the filesystem logical block size, which "
1420 #| "varies according to the filesystem type and configuration. If a "
1421 #| "filesystem has such a requirement, B<fallocate>() will fail with the "
1422 #| "error B<EINVAL> if this requirement is violated."
1424 "A filesystem may place limitations on the granularity of the operation, in "
1425 "order to ensure efficient implementation. Typically, I<offset> and I<len> "
1426 "must be a multiple of the filesystem logical block size, which varies "
1427 "according to the filesystem type and configuration. If a filesystem has "
1428 "such a requirement, B<fallocate>() fails with the error B<EINVAL> if this "
1429 "requirement is violated."
1431 "効率的に動作する実装にするため、ファイルシステムはこの操作の粒度に制限を設け"
1432 "ることがある。 通常は I<offset> と I<len> はファイルシステムの論理ブロックサ"
1433 "イズの倍数でなければならない。 論理ブロックサイズはファイルシステムの種類や設"
1434 "定により様々である。 ファイルシステムにこのような要求条件がある場合、 その要"
1435 "求条件が満たされていなければ、 B<fallocate> はエラー B<EINVAL> で失敗する。"
1438 #: build/C/man2/fallocate.2:185
1440 "If the region specified by I<offset> plus I<len> reaches or passes the end "
1441 "of file, an error is returned; instead, use B<ftruncate>(2) to truncate a "
1444 "I<offset> と I<len> で指定された範囲がファイルの末尾かそれより先まで達してい"
1445 "る場合、 エラーが返される。 代わりに、ファイルの切り詰めを行う "
1446 "B<ftruncate>(2) を使用すること。"
1449 #: build/C/man2/fallocate.2:190
1451 "No other flags may be specified in I<mode> in conjunction with "
1452 "B<FALLOC_FL_COLLAPSE_RANGE>."
1454 "B<FALLOC_FL_COLLAPSE_RANGE> と他のフラグを同時に I<mode> に指定することはでき"
1457 #. commit 9eb79482a97152930b113b51dff530aba9e28c8e
1458 #. commit e1d8fb88a64c1f8094b9f6c3b6d2d9e6719c970d
1460 #: build/C/man2/fallocate.2:198
1462 "As at Linux 3.15, B<FALLOC_FL_COLLAPSE_RANGE> is supported by ext4 (only for "
1463 "extent-based files) and XFS."
1465 "Linux 3.15 時点では B<FALLOC_FL_COLLAPSE_RANGE> は ext4 (エクステントベースの"
1466 "ファイル) と XFS でサポートされている。"
1469 #: build/C/man2/fallocate.2:198
1471 msgid "Zeroing file space"
1472 msgstr "ファイル空間のゼロ埋め"
1474 #. commit 409332b65d3ed8cfa7a8030f1e9d52f372219642
1476 #: build/C/man2/fallocate.2:214
1479 #| "Specifying the B<FALLOC_FL_ZERO_RANGE> flag (available since Linux 3.14) "
1480 #| "in I<mode> zeroes space in the byte range starting at I<offset> and "
1481 #| "continuing for I<len> bytes. Within the specified range, blocks are "
1482 #| "preallocated for the regions that span the holes in the file. After a "
1483 #| "successful call, subsequent reads from this range will return zeroes."
1485 "Specifying the B<FALLOC_FL_ZERO_RANGE> flag (available since Linux 3.15) in "
1486 "I<mode> zeros space in the byte range starting at I<offset> and continuing "
1487 "for I<len> bytes. Within the specified range, blocks are preallocated for "
1488 "the regions that span the holes in the file. After a successful call, "
1489 "subsequent reads from this range will return zeros."
1491 "B<FALLOC_FL_ZERO_RANGE> フラグ (Linux 3.14 以降で利用可能) を I<mode> に指定"
1492 "すると、 I<offset> で始まる I<len> バイト範囲の空間をゼロ埋めする。 指定され"
1493 "た範囲の中では、ブロックは、そのファイル内のホールが広がる領域にあらかじめ割"
1494 "り当てられたものである。 呼び出しが成功すると、 これ以降のこの範囲からの読み"
1498 #: build/C/man2/fallocate.2:220
1500 "Zeroing is done within the filesystem preferably by converting the range "
1501 "into unwritten extents. This approach means that the specified range will "
1502 "not be physically zeroed out on the device (except for partial blocks at the "
1503 "either end of the range), and I/O is (otherwise) required only to update "
1506 "ゼロ埋めは、ファイルシステム内部では、指定された範囲を書き込みを伴わないエク"
1507 "ステントに変換する方法をできるだけ使って行われる。 この方法は、指定された範囲"
1508 "について物理的にゼロ埋めしたデータがデバイスに書き込まれるのではないことを意"
1509 "味する (例外は指定された範囲の端の部分的に使用しているブロックである)。 (これ"
1510 "以外で) I/O が必要なのはメタデータの更新だけである。"
1513 #: build/C/man2/fallocate.2:232
1515 "If the B<FALLOC_FL_KEEP_SIZE> flag is additionally specified in I<mode>, the "
1516 "behavior of the call is similar, but the file size will not be changed even "
1517 "if I<offset>+I<len> is greater than the file size. This behavior is the "
1518 "same as when preallocating space with B<FALLOC_FL_KEEP_SIZE> specified."
1520 "B<FALLOC_FL_KEEP_SIZE> フラグが I<mode> に追加で指定された場合、 このシステム"
1521 "コールの動作は似ているが、 I<offset>+I<len> がファイルサイズよりも大きい場合"
1522 "であってもファイルサイズは変更されない点が異なる。 この動作は "
1523 "B<FALLOC_FL_KEEP_SIZE> を指定してスペースを前もって割り当てた場合と同じであ"
1527 #: build/C/man2/fallocate.2:237
1529 "Not all filesystems support B<FALLOC_FL_ZERO_RANGE>; if a filesystem doesn't "
1530 "support the operation, an error is returned. The operation is supported on "
1531 "at least the following filesystems:"
1533 "すべてのファイルシステムで B<FALLOC_FL_ZERO_RANGE> がサポートされているわけで"
1534 "はない。 ファイルシステムがこの操作をサポートしていない場合は、 エラーが返"
1535 "る。 この操作は少なくとも以下のファイルシステムでサポートされている。"
1537 #. commit 376ba313147b4172f3e8cf620b9fb591f3e8cdfa
1539 #: build/C/man2/fallocate.2:240
1541 #| msgid "XFS (since Linux 3.14)"
1542 msgid "XFS (since Linux 3.15)"
1543 msgstr "XFS (Linux 3.14 以降)"
1545 #. commit b8a8684502a0fc852afa0056c6bb2a9273f6fcc0
1547 #: build/C/man2/fallocate.2:243
1549 #| msgid "ext4, for extent-based files (since Linux 3.14)"
1550 msgid "ext4, for extent-based files (since Linux 3.15)"
1551 msgstr "ext4 のエクステントベースのファイル (Linux 3.14 以降)"
1553 #. commit 30175628bf7f521e9ee31ac98fa6d6fe7441a556
1555 #: build/C/man2/fallocate.2:246
1557 #| msgid "XFS (since Linux 3.14)"
1558 msgid "SMB3 (since Linux 3.17)"
1559 msgstr "XFS (Linux 3.14 以降)"
1561 #. commit f27451f229966874a8793995b8e6b74326d125df
1563 #: build/C/man2/fallocate.2:249
1565 #| msgid "Btrfs (since Linux 3.7)"
1566 msgid "Btrfs (since Linux 4.16)"
1567 msgstr "Btrfs (Linux 3.7 以降)"
1570 #: build/C/man2/fallocate.2:249
1572 #| msgid "Zeroing file space"
1573 msgid "Increasing file space"
1574 msgstr "ファイル空間のゼロ埋め"
1576 #. commit dd46c787788d5bf5b974729d43e4c405814a4c7d
1578 #: build/C/man2/fallocate.2:272
1581 #| "Specifying the B<FALLOC_FL_COLLAPSE_RANGE> flag (available since Linux "
1582 #| "3.15) in I<mode> removes a byte range from a file, without leaving a "
1583 #| "hole. The byte range to be collapsed starts at I<offset> and continues "
1584 #| "for I<len> bytes. At the completion of the operation, the contents of "
1585 #| "the file starting at the location I<offset+len> will be appended at the "
1586 #| "location I<offset>, and the file will be I<len> bytes smaller."
1588 "Specifying the B<FALLOC_FL_INSERT_RANGE> flag (available since Linux 4.1) "
1589 "in I<mode> increases the file space by inserting a hole within the file size "
1590 "without overwriting any existing data. The hole will start at I<offset> and "
1591 "continue for I<len> bytes. When inserting the hole inside file, the "
1592 "contents of the file starting at I<offset> will be shifted upward (i.e., to "
1593 "a higher file offset) by I<len> bytes. Inserting a hole inside a file "
1594 "increases the file size by I<len> bytes."
1596 "B<FALLOC_FL_COLLAPSE_RANGE> フラグ (Linux 3.15 以降で利用可能) を I<mode> に"
1597 "指定すると、 指定したバイト範囲をファイルから削除する。 その際、ホールを残さ"
1598 "ない。 削除されるバイト範囲は I<offset> から始まる I<len> バイトの範囲であ"
1599 "る。 操作が完了すると、 ファイルの I<offset+len> の位置から始まる内容が "
1600 "I<offset> の位置に見えるようになり、 ファイルのサイズは I<len> バイトだけ小さ"
1604 #: build/C/man2/fallocate.2:286
1606 "This mode has the same limitations as B<FALLOC_FL_COLLAPSE_RANGE> regarding "
1607 "the granularity of the operation. If the granularity requirements are not "
1608 "met, B<fallocate>() fails with the error B<EINVAL>. If the I<offset> is "
1609 "equal to or greater than the end of file, an error is returned. For such "
1610 "operations (i.e., inserting a hole at the end of file), B<ftruncate>(2) "
1615 #: build/C/man2/fallocate.2:291
1618 #| "No other flags may be specified in I<mode> in conjunction with "
1619 #| "B<FALLOC_FL_COLLAPSE_RANGE>."
1621 "No other flags may be specified in I<mode> in conjunction with "
1622 "B<FALLOC_FL_INSERT_RANGE>."
1624 "B<FALLOC_FL_COLLAPSE_RANGE> と他のフラグを同時に I<mode> に指定することはでき"
1627 #. commit a904b1ca5751faf5ece8600e18cd3b674afcca1b
1628 #. commit 331573febb6a224bc50322e3670da326cb7f4cfc
1629 #. f2fs also has support since Linux 4.2
1630 #. commit f62185d0e283e9d311e3ac1020f159d95f0aab39
1632 #: build/C/man2/fallocate.2:301
1634 "B<FALLOC_FL_INSERT_RANGE> requires filesystem support. Filesystems that "
1635 "support this operation include XFS (since Linux 4.1) and ext4 (since Linux "
1640 #: build/C/man2/fallocate.2:308
1642 "On success, B<fallocate>() returns zero. On error, -1 is returned and "
1643 "I<errno> is set to indicate the error."
1645 "成功の場合、 B<fallocate>() は 0 を返す。 エラーの場合、-1 を返し、 I<errno> "
1649 #: build/C/man2/fallocate.2:309 build/C/man2/madvise.2:472
1650 #: build/C/man2/mmap.2:532 build/C/man2/posix_fadvise.2:131
1651 #: build/C/man3/posix_fallocate.3:73 build/C/man2/readahead.2:73
1652 #: build/C/man2/sync_file_range.2:148
1658 #: build/C/man2/fallocate.2:313 build/C/man3/posix_fallocate.3:77
1659 msgid "I<fd> is not a valid file descriptor, or is not opened for writing."
1661 "I<fd> が有効なファイルディスクリプターでないか、 書き込み用としてオープンされ"
1665 #: build/C/man2/fallocate.2:313 build/C/man2/fallocate.2:317
1666 #: build/C/man3/posix_fallocate.3:77
1672 #: build/C/man2/fallocate.2:317
1673 msgid "I<offset>+I<len> exceeds the maximum file size."
1674 msgstr "I<offset + len> がファイルサイズの最大値よりも大きい。"
1677 #: build/C/man2/fallocate.2:323
1680 #| "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> and the range specified by "
1681 #| "I<offset> plus I<len> reaches or passes the end of the file."
1683 "I<mode> is B<FALLOC_FL_INSERT_RANGE>, and the current file size+I<len> "
1684 "exceeds the maximum file size."
1686 "I<mode> が B<FALLOC_FL_COLLAPSE_RANGE> で、 I<offset> と I<len> で指定された"
1687 "範囲がファイルの末尾かそれより先まで達している。"
1690 #: build/C/man2/fallocate.2:323 build/C/man3/posix_fallocate.3:81
1696 #: build/C/man2/fallocate.2:327
1698 #| msgid "A signal was caught during execution."
1699 msgid "A signal was caught during execution; see B<signal>(7)."
1700 msgstr "実行中にシグナルが捕捉された。"
1702 #. FIXME . (raise a kernel bug) Probably the len==0 case should be
1703 #. a no-op, rather than an error. That would be consistent with
1704 #. similar APIs for the len==0 case.
1705 #. See "Re: [PATCH] fallocate.2: add FALLOC_FL_PUNCH_HOLE flag definition"
1707 #. http://thread.gmane.org/gmane.linux.file-systems/48331/focus=1193526
1709 #: build/C/man2/fallocate.2:339
1710 msgid "I<offset> was less than 0, or I<len> was less than or equal to 0."
1711 msgstr "I<offset> が 0 未満だったか、 I<len> が 0 以下だった。"
1714 #: build/C/man2/fallocate.2:349
1716 "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> and the range specified by I<offset> "
1717 "plus I<len> reaches or passes the end of the file."
1719 "I<mode> が B<FALLOC_FL_COLLAPSE_RANGE> で、 I<offset> と I<len> で指定された"
1720 "範囲がファイルの末尾かそれより先まで達している。"
1723 #: build/C/man2/fallocate.2:357
1726 #| "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> and the range specified by "
1727 #| "I<offset> plus I<len> reaches or passes the end of the file."
1729 "I<mode> is B<FALLOC_FL_INSERT_RANGE> and the range specified by I<offset> "
1730 "reaches or passes the end of the file."
1732 "I<mode> が B<FALLOC_FL_COLLAPSE_RANGE> で、 I<offset> と I<len> で指定された"
1733 "範囲がファイルの末尾かそれより先まで達している。"
1736 #: build/C/man2/fallocate.2:369
1739 #| "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE>, but either I<offset> or I<len> is "
1740 #| "not a multiple of the filesystem block size."
1742 "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> or B<FALLOC_FL_INSERT_RANGE>, but "
1743 "either I<offset> or I<len> is not a multiple of the filesystem block size."
1745 "I<mode> が B<FALLOC_FL_COLLAPSE_RANGE> だが、 I<offset> か I<len> のいずれか"
1746 "がファイルシステムのブロックサイズの倍数ではない。"
1749 #: build/C/man2/fallocate.2:381
1752 #| "I<mode> contains both B<FALLOC_FL_COLLAPSE_RANGE> and other flags; no "
1753 #| "other flags are permitted with B<FALLOC_FL_COLLAPSE_RANGE>."
1755 "I<mode> contains one of B<FALLOC_FL_COLLAPSE_RANGE> or "
1756 "B<FALLOC_FL_INSERT_RANGE> and also other flags; no other flags are permitted "
1757 "with B<FALLOC_FL_COLLAPSE_RANGE> or B<FALLOC_FL_INSERT_RANGE>."
1759 "I<mode> に B<FALLOC_FL_COLLAPSE_RANGE> と他のフラグの両方が指定されている。 "
1760 "B<FALLOC_FL_COLLAPSE_RANGE> と他のフラグを一緒に使うことができない。"
1762 #. There was an inconsistency in 3.15-rc1, that should be resolved so that all
1763 #. filesystems use this error for this case. (Tytso says ex4 will change.)
1764 #. http://thread.gmane.org/gmane.comp.file-systems.xfs.general/60485/focus=5521
1765 #. From: Michael Kerrisk (man-pages <mtk.manpages@...>
1766 #. Subject: Re: [PATCH v5 10/10] manpage: update FALLOC_FL_COLLAPSE_RANGE flag in fallocate
1767 #. Newsgroups: gmane.linux.man, gmane.linux.file-systems
1768 #. Date: 2014-04-17 13:40:05 GMT
1770 #: build/C/man2/fallocate.2:400
1773 #| "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> or B<FALLOC_FL_ZERO_RANGE>, but "
1774 #| "the file referred to by I<fd> is not a regular file."
1776 "I<mode> is B<FALLOC_FL_COLLAPSE_RANGE> or B<FALLOC_FL_ZERO_RANGE> or "
1777 "B<FALLOC_FL_INSERT_RANGE>, but the file referred to by I<fd> is not a "
1780 "I<mode> が B<FALLOC_FL_COLLAPSE_RANGE> か B<FALLOC_FL_ZERO_RANGE> だが、 "
1781 "I<fd> が参照しているファイルが通常のファイルではない。"
1784 #: build/C/man2/fallocate.2:400 build/C/man2/madvise.2:518
1785 #: build/C/man2/sync_file_range.2:160
1791 #: build/C/man2/fallocate.2:403
1792 msgid "An I/O error occurred while reading from or writing to a filesystem."
1793 msgstr "ファイルシステムとの読み書き中に入出力エラーが発生した。"
1796 #: build/C/man2/fallocate.2:403 build/C/man2/mmap.2:577
1797 #: build/C/man3/posix_fallocate.3:91 build/C/man2/s390_pci_mmio_write.2:91
1803 #: build/C/man2/fallocate.2:410
1805 "I<fd> does not refer to a regular file or a directory. (If I<fd> is a pipe "
1806 "or FIFO, a different error results.)"
1808 "I<fd> が通常のファイルかディレクトリを参照していない (I<fd> がパイプや FIFO "
1809 "を参照している場合、別のエラーが発生する)。"
1812 #: build/C/man2/fallocate.2:410 build/C/man3/posix_fallocate.3:95
1813 #: build/C/man2/shmget.2:265 build/C/man2/sync_file_range.2:166
1814 #: build/C/man2/pkey_alloc.2:88
1820 #: build/C/man2/fallocate.2:415 build/C/man3/posix_fallocate.3:100
1822 "There is not enough space left on the device containing the file referred to "
1824 msgstr "I<fd> が参照するファイルを含むデバイスに十分な空き領域がない。"
1827 #: build/C/man2/fallocate.2:419
1828 msgid "This kernel does not implement B<fallocate>()."
1829 msgstr "このカーネルでは B<fallocate>() は実装されていない。"
1832 #: build/C/man2/fallocate.2:419 build/C/man3/posix_fallocate.3:100
1834 msgid "B<EOPNOTSUPP>"
1835 msgstr "B<EOPNOTSUPP>"
1838 #: build/C/man2/fallocate.2:428
1840 "The filesystem containing the file referred to by I<fd> does not support "
1841 "this operation; or the I<mode> is not supported by the filesystem containing "
1842 "the file referred to by I<fd>."
1844 "I<fd> が参照するファイルを含むファイルシステムが 指定された操作を\n"
1845 "サポートしていない。 I<fd> が参照するファイルを含むファイルシステムが\n"
1846 "I<mode> をサポートしていない。"
1849 #: build/C/man2/fallocate.2:428 build/C/man2/fallocate.2:434
1850 #: build/C/man2/fallocate.2:449 build/C/man2/madvise.2:533
1851 #: build/C/man2/mlock.2:204 build/C/man2/mlock.2:264 build/C/man2/mmap.2:612
1852 #: build/C/man2/mmap.2:621 build/C/man2/shmctl.2:438 build/C/man2/shmget.2:273
1853 #: build/C/man2/membarrier.2:283
1859 #: build/C/man2/fallocate.2:434
1860 msgid "The file referred to by I<fd> is marked immutable (see B<chattr>(1))."
1862 "I<fd> が参照するファイルに変更不可 (immutable) の属性が付いている "
1863 "(B<chattr>(1) 参照)。"
1866 #: build/C/man2/fallocate.2:449
1869 #| "I<mode> specifies B<FALLOC_FL_PUNCH_HOLE> or B<FALLOC_FL_COLLAPSE_RANGE> "
1870 #| "and the file referred to by I<fd> is marked append-only (see "
1873 "I<mode> specifies B<FALLOC_FL_PUNCH_HOLE> or B<FALLOC_FL_COLLAPSE_RANGE> or "
1874 "B<FALLOC_FL_INSERT_RANGE> and the file referred to by I<fd> is marked append-"
1875 "only (see B<chattr>(1))."
1877 "I<mode> に B<FALLOC_FL_PUNCH_HOLE> か B<FALLOC_FL_COLLAPSE_RANGE> が指定され"
1878 "たが、 I<fd> が参照するファイルに追加のみ (append-only) の属性が付いている "
1879 "(B<chattr>(1) 参照)。"
1882 #: build/C/man2/fallocate.2:453 build/C/man2/mmap.2:625
1883 msgid "The operation was prevented by a file seal; see B<fcntl>(2)."
1884 msgstr "操作が file seal により禁止されている。 B<fcntl>(2) 参照。"
1887 #: build/C/man2/fallocate.2:453 build/C/man2/posix_fadvise.2:137
1888 #: build/C/man3/posix_fallocate.3:107 build/C/man2/sync_file_range.2:169
1894 #: build/C/man2/fallocate.2:457
1895 msgid "I<fd> refers to a pipe or FIFO."
1896 msgstr "I<fd> がパイプか FIFO を参照している。"
1899 #: build/C/man2/fallocate.2:457 build/C/man2/mmap.2:625
1905 #: build/C/man2/fallocate.2:467
1908 #| "I<mode> specifies B<FALLOC_FL_COLLAPSE_RANGE>, but the file referred to "
1909 #| "by I<fd> is currently being executed."
1911 "I<mode> specifies B<FALLOC_FL_COLLAPSE_RANGE> or B<FALLOC_FL_INSERT_RANGE>, "
1912 "but the file referred to by I<fd> is currently being executed."
1914 "I<mode> に B<FALLOC_FL_COLLAPSE_RANGE> が指定されたが、 I<fd> が参照するファ"
1918 #: build/C/man2/fallocate.2:467 build/C/man2/madvise.2:541
1919 #: build/C/man3/malloc_info.3:60 build/C/man3/mcheck.3:134
1920 #: build/C/man2/mlock.2:268 build/C/man2/mmap2.2:74 build/C/man2/mprotect.2:211
1921 #: build/C/man2/posix_fadvise.2:147 build/C/man3/posix_fallocate.3:111
1922 #: build/C/man3/posix_madvise.3:103 build/C/man3/posix_memalign.3:175
1923 #: build/C/man2/readahead.2:83 build/C/man2/remap_file_pages.2:162
1924 #: build/C/man3/shm_open.3:247 build/C/man2/subpage_prot.2:90
1925 #: build/C/man2/sync_file_range.2:174 build/C/man2/memfd_create.2:199
1926 #: build/C/man2/s390_pci_mmio_write.2:97 build/C/man2/membarrier.2:287
1927 #: build/C/man2/pkey_alloc.2:103
1932 #. See http://sourceware.org/bugzilla/show_bug.cgi?id=14964
1934 #: build/C/man2/fallocate.2:475
1936 "B<fallocate>() is available on Linux since kernel 2.6.23. Support is "
1937 "provided by glibc since version 2.10. The B<FALLOC_FL_*> flags are defined "
1938 "in glibc headers only since version 2.18."
1940 "B<fallocate>() はカーネル 2.6.23 以降の Linux で利用可能である。 glibc での"
1941 "対応はバージョン 3.10 以降で行われている。 B<FALLOC_FL_*> が glibc のヘッダー"
1942 "ファイルで定義されているのは、バージョン 2.18 以降のみである。"
1945 #: build/C/man2/fallocate.2:478
1946 msgid "B<fallocate>() is Linux-specific."
1947 msgstr "B<fallocate>() は Linux 固有である。"
1950 #: build/C/man2/fallocate.2:483
1952 "B<fallocate>(1), B<ftruncate>(2), B<posix_fadvise>(3), B<posix_fallocate>(3)"
1954 "B<fallocate>(1), B<ftruncate>(2), B<posix_fadvise>(3), B<posix_fallocate>(3)"
1957 #: build/C/man2/madvise.2:35
1963 #: build/C/man2/madvise.2:35 build/C/man2/mlock.2:26 build/C/man2/shmget.2:38
1964 #: build/C/man2/shmop.2:40
1966 #| msgid "2012-04-18"
1971 #: build/C/man2/madvise.2:38
1972 msgid "madvise - give advice about use of memory"
1973 msgstr "madvise - メモリー利用に関するアドバイスを与える"
1976 #: build/C/man2/madvise.2:40 build/C/man2/msync.2:30 build/C/man3/shm_open.3:30
1977 msgid "B<#include E<lt>sys/mman.hE<gt>>"
1978 msgstr "B<#include E<lt>sys/mman.hE<gt>>"
1981 #: build/C/man2/madvise.2:42
1983 "B<int madvise(void *>I<addr>B<, size_t >I<length>B<, int >I<advice>B<);>"
1985 "B<int madvise(void *>I<addr>B<, size_t >I<length>B<, int >I<advice>B<);>"
1988 #: build/C/man2/madvise.2:46 build/C/man2/posix_fadvise.2:44
1989 #: build/C/man3/posix_fallocate.3:39 build/C/man3/posix_madvise.3:33
1990 #: build/C/man3/posix_memalign.3:49
1992 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1993 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
1996 #: build/C/man2/madvise.2:49
1998 #| msgid "B<posix_fadvise>():"
1999 msgid "B<madvise>():"
2000 msgstr "B<posix_fadvise>():"
2003 #: build/C/man2/madvise.2:51
2005 #| msgid "Since glibc 2.12:"
2006 msgid "Since glibc 2.19:"
2007 msgstr "glibc 2.12 以降:"
2010 #: build/C/man2/madvise.2:54
2011 msgid "_DEFAULT_SOURCE"
2015 #: build/C/man2/madvise.2:54
2017 msgid "Up to and including glibc 2.19:"
2021 #: build/C/man2/madvise.2:57
2023 #| msgid "B<madvise>(): _BSD_SOURCE"
2025 msgstr "B<madvise>(): _BSD_SOURCE"
2028 #: build/C/man2/madvise.2:70
2030 "The B<madvise>() system call is used to give advice or directions to the "
2031 "kernel about the address range beginning at address I<addr> and with size "
2032 "I<length> bytes In most cases, the goal of such advice is to improve system "
2033 "or application performance."
2037 #. ======================================================================
2039 #: build/C/man2/madvise.2:83
2041 "Initially, the system call supported a set of \"conventional\" I<advice> "
2042 "values, which are also available on several other implementations. (Note, "
2043 "though, that B<madvise>() is not specified in POSIX.) Subsequently, a "
2044 "number of Linux-specific I<advice> values have been added."
2048 #: build/C/man2/madvise.2:83
2050 msgid "Conventional advice values"
2054 #: build/C/man2/madvise.2:102
2057 #| "The B<madvise>() system call advises the kernel about how to handle "
2058 #| "paging input/output in the address range beginning at address I<addr> and "
2059 #| "with size I<length> bytes. It allows an application to tell the kernel "
2060 #| "how it expects to use some mapped or shared memory areas, so that the "
2061 #| "kernel can choose appropriate read-ahead and caching techniques. This "
2062 #| "call does not influence the semantics of the application (except in the "
2063 #| "case of B<MADV_DONTNEED>), but may influence its performance. The kernel "
2064 #| "is free to ignore the advice."
2066 "The I<advice> values listed below allow an application to tell the kernel "
2067 "how it expects to use some mapped or shared memory areas, so that the kernel "
2068 "can choose appropriate read-ahead and caching techniques. These I<advice> "
2069 "values do not influence the semantics of the application (except in the case "
2070 "of B<MADV_DONTNEED>), but may influence its performance. All of the "
2071 "I<advice> values listed here have analogs in the POSIX-specified "
2072 "B<posix_madvise>(3) function, and the values have the same meanings, with "
2073 "the exception of B<MADV_DONTNEED>."
2075 "B<madvise>() システムコールは、アドレス I<addr> からはじまる I<length> バイ"
2076 "トのメモリーブロックのページング入出力をどう扱えば良いか、 カーネルにアドバイ"
2077 "スする。 これを用いると、 アプリケーションからカーネルに、 マップされたメモ"
2078 "リーや共有メモリーをどのように扱ってほしいか伝えることができ、 カーネルはそれ"
2079 "に応じて先読みやキャッシュなどの適切な手法を選択できる。 このコールはアプリ"
2080 "ケーションの動作そのものには影響しない (B<MADV_DONTNEED> の場合は別) が、 性"
2081 "能には影響しうる。 なおこのアドバイスを受け入れるかどうかはカーネルに任され"
2085 #: build/C/man2/madvise.2:106
2087 #| msgid "The advice is indicated in the I<advice> argument which can be"
2089 "The advice is indicated in the I<advice> argument, which is one of the "
2092 "アドバイスは引き数 I<advice> によって与える。以下のいずれかを指定できる。"
2095 #: build/C/man2/madvise.2:106
2097 msgid "B<MADV_NORMAL>"
2098 msgstr "B<MADV_NORMAL>"
2101 #: build/C/man2/madvise.2:110
2102 msgid "No special treatment. This is the default."
2103 msgstr "特別な扱いは行わない。これがデフォルトである。"
2106 #: build/C/man2/madvise.2:110
2108 msgid "B<MADV_RANDOM>"
2109 msgstr "B<MADV_RANDOM>"
2112 #: build/C/man2/madvise.2:114
2114 "Expect page references in random order. (Hence, read ahead may be less "
2115 "useful than normally.)"
2117 "ページ参照はランダムな順序で行われそうだ。 (したがって、先読みはあまり効果が"
2121 #: build/C/man2/madvise.2:114
2123 msgid "B<MADV_SEQUENTIAL>"
2124 msgstr "B<MADV_SEQUENTIAL>"
2127 #: build/C/man2/madvise.2:119
2129 "Expect page references in sequential order. (Hence, pages in the given "
2130 "range can be aggressively read ahead, and may be freed soon after they are "
2133 "ページ参照はシーケンシャルな順序で行われそうだ。 (したがって与えた範囲のペー"
2134 "ジは積極的に先読みしておくと良いだろう。 またアクセスが終わったら速やかに解放"
2138 #: build/C/man2/madvise.2:119
2140 msgid "B<MADV_WILLNEED>"
2141 msgstr "B<MADV_WILLNEED>"
2144 #: build/C/man2/madvise.2:123
2146 "Expect access in the near future. (Hence, it might be a good idea to read "
2147 "some pages ahead.)"
2149 "近い将来にアクセスされそうだ。 (したがってこれらのページを今のうちに先読みし"
2153 #: build/C/man2/madvise.2:123
2155 msgid "B<MADV_DONTNEED>"
2156 msgstr "B<MADV_DONTNEED>"
2159 #: build/C/man2/madvise.2:128
2161 "Do not expect access in the near future. (For the time being, the "
2162 "application is finished with the given range, so the kernel can free "
2163 "resources associated with it.)"
2167 #: build/C/man2/madvise.2:139
2169 "After a successful B<MADV_DONTNEED> operation, the semantics of memory "
2170 "access in the specified region are changed: subsequent accesses of pages in "
2171 "the range will succeed, but will result in either repopulating the memory "
2172 "contents from the up-to-date contents of the underlying mapped file (for "
2173 "shared file mappings, shared anonymous mappings, and shmem-based techniques "
2174 "such as System V shared memory segments) or zero-fill-on-demand pages for "
2175 "anonymous private mappings."
2179 #: build/C/man2/madvise.2:146
2181 "Note that, when applied to shared mappings, B<MADV_DONTNEED> might not lead "
2182 "to immediate freeing of the pages in the range. The kernel is free to delay "
2183 "freeing the pages until an appropriate moment. The resident set size (RSS) "
2184 "of the calling process will be immediately reduced however."
2188 #. http://lwn.net/Articles/162860/
2189 #. ======================================================================
2191 #: build/C/man2/madvise.2:161
2193 "B<MADV_DONTNEED> cannot be applied to locked pages, Huge TLB pages, or "
2194 "B<VM_PFNMAP> pages. (Pages marked with the kernel-internal B<VM_PFNMAP> "
2195 "flag are special memory areas that are not managed by the virtual memory "
2196 "subsystem. Such pages are typically created by device drivers that map the "
2197 "pages into user space.)"
2201 #: build/C/man2/madvise.2:161
2203 msgid "Linux-specific advice values"
2207 #: build/C/man2/madvise.2:170
2209 "The following Linux-specific I<advice> values have no counterparts in the "
2210 "POSIX-specified B<posix_madvise>(3), and may or may not have counterparts in "
2211 "the B<madvise>() interface available on other implementations. Note that "
2212 "some of these operations change the semantics of memory accesses."
2216 #: build/C/man2/madvise.2:170
2218 msgid "B<MADV_REMOVE> (since Linux 2.6.16)"
2219 msgstr "B<MADV_REMOVE> (Linux 2.6.16 以降)"
2221 #. commit f6b3ec238d12c8cc6cc71490c6e3127988460349
2222 #. Databases want to use this feature to drop a section of their
2223 #. bufferpool (shared memory segments) - without writing back to
2224 #. disk/swap space. This feature is also useful for supporting
2225 #. hot-plug memory on UML.
2227 #: build/C/man2/madvise.2:184
2229 "Free up a given range of pages and its associated backing store. This is "
2230 "equivalent to punching a hole in the corresponding byte range of the backing "
2231 "store (see B<fallocate>(2)). Subsequent accesses in the specified address "
2232 "range will see bytes containing zero."
2236 #: build/C/man2/madvise.2:189
2238 "The specified address range must be mapped shared and writable. This flag "
2239 "cannot be applied to locked pages, Huge TLB pages, or B<VM_PFNMAP> pages."
2242 #. commit 3f31d07571eeea18a7d34db9af21d2285b807a17
2244 #: build/C/man2/madvise.2:205
2246 "In the initial implementation, only B<tmpfs>(5) was supported "
2247 "B<MADV_REMOVE>; but since Linux 3.5, any filesystem which supports the "
2248 "B<fallocate>(2) B<FALLOC_FL_PUNCH_HOLE> mode also supports B<MADV_REMOVE>. "
2249 "Hugetlbfs fails with the error B<EINVAL> and other filesystems fail with the "
2250 "error B<EOPNOTSUPP>."
2254 #: build/C/man2/madvise.2:205
2256 msgid "B<MADV_DONTFORK> (since Linux 2.6.16)"
2257 msgstr "B<MADV_DONTFORK> (Linux 2.6.16 以降)"
2259 #. commit f822566165dd46ff5de9bf895cfa6c51f53bb0c4
2260 #. See http://lwn.net/Articles/171941/
2261 #. [PATCH] madvise MADV_DONTFORK/MADV_DOFORK
2262 #. Currently, copy-on-write may change the physical address of
2263 #. a page even if the user requested that the page is pinned in
2264 #. memory (either by mlock or by get_user_pages). This happens
2265 #. if the process forks meanwhile, and the parent writes to that
2266 #. page. As a result, the page is orphaned: in case of
2267 #. get_user_pages, the application will never see any data hardware
2268 #. DMA's into this page after the COW. In case of mlock'd memory,
2269 #. the parent is not getting the realtime/security benefits of mlock.
2270 #. In particular, this affects the Infiniband modules which do DMA from
2271 #. and into user pages all the time.
2272 #. This patch adds madvise options to control whether memory range is
2273 #. inherited across fork. Useful e.g. for when hardware is doing DMA
2274 #. from/into these pages. Could also be useful to an application
2275 #. wanting to speed up its forks by cutting large areas out of
2277 #. SEE ALSO: http://lwn.net/Articles/171941/
2278 #. "Tweaks to madvise() and posix_fadvise()", 14 Feb 2006
2280 #: build/C/man2/madvise.2:237
2283 #| "Do not make the pages in this range available to the child after a "
2284 #| "B<fork>(2). This is useful to prevent copy-on-write semantics from "
2285 #| "changing the physical location of a page(s) if the parent writes to it "
2286 #| "after a B<fork>(2). (Such page relocations cause problems for hardware "
2287 #| "that DMAs into the page(s).)"
2289 "Do not make the pages in this range available to the child after a "
2290 "B<fork>(2). This is useful to prevent copy-on-write semantics from changing "
2291 "the physical location of a page if the parent writes to it after a "
2292 "B<fork>(2). (Such page relocations cause problems for hardware that DMAs "
2295 "B<fork>(2) が行われた後、指定された範囲のページを子プロセスが利用できないよ"
2296 "うにする。 この機能は、書き込み時コピー (copy-on-write) 方式で、 B<fork>(2) "
2297 "の後で親プロセスがページに書き込みを行った場合に ページの物理位置が変化しない"
2298 "ようにするのに有効である (ページの再配置はハードウェアがそのページに DMA 転送"
2299 "を行うような場合に 問題を起こすことがある)。"
2302 #: build/C/man2/madvise.2:237
2304 msgid "B<MADV_DOFORK> (since Linux 2.6.16)"
2305 msgstr "B<MADV_DOFORK> (Linux 2.6.16 以降)"
2308 #: build/C/man2/madvise.2:243
2310 "Undo the effect of B<MADV_DONTFORK>, restoring the default behavior, whereby "
2311 "a mapping is inherited across B<fork>(2)."
2313 "B<MADV_DONTFORK> の影響を取り消し、デフォルトの動作に戻す。 つまり、 "
2314 "B<fork>(2) の前後でマッピングは継承されるようになる。"
2317 #: build/C/man2/madvise.2:243
2319 msgid "B<MADV_HWPOISON> (since Linux 2.6.32)"
2320 msgstr "B<MADV_HWPOISON> (Linux 2.6.32 以降)"
2322 #. commit 9893e49d64a4874ea67849ee2cfbf3f3d6817573
2324 #: build/C/man2/madvise.2:258
2327 #| "Poison a page and handle it like a hardware memory corruption. This "
2328 #| "operation is available only for privileged (B<CAP_SYS_ADMIN>) "
2329 #| "processes. This operation may result in the calling process receiving a "
2330 #| "B<SIGBUS> and the page being unmapped. This feature is intended for "
2331 #| "testing of memory error-handling code; it is available only if the kernel "
2332 #| "was configured with B<CONFIG_MEMORY_FAILURE>."
2334 "Poison the pages in the range specified by I<addr> and I<length> and handle "
2335 "subsequent references to those pages like a hardware memory corruption. "
2336 "This operation is available only for privileged (B<CAP_SYS_ADMIN>) "
2337 "processes. This operation may result in the calling process receiving a "
2338 "B<SIGBUS> and the page being unmapped."
2340 "ページに毒入れを行い、ハードウェアメモリーの破損のようにそのページを取り扱"
2341 "う。 この操作は特権 (B<CAP_SYS_ADMIN> を持った) プロセスだけが利用できる。 こ"
2342 "の操作の結果、呼び出したプロセスは B<SIGBUS> を受け取り、そのページはアンマッ"
2343 "プされる。 この機能はメモリーのエラー処理コードをテストするためのものであ"
2344 "る。 カーネルで B<CONFIG_MEMORY_FAILURE> が有効になっている場合にのみ利用可能"
2348 #: build/C/man2/madvise.2:262 build/C/man2/madvise.2:319
2350 "This feature is intended for testing of memory error-handling code; it is "
2351 "available only if the kernel was configured with B<CONFIG_MEMORY_FAILURE>."
2355 #: build/C/man2/madvise.2:262
2357 msgid "B<MADV_MERGEABLE> (since Linux 2.6.32)"
2358 msgstr "B<MADV_MERGEABLE> (Linux 2.6.32 以降)"
2360 #. commit f8af4da3b4c14e7267c4ffb952079af3912c51c5
2362 #: build/C/man2/madvise.2:276
2365 #| "Enable Kernel Samepage Merging (KSM) for the pages in the range specified "
2366 #| "by I<addr> and I<length>. The kernel regularly scans those areas of user "
2367 #| "memory that have been marked as mergeable, looking for pages with "
2368 #| "identical content. These are replaced by a single write-protected page "
2369 #| "(which is automatically copied if a process later wants to update the "
2370 #| "content of the page). KSM merges only private anonymous pages (see "
2371 #| "B<mmap>(2)). The KSM feature is intended for applications that generate "
2372 #| "many instances of the same data (e.g., virtualization systems such as "
2373 #| "KVM). It can consume a lot of processing power; use with care. See the "
2374 #| "Linux kernel source file I<Documentation/vm/ksm.txt> for more details. "
2375 #| "The B<MADV_MERGEABLE> and B<MADV_UNMERGEABLE> operations are available "
2376 #| "only if the kernel was configured with B<CONFIG_KSM>."
2378 "Enable Kernel Samepage Merging (KSM) for the pages in the range specified by "
2379 "I<addr> and I<length>. The kernel regularly scans those areas of user "
2380 "memory that have been marked as mergeable, looking for pages with identical "
2381 "content. These are replaced by a single write-protected page (which is "
2382 "automatically copied if a process later wants to update the content of the "
2383 "page). KSM merges only private anonymous pages (see B<mmap>(2))."
2385 "Kernel Samepage Merging (KSM; カーネルによる同じページの統合) を I<addr> と "
2386 "I<length> で指定された領域に対して有効にする。 カーネルは、 統合可能の印がつ"
2387 "いたユーザーメモリーの領域を定期的にスキャンし、内容が全く同じページを探す。 "
2388 "内容が全く同じページがあれば、それらのページは書き込み保護 (write-protected) "
2389 "がかかった一つのページで置き換えられる (プロセスが後でページの内容を更新しよ"
2390 "うとした際には自動的にページのコピーが行われる)。 KSM はプライベートな無名"
2391 "ページ (anonymous pages) だけを統合する (B<mmap>(2) 参照)。 KSM 機能は、 同じ"
2392 "データのインスタンスを大量に生成するアプリケーション (KVM などの仮想化システ"
2393 "ム) での利用を想定している。 この機能はプロセッシング能力を大量に消費する場合"
2394 "があり、注意して使用すること。 詳細は Linux カーネルソースファイル "
2395 "I<Documentation/vm/ksm.txt> を参照。 B<MADV_MERGEABLE> と "
2396 "B<MADV_UNMERGEABLE> は、 カーネルで B<CONFIG_KSM> オプションを有効になってい"
2400 #: build/C/man2/madvise.2:283
2402 "The KSM feature is intended for applications that generate many instances of "
2403 "the same data (e.g., virtualization systems such as KVM). It can consume a "
2404 "lot of processing power; use with care. See the Linux kernel source file "
2405 "I<Documentation/admin-guide/mm/ksm.rst> for more details."
2409 #: build/C/man2/madvise.2:290
2412 #| "B<MADV_MERGEABLE> or B<MADV_UNMERGEABLE> was specified in I<advice>, but "
2413 #| "the kernel was not configured with B<CONFIG_KSM>."
2415 "The B<MADV_MERGEABLE> and B<MADV_UNMERGEABLE> operations are available only "
2416 "if the kernel was configured with B<CONFIG_KSM>."
2418 "I<advice> に B<MADV_MERGEABLE> か B<MADV_UNMERGEABLE> が指定されたが、 カーネ"
2419 "ルの設定が B<CONFIG_KSM> が有効になっていなかった。"
2422 #: build/C/man2/madvise.2:290
2424 msgid "B<MADV_UNMERGEABLE> (since Linux 2.6.32)"
2425 msgstr "B<MADV_UNMERGEABLE> (Linux 2.6.32 以降)"
2428 #: build/C/man2/madvise.2:299
2430 "Undo the effect of an earlier B<MADV_MERGEABLE> operation on the specified "
2431 "address range; KSM unmerges whatever pages it had merged in the address "
2432 "range specified by I<addr> and I<length>."
2434 "指定されたアドレス範囲に関して、それ以前に行われた B<MADV_MERGEABLE> 操作の効"
2435 "果を取り消す。 KSM は、 I<addr> と I<length> で指定されたアドレス範囲の統合"
2436 "済みのすべてのページの統合解除を行う。"
2439 #: build/C/man2/madvise.2:299
2441 msgid "B<MADV_SOFT_OFFLINE> (since Linux 2.6.33)"
2442 msgstr "B<MADV_SOFT_OFFLINE> (Linux 2.6.33 以降)"
2444 #. commit afcf938ee0aac4ef95b1a23bac704c6fbeb26de6
2446 #: build/C/man2/madvise.2:315
2449 #| "Soft offline the pages in the range specified by I<addr> and I<length>. "
2450 #| "The memory of each page in the specified range is preserved (i.e., when "
2451 #| "next accessed, the same content will be visible, but in a new physical "
2452 #| "page frame), and the original page is offlined (i.e., no longer used, and "
2453 #| "taken out of normal memory management). The effect of the "
2454 #| "B<MADV_SOFT_OFFLINE> operation is invisible to (i.e., does not change the "
2455 #| "semantics of) the calling process. This feature is intended for testing "
2456 #| "of memory error-handling code; it is available only if the kernel was "
2457 #| "configured with B<CONFIG_MEMORY_FAILURE>."
2459 "Soft offline the pages in the range specified by I<addr> and I<length>. The "
2460 "memory of each page in the specified range is preserved (i.e., when next "
2461 "accessed, the same content will be visible, but in a new physical page "
2462 "frame), and the original page is offlined (i.e., no longer used, and taken "
2463 "out of normal memory management). The effect of the B<MADV_SOFT_OFFLINE> "
2464 "operation is invisible to (i.e., does not change the semantics of) the "
2467 "I<addr> と I<length> で指定された範囲のページをソフトオフラインにする。 指定"
2468 "された範囲の各ページのメモリーの内容は保持され (すなわち、次にアクセスされた"
2469 "際に、同じ内容が見えるが、新しい物理ページフレームになる)、 元のフレームはオ"
2470 "フラインになる (すなわち、 そのフレームは使用される、通常のメモリー管理からは"
2471 "取り除かれる)。 B<MADV_SOFT_OFFLINE> 操作の影響は呼び出したプロセスには見えな"
2472 "い (つまり呼び出したプロセスの動作は変化しない)。 この機能はメモリーのエラー"
2473 "処理コードをテストすることを目的に作られた。 カーネルで "
2474 "B<CONFIG_MEMORY_FAILURE> が有効になっている場合にのみ利用可能である。"
2477 #: build/C/man2/madvise.2:319
2479 msgid "B<MADV_HUGEPAGE> (since Linux 2.6.38)"
2480 msgstr "B<MADV_HUGEPAGE> (Linux 2.6.38 以降)"
2482 #. commit 0af4e98b6b095c74588af04872f83d333c958c32
2483 #. http://lwn.net/Articles/358904/
2484 #. https://lwn.net/Articles/423584/
2486 #: build/C/man2/madvise.2:335
2489 #| "Enables Transparent Huge Pages (THP) for pages in the range specified by "
2490 #| "I<addr> and I<length>. Currently, Transparent Huge Pages work only with "
2491 #| "private anonymous pages (see B<mmap>(2)). The kernel will regularly scan "
2492 #| "the areas marked as huge page candidates to replace them with huge "
2493 #| "pages. The kernel will also allocate huge pages directly when the region "
2494 #| "is naturally aligned to the huge page size (see B<posix_memalign>(2)). "
2495 #| "This feature is primarily aimed at applications that use large mappings "
2496 #| "of data and access large regions of that memory at a time (e.g., "
2497 #| "virtualization systems such as QEMU). It can very easily waste memory (e."
2498 #| "g., a 2MB mapping that only ever accesses 1 byte will result in 2MB of "
2499 #| "wired memory instead of one 4KB page). See the Linux kernel source file "
2500 #| "I<Documentation/vm/transhuge.txt> for more details. The B<MADV_HUGEPAGE> "
2501 #| "and B<MADV_NOHUGEPAGE> operations are available only if the kernel was "
2502 #| "configured with B<CONFIG_TRANSPARENT_HUGEPAGE>."
2504 "Enable Transparent Huge Pages (THP) for pages in the range specified by "
2505 "I<addr> and I<length>. Currently, Transparent Huge Pages work only with "
2506 "private anonymous pages (see B<mmap>(2)). The kernel will regularly scan "
2507 "the areas marked as huge page candidates to replace them with huge pages. "
2508 "The kernel will also allocate huge pages directly when the region is "
2509 "naturally aligned to the huge page size (see B<posix_memalign>(2))."
2511 "Transparent Huge Pages (THP) を I<addr> と I<length> で指定された領域に対して"
2512 "有効にする。 現在のところ、Transparent Huge Pages はプライベートな無名ページ "
2513 "(anonymous pages) についてのみ機能する。 カーネルは定期的にヒュージページ "
2514 "(huge page) 候補の印がついたページをスキャンし、ヒュージページと置き換える。 "
2515 "また、カーネルはその領域がヒュージページのサイズに合っている場合、ヒュージ"
2516 "ページを直接割り当てる (B<posix_memalign>(2) 参照)。 この機能は、大きなデータ"
2517 "マッピングを使用し、一度にそのメモリーの大きな範囲にアクセスするようなアプリ"
2518 "ケーション (例えば QEMU のような仮想化システム) で使うことを主に想定されてい"
2519 "る。 この機能は非常に簡単にメモリーを浪費してしまう (例えば、1 バイトしかアク"
2520 "セスしない 2MB のマッピングが、 4KB ページではなく 2MB の実際のメモリーを使っ"
2521 "てしまう)。 詳細は Linux カーネルソースファイル I<Documentation/vm/transhuge."
2522 "txt> を参照。 B<MADV_HUGEPAGE> と B<MADV_NOHUGEPAGE> は、 カーネルで "
2523 "B<CONFIG_TRANSPARENT_HUGEPAGE> オプションを有効になっている場合にのみ利用でき"
2527 #: build/C/man2/madvise.2:344
2529 "This feature is primarily aimed at applications that use large mappings of "
2530 "data and access large regions of that memory at a time (e.g., virtualization "
2531 "systems such as QEMU). It can very easily waste memory (e.g., a 2\\ MB "
2532 "mapping that only ever accesses 1 byte will result in 2\\ MB of wired memory "
2533 "instead of one 4\\ KB page). See the Linux kernel source file "
2534 "I<Documentation/admin-guide/mm/transhuge.rst> for more details."
2538 #: build/C/man2/madvise.2:361
2540 "Most common kernels configurations provide B<MADV_HUGEPAGE>-style behavior "
2541 "by default, and thus B<MADV_HUGEPAGE> is normally not necessary. It is "
2542 "mostly intended for embedded systems, where B<MADV_HUGEPAGE>-style behavior "
2543 "may not be enabled by default in the kernel. On such systems, this flag can "
2544 "be used in order to selectively enable THP. Whenever B<MADV_HUGEPAGE> is "
2545 "used, it should always be in regions of memory with an access pattern that "
2546 "the developer knows in advance won't risk to increase the memory footprint "
2547 "of the application when transparent hugepages are enabled."
2551 #: build/C/man2/madvise.2:368
2554 #| "B<MADV_MERGEABLE> or B<MADV_UNMERGEABLE> was specified in I<advice>, but "
2555 #| "the kernel was not configured with B<CONFIG_KSM>."
2557 "The B<MADV_HUGEPAGE> and B<MADV_NOHUGEPAGE> operations are available only if "
2558 "the kernel was configured with B<CONFIG_TRANSPARENT_HUGEPAGE>."
2560 "I<advice> に B<MADV_MERGEABLE> か B<MADV_UNMERGEABLE> が指定されたが、 カーネ"
2561 "ルの設定が B<CONFIG_KSM> が有効になっていなかった。"
2564 #: build/C/man2/madvise.2:368
2566 msgid "B<MADV_NOHUGEPAGE> (since Linux 2.6.38)"
2567 msgstr "B<MADV_NOHUGEPAGE> (Linux 2.6.38 以降)"
2570 #: build/C/man2/madvise.2:375
2573 #| "Ensures that memory in the address range specified by I<addr> and "
2574 #| "I<length> will not be collapsed into huge pages."
2576 "Ensures that memory in the address range specified by I<addr> and I<length> "
2577 "will not be backed by transparent hugepages."
2579 "I<addr> と I<length> で指定されたアドレス範囲のメモリーがヒュージページに組み"
2583 #: build/C/man2/madvise.2:375
2585 msgid "B<MADV_DONTDUMP> (since Linux 3.4)"
2586 msgstr "B<MADV_DONTDUMP> (Linux 3.4 以降)"
2588 #. commit 909af768e88867016f427264ae39d27a57b6a8ed
2589 #. commit accb61fe7bb0f5c2a4102239e4981650f9048519
2591 #: build/C/man2/madvise.2:391
2594 #| "Exclude from a core dump those pages in the range specified by I<addr> "
2595 #| "and I<length>. This is useful in applications that have large areas of "
2596 #| "memory that are known not to be useful in a core dump. The effect of "
2597 #| "B<MADV_DONTDUMP> takes precedence over the bit mask that is set via the "
2598 #| "I</proc/PID/coredump_filter> file (see B<core>(5))."
2600 "Exclude from a core dump those pages in the range specified by I<addr> and "
2601 "I<length>. This is useful in applications that have large areas of memory "
2602 "that are known not to be useful in a core dump. The effect of "
2603 "B<MADV_DONTDUMP> takes precedence over the bit mask that is set via the I</"
2604 "proc/[pid]/coredump_filter> file (see B<core>(5))."
2606 "コアダンプから I<addr> と I<length> で指定された範囲のページを除外する。 これ"
2607 "は、 コアダンプに含めても役に立たないことが分かっている大きなメモリー領域があ"
2608 "るアプリケーションで有用である。 B<MADV_DONTDUMP> の効果は I</proc/PID/"
2609 "coredump_filter> ファイル経由で設定されたビットマスクよりも優先される "
2613 #: build/C/man2/madvise.2:391
2615 msgid "B<MADV_DODUMP> (since Linux 3.4)"
2616 msgstr "B<MADV_DODUMP> (Linux 3.4 以降)"
2619 #: build/C/man2/madvise.2:395
2620 msgid "Undo the effect of an earlier B<MADV_DONTDUMP>."
2621 msgstr "以前の B<MADV_DONTDUMP> の効果を取り消す。"
2624 #: build/C/man2/madvise.2:395
2626 #| msgid "B<MADV_REMOVE> (since Linux 2.6.16)"
2627 msgid "B<MADV_FREE> (since Linux 4.5)"
2628 msgstr "B<MADV_REMOVE> (Linux 2.6.16 以降)"
2631 #: build/C/man2/madvise.2:417
2633 "The application no longer requires the pages in the range specified by "
2634 "I<addr> and I<len>. The kernel can thus free these pages, but the freeing "
2635 "could be delayed until memory pressure occurs. For each of the pages that "
2636 "has been marked to be freed but has not yet been freed, the free operation "
2637 "will be canceled if the caller writes into the page. After a successful "
2638 "B<MADV_FREE> operation, any stale data (i.e., dirty, unwritten pages) will "
2639 "be lost when the kernel frees the pages. However, subsequent writes to "
2640 "pages in the range will succeed and then kernel cannot free those dirtied "
2641 "pages, so that the caller can always see just written data. If there is no "
2642 "subsequent write, the kernel can free the pages at any time. Once pages in "
2643 "the range have been freed, the caller will see zero-fill-on-demand pages "
2644 "upon subsequent page references."
2647 #. commit 93e06c7a645343d222c9a838834a51042eebbbf7
2649 #: build/C/man2/madvise.2:428
2651 "The B<MADV_FREE> operation can be applied only to private anonymous pages "
2652 "(see B<mmap>(2)). In Linux before version 4.12, when freeing pages on a "
2653 "swapless system, the pages in the given range are freed instantly, "
2654 "regardless of memory pressure."
2658 #: build/C/man2/madvise.2:428
2660 #| msgid "B<MADV_DONTFORK> (since Linux 2.6.16)"
2661 msgid "B<MADV_WIPEONFORK> (since Linux 4.14)"
2662 msgstr "B<MADV_DONTFORK> (Linux 2.6.16 以降)"
2664 #. commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
2666 #: build/C/man2/madvise.2:437
2668 "Present the child process with zero-filled memory in this range after a "
2669 "B<fork>(2). This is useful in forking servers in order to ensure that "
2670 "sensitive per-process data (for example, PRNG seeds, cryptographic secrets, "
2671 "and so on) is not handed to child processes."
2675 #: build/C/man2/madvise.2:442
2677 "The B<MADV_WIPEONFORK> operation can be applied only to private anonymous "
2678 "pages (see B<mmap>(2))."
2682 #: build/C/man2/madvise.2:450
2684 "Within the child created by B<fork>(2), the B<MADV_WIPEONFORK> setting "
2685 "remains in place on the specified address range. This setting is cleared "
2686 "during B<execve>(2)."
2690 #: build/C/man2/madvise.2:450
2692 #| msgid "B<MADV_DONTFORK> (since Linux 2.6.16)"
2693 msgid "B<MADV_KEEPONFORK> (since Linux 4.14)"
2694 msgstr "B<MADV_DONTFORK> (Linux 2.6.16 以降)"
2696 #. commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
2698 #: build/C/man2/madvise.2:455
2700 #| msgid "Undo the effect of an earlier B<MADV_DONTDUMP>."
2701 msgid "Undo the effect of an earlier B<MADV_WIPEONFORK>."
2702 msgstr "以前の B<MADV_DONTDUMP> の効果を取り消す。"
2705 #: build/C/man2/madvise.2:462
2708 #| "On success B<madvise>() returns zero. On error, it returns -1 and "
2709 #| "I<errno> is set appropriately."
2711 "On success, B<madvise>() returns zero. On error, it returns -1 and "
2712 "I<errno> is set appropriately."
2714 "B<madvise>() は成功すると 0 を返す。 エラーが起こると -1 を返し、 I<errno> "
2718 #: build/C/man2/madvise.2:463 build/C/man2/mmap.2:510
2719 #: build/C/man2/mprotect.2:149 build/C/man3/shm_open.3:186
2720 #: build/C/man3/shm_open.3:191 build/C/man2/shmctl.2:389
2721 #: build/C/man2/shmget.2:224 build/C/man2/shmop.2:187
2727 #: build/C/man2/madvise.2:469
2729 "I<advice> is B<MADV_REMOVE>, but the specified address range is not a shared "
2734 #: build/C/man2/madvise.2:469 build/C/man2/mlock.2:216 build/C/man2/mmap.2:528
2735 #: build/C/man2/mremap.2:169
2741 #: build/C/man2/madvise.2:472
2742 msgid "A kernel resource was temporarily unavailable."
2743 msgstr "何らかのカーネルリソースが一時的に利用できなかった。"
2746 #: build/C/man2/madvise.2:475
2747 msgid "The map exists, but the area maps something that isn't a file."
2748 msgstr "指定したマップは存在するが、ファイルではないところをマップしている。"
2753 #: build/C/man2/madvise.2:483
2755 #| msgid "I<addr> is not page-aligned."
2756 msgid "I<addr> is not page-aligned or I<length> is negative."
2757 msgstr "I<addr> がページ境界ではない。"
2760 #: build/C/man2/madvise.2:487
2762 #| msgid "I<advice> is not a valid value"
2763 msgid "I<advice> is not a valid."
2764 msgstr "I<advice> が有効な値でない。"
2767 #: build/C/man2/madvise.2:497
2769 "I<advice> is B<MADV_DONTNEED> or B<MADV_REMOVE> and the specified address "
2770 "range includes locked, Huge TLB pages, or B<VM_PFNMAP> pages."
2774 #: build/C/man2/madvise.2:506
2777 #| "B<MADV_MERGEABLE> or B<MADV_UNMERGEABLE> was specified in I<advice>, but "
2778 #| "the kernel was not configured with B<CONFIG_KSM>."
2780 "I<advice> is B<MADV_MERGEABLE> or B<MADV_UNMERGEABLE>, but the kernel was "
2781 "not configured with B<CONFIG_KSM>."
2783 "I<advice> に B<MADV_MERGEABLE> か B<MADV_UNMERGEABLE> が指定されたが、 カーネ"
2784 "ルの設定が B<CONFIG_KSM> が有効になっていなかった。"
2787 #: build/C/man2/madvise.2:518
2789 "I<advice> is B<MADV_FREE> or B<MADV_WIPEONFORK> but the specified address "
2790 "range includes file, Huge TLB, B<MAP_SHARED>, or B<VM_PFNMAP> ranges."
2794 #: build/C/man2/madvise.2:524
2796 "(for B<MADV_WILLNEED>) Paging in this area would exceed the process's "
2797 "maximum resident set size."
2799 "(B<MADV_WILLNEED> の場合) この範囲のページングを行うと、 プロセスの RSS "
2800 "(resident set size) の最大値を越えてしまう。"
2803 #: build/C/man2/madvise.2:524 build/C/man2/madvise.2:529
2804 #: build/C/man2/mlock.2:184 build/C/man2/mlock.2:192 build/C/man2/mlock.2:231
2805 #: build/C/man2/mlock.2:235 build/C/man2/mmap.2:581 build/C/man2/mmap.2:584
2806 #: build/C/man2/mmap.2:592 build/C/man2/mprotect.2:186
2807 #: build/C/man2/mprotect.2:189 build/C/man2/mprotect.2:199
2808 #: build/C/man2/mremap.2:245 build/C/man2/msync.2:96
2809 #: build/C/man3/posix_madvise.3:99 build/C/man3/posix_memalign.3:172
2810 #: build/C/man2/shmctl.2:422 build/C/man2/shmget.2:262 build/C/man2/shmop.2:210
2811 #: build/C/man2/subpage_prot.2:87 build/C/man2/sync_file_range.2:163
2812 #: build/C/man2/memfd_create.2:196 build/C/man2/s390_pci_mmio_write.2:94
2818 #: build/C/man2/madvise.2:529
2819 msgid "(for B<MADV_WILLNEED>) Not enough memory: paging in failed."
2820 msgstr "(B<MADV_WILLNEED> の場合) メモリーが足りず、ページングに失敗した。"
2823 #: build/C/man2/madvise.2:533
2825 "Addresses in the specified range are not currently mapped, or are outside "
2826 "the address space of the process."
2828 "指定した範囲のアドレスが、現在マップされていない。 あるいはプロセスのアドレス"
2832 #: build/C/man2/madvise.2:541
2834 "I<advice> is B<MADV_HWPOISON>, but the caller does not have the "
2835 "B<CAP_SYS_ADMIN> capability."
2838 #. commit d3ac21cacc24790eb45d735769f35753f5b56ceb
2840 #: build/C/man2/madvise.2:548
2842 "Since Linux 3.18, support for this system call is optional, depending on the "
2843 "setting of the B<CONFIG_ADVISE_SYSCALLS> configuration option."
2845 "Linux 3.18 以降では、このシステムコールのサポートは任意となり、利用できるかは"
2846 "カーネルが B<CONFIG_ADVISE_SYSCALLS> オプションを有効にしてコンパイルされてい"
2850 #: build/C/man2/madvise.2:558
2852 "B<madvise>() is not specified by any standards. Versions of this system "
2853 "call, implementing a wide variety of I<advice> values, exist on many other "
2854 "implementations. Other implementations typically implement at least the "
2855 "flags listed above under I<Conventional advice flags>, albeit with some "
2856 "variation in semantics."
2860 #: build/C/man2/madvise.2:569
2863 #| "POSIX.1b. POSIX.1-2001 describes B<posix_madvise>(3) with constants "
2864 #| "B<POSIX_MADV_NORMAL>, B<POSIX_MADV_RANDOM>, and so on, with a behavior "
2865 #| "close to that described here. There is a similar B<posix_fadvise>(2) "
2866 #| "for file access."
2868 "POSIX.1-2001 describes B<posix_madvise>(3) with constants "
2869 "B<POSIX_MADV_NORMAL>, B<POSIX_MADV_RANDOM>, B<POSIX_MADV_SEQUENTIAL>, "
2870 "B<POSIX_MADV_WILLNEED>, and B<POSIX_MADV_DONTNEED>, and so on, with behavior "
2871 "close to the similarly named flags listed above."
2873 "POSIX.1b. POSIX.1-2001 では、 B<posix_madvise>(3) を B<POSIX_MADV_NORMAL>, "
2874 "B<POSIX_MADV_RANDOM> などの定数とともに記述していた (それぞれの振る舞いはここ"
2875 "で述べたものに近い)。 ファイルアクセスに対しても B<posix_fadvise>(2) という"
2879 #: build/C/man2/madvise.2:570 build/C/man2/mlock.2:400
2880 #: build/C/man2/shmget.2:402
2888 #. function first appeared in 4.4BSD.
2890 #: build/C/man2/madvise.2:586
2892 "The Linux implementation requires that the address I<addr> be page-aligned, "
2893 "and allows I<length> to be zero. If there are some parts of the specified "
2894 "address range that are not mapped, the Linux version of B<madvise>() "
2895 "ignores them and applies the call to the rest (but returns B<ENOMEM> from "
2896 "the system call, as it should)."
2898 "Linux の実装では I<addr> のアドレスはページ境界の値でなければならない。また "
2899 "I<length> は 0 であっても構わない。 また Linux 版の B<madvise>() では、指定"
2900 "されたアドレス範囲にマップされていない部分があると、 これらを無視して残りの部"
2901 "分にアドバイスを適用する (しかしシステムコールに対してはちゃんと B<ENOMEM> を"
2905 #: build/C/man2/madvise.2:596
2908 #| "B<getrlimit>(2), B<mincore>(2), B<mmap>(2), B<mprotect>(2), B<msync>(2), "
2909 #| "B<munmap>(2), B<prctl>(2), B<core>(5)"
2911 "B<getrlimit>(2), B<mincore>(2), B<mmap>(2), B<mprotect>(2), B<msync>(2), "
2912 "B<munmap>(2), B<prctl>(2), B<posix_madvise>(3), B<core>(5)"
2914 "B<getrlimit>(2), B<mincore>(2), B<mmap>(2), B<mprotect>(2), B<msync>(2), "
2915 "B<munmap>(2), B<prctl>(2), B<core>(5)"
2918 #: build/C/man3/mallinfo.3:25
2924 #: build/C/man3/mallinfo.3:25 build/C/man3/malloc_hook.3:10
2925 #: build/C/man3/malloc_info.3:25 build/C/man2/mprotect.2:33
2926 #: build/C/man3/mtrace.3:25 build/C/man3/posix_fallocate.3:25
2927 #: build/C/man3/shm_open.3:25 build/C/man2/memfd_create.2:21
2928 #: build/C/man2/membarrier.2:25
2934 #: build/C/man3/mallinfo.3:28
2935 msgid "mallinfo - obtain memory allocation information"
2936 msgstr "mallinfo - メモリー割り当て情報を取得する"
2939 #: build/C/man3/mallinfo.3:30 build/C/man3/malloc_stats.3:30
2940 #: build/C/man3/malloc_trim.3:30 build/C/man3/malloc_usable_size.3:30
2941 #: build/C/man3/mallopt.3:30
2942 msgid "B<#include E<lt>malloc.hE<gt>>"
2943 msgstr "B<#include E<lt>malloc.hE<gt>>"
2946 #: build/C/man3/mallinfo.3:32
2947 msgid "B<struct mallinfo mallinfo(void);>"
2948 msgstr "B<struct mallinfo mallinfo(void);>"
2951 #: build/C/man3/mallinfo.3:39
2954 #| "The B<mallinfo>() function returns a copy of a structure containing "
2955 #| "information about memory allocations performed by B<malloc>(3) and "
2956 #| "related functions. This structure is defined as follows:"
2958 "The B<mallinfo>() function returns a copy of a structure containing "
2959 "information about memory allocations performed by B<malloc>(3) and related "
2962 "B<mallinfo>() 関数は、 B<malloc>(3) や一連の関数により実行されたメモリー\n"
2963 "割り当てに関する情報を格納した構造体のコピーを返す。\n"
2964 "この構造体は以下のように定義されている。"
2967 #: build/C/man3/mallinfo.3:45
2969 "Note that not all allocations are visible to B<mallinfo>(); see BUGS and "
2970 "consider using B<malloc_info>(3) instead."
2974 #: build/C/man3/mallinfo.3:47
2975 msgid "The returned structure is defined as follows:"
2979 #: build/C/man3/mallinfo.3:62
2982 #| "struct mallinfo {\n"
2983 #| " int arena; /* Non-mmapped space allocated (bytes) */\n"
2984 #| " int ordblks; /* Number of free chunks */\n"
2985 #| " int smblks; /* Number of free fastbin blocks */\n"
2986 #| " int hblks; /* Number of mmapped regions */\n"
2987 #| " int hblkhd; /* Space allocated in mmapped regions (bytes) */\n"
2988 #| " int usmblks; /* Maximum total allocated space (bytes) */\n"
2989 #| " int fsmblks; /* Space in freed fastbin blocks (bytes) */\n"
2990 #| " int uordblks; /* Total allocated space (bytes) */\n"
2991 #| " int fordblks; /* Total free space (bytes) */\n"
2992 #| " int keepcost; /* Top-most, releasable space (bytes) */\n"
2995 "struct mallinfo {\n"
2996 " int arena; /* Non-mmapped space allocated (bytes) */\n"
2997 " int ordblks; /* Number of free chunks */\n"
2998 " int smblks; /* Number of free fastbin blocks */\n"
2999 " int hblks; /* Number of mmapped regions */\n"
3000 " int hblkhd; /* Space allocated in mmapped regions (bytes) */\n"
3001 " int usmblks; /* See below */\n"
3002 " int fsmblks; /* Space in freed fastbin blocks (bytes) */\n"
3003 " int uordblks; /* Total allocated space (bytes) */\n"
3004 " int fordblks; /* Total free space (bytes) */\n"
3005 " int keepcost; /* Top-most, releasable space (bytes) */\n"
3008 "struct mallinfo {\n"
3009 " int arena; /* Non-mmapped space allocated (bytes) */\n"
3010 " int ordblks; /* Number of free chunks */\n"
3011 " int smblks; /* Number of free fastbin blocks */\n"
3012 " int hblks; /* Number of mmapped regions */\n"
3013 " int hblkhd; /* Space allocated in mmapped regions (bytes) */\n"
3014 " int usmblks; /* Maximum total allocated space (bytes) */\n"
3015 " int fsmblks; /* Space in freed fastbin blocks (bytes) */\n"
3016 " int uordblks; /* Total allocated space (bytes) */\n"
3017 " int fordblks; /* Total free space (bytes) */\n"
3018 " int keepcost; /* Top-most, releasable space (bytes) */\n"
3022 #: build/C/man3/mallinfo.3:68
3024 "The fields of the I<mallinfo> structure contain the following information:"
3025 msgstr "I<mallinfo> 構造体の各フィールドには以下の情報が格納される。"
3028 #: build/C/man3/mallinfo.3:68
3034 #: build/C/man3/mallinfo.3:74
3036 "The total amount of memory allocated by means other than B<mmap>(2) (i.e., "
3037 "memory allocated on the heap). This figure includes both in-use blocks and "
3038 "blocks on the free list."
3040 "B<mmap>(2) 以外の手段で割り当てられた総メモリー量 (例えばヒープに割り当てられ"
3041 "たメモリー) 。 この数字には使用中のブロックやフリーリスト上のブロックも含まれ"
3045 #: build/C/man3/mallinfo.3:74
3051 #: build/C/man3/mallinfo.3:77
3052 msgid "The number of ordinary (i.e., non-fastbin) free blocks."
3053 msgstr "通常の (つまり fastbin ではない) 未使用ブロック数。"
3056 #: build/C/man3/mallinfo.3:77
3061 #. the glibc info page wrongly says this field is unused
3062 #. https://sourceware.org/bugzilla/show_bug.cgi?id=26746
3064 #: build/C/man3/mallinfo.3:83
3065 msgid "The number of fastbin free blocks (see B<mallopt>(3))."
3066 msgstr "fastbin 未使用ブロック数 (B<mallopt>(3) 参照)。"
3069 #: build/C/man3/mallinfo.3:83
3075 #: build/C/man3/mallinfo.3:91
3077 "The number of blocks currently allocated using B<mmap>(2). (See the "
3078 "discussion of B<M_MMAP_THRESHOLD> in B<mallopt>(3).)"
3080 "B<mmap>(2) を使って現在割り当てられているブロック数 (B<mallopt>(3) の "
3081 "B<M_MMAP_THRESHOLD> の議論を参照)。"
3084 #: build/C/man3/mallinfo.3:91
3090 #: build/C/man3/mallinfo.3:95
3091 msgid "The number of bytes in blocks currently allocated using B<mmap>(2)."
3092 msgstr "B<mmap>(2) を使って現在割り当てられているブロックのバイト数。"
3095 #: build/C/man3/mallinfo.3:95
3100 #. It seems to have been zero since at least as far back as glibc 2.15
3102 #: build/C/man3/mallinfo.3:102
3105 #| "The \"highwater mark\" for allocated space\\(emthat is, the maximum "
3106 #| "amount of space that was ever allocated. This field is maintained only "
3107 #| "in nonthreading environments."
3109 "This field is unused, and is always 0. Historically, it was the \"highwater "
3110 "mark\" for allocated space\\(emthat is, the maximum amount of space that was "
3111 "ever allocated (in bytes); this field was maintained only in nonthreading "
3114 "割り当てた空間の最高点 (\"highwater mark\")、 つまり、 これまでの中での最大の"
3115 "割り当て量。 このフィールドはスレッド化されていない環境でのみ収集される。"
3118 #: build/C/man3/mallinfo.3:102
3123 #. the glibc info page wrongly says this field is unused
3124 #. https://sourceware.org/bugzilla/show_bug.cgi?id=26746
3126 #: build/C/man3/mallinfo.3:107
3127 msgid "The total number of bytes in fastbin free blocks."
3128 msgstr "fastbin フリーブロックの総バイト数。"
3131 #: build/C/man3/mallinfo.3:107
3134 msgstr "I<uordblks>"
3137 #: build/C/man3/mallinfo.3:110
3138 msgid "The total number of bytes used by in-use allocations."
3139 msgstr "使用中の割り当てメモリーで使われているバイト数。"
3142 #: build/C/man3/mallinfo.3:110
3145 msgstr "I<fordblks>"
3148 #: build/C/man3/mallinfo.3:113
3149 msgid "The total number of bytes in free blocks."
3150 msgstr "フリーブロックの総バイト数。"
3153 #: build/C/man3/mallinfo.3:113
3156 msgstr "I<keepcost>"
3159 #. Available already in glibc 2.0, possibly earlier
3161 #: build/C/man3/mallinfo.3:122
3163 "The total amount of releasable free space at the top of the heap. This is "
3164 "the maximum number of bytes that could ideally (i.e., ignoring page "
3165 "alignment restrictions, and so on) be released by B<malloc_trim>(3)."
3167 "ヒープの一番上にある解放可能な未使用の空間の大きさ。 この値は "
3168 "B<malloc_trim>(3) で理想的な場合に解放できる最大のバイト数である (理想的とい"
3169 "うのは、 ページ境界の制限などを無視した場合である。"
3172 #: build/C/man3/mallinfo.3:132
3174 msgid "B<mallinfo>()"
3175 msgstr "B<mallinfo>()"
3178 #: build/C/man3/mallinfo.3:132
3180 msgid "MT-Unsafe init const:mallopt"
3181 msgstr "MT-Unsafe init const:mallopt"
3184 #: build/C/man3/mallinfo.3:148
3186 "B<mallinfo>() would access some global internal objects. If modify them "
3187 "with non-atomically, may get inconsistent results. The identifier "
3188 "I<mallopt> in I<const:mallopt> mean that B<mallopt>() would modify the "
3189 "global internal objects with atomics, that make sure B<mallinfo>() is safe "
3190 "enough, others modify with non-atomically maybe not."
3194 #: build/C/man3/mallinfo.3:152
3196 "This function is not specified by POSIX or the C standards. A similar "
3197 "function exists on many System V derivatives, and was specified in the SVID."
3199 "この関数は POSIX や C 標準では規定されていない。 多くの System V 由来のシステ"
3200 "ムに同様の関数が存在し、 SVID では同様の関数が規定されていた。 "
3202 #. FIXME . http://sourceware.org/bugzilla/show_bug.cgi?id=208
3203 #. See the 24 Aug 2011 mail by Paul Pluzhnikov:
3204 #. "[patch] Fix mallinfo() to accumulate results for all arenas"
3205 #. on libc-alpha@sourceware.org
3207 #: build/C/man3/mallinfo.3:164
3209 "B<Information is returned for only the main memory allocation area.> "
3210 "Allocations in other arenas are excluded. See B<malloc_stats>(3) and "
3211 "B<malloc_info>(3) for alternatives that include information about other "
3214 "B<これらの情報はメインのメモリー割り当て領域に対するもののみである。> 他の領"
3215 "域の割り当ては対象にならない。 他の領域の情報も取得できる別の手段については "
3216 "B<malloc_stats>(3) や B<malloc_info>(3) を参照。"
3219 #: build/C/man3/mallinfo.3:172
3221 "The fields of the I<mallinfo> structure are typed as I<int>. However, "
3222 "because some internal bookkeeping values may be of type I<long>, the "
3223 "reported values may wrap around zero and thus be inaccurate."
3225 "I<mallinfo> 構造体の各フィールドは I<int> 型である。 しかし、 いくつかの内部"
3226 "管理用の値は I<long> 型の場合もあるので、 報告される値が一周してしまい、 不正"
3230 #: build/C/man3/mallinfo.3:172 build/C/man3/malloc_hook.3:94
3231 #: build/C/man3/malloc_info.3:97 build/C/man3/mallopt.3:513
3232 #: build/C/man3/mcheck.3:180 build/C/man2/mmap.2:910
3233 #: build/C/man2/mprotect.2:286 build/C/man3/mtrace.3:130
3234 #: build/C/man3/shm_open.3:287 build/C/man2/shmget.2:414
3235 #: build/C/man2/shmop.2:293 build/C/man2/memfd_create.2:344
3236 #: build/C/man2/membarrier.2:328 build/C/man2/pkey_alloc.2:134
3237 #: build/C/man7/pkeys.7:165
3244 #: build/C/man3/mallinfo.3:178
3246 "The program below employs B<mallinfo>() to retrieve memory allocation "
3247 "statistics before and after allocating and freeing some blocks of memory. "
3248 "The statistics are displayed on standard output."
3250 "以下のプログラムは B<mallinfo>() を利用して、 メモリーブロックの割り当て、解"
3251 "放のそれぞれ前後でメモリー割り当ての統計情報を取得する。 統計情報は標準出力に"
3255 #: build/C/man3/mallinfo.3:182
3257 "The first two command-line arguments specify the number and size of blocks "
3258 "to be allocated with B<malloc>(3)."
3260 "最初の 2 つのコマンドライン引き数は B<malloc>(3) で割り当てるブロック数とサイ"
3264 #: build/C/man3/mallinfo.3:196
3266 "The remaining three arguments specify which of the allocated blocks should "
3267 "be freed with B<free>(3). These three arguments are optional, and specify "
3268 "(in order): the step size to be used in the loop that frees blocks (the "
3269 "default is 1, meaning free all blocks in the range); the ordinal position of "
3270 "the first block to be freed (default 0, meaning the first allocated block); "
3271 "and a number one greater than the ordinal position of the last block to be "
3272 "freed (default is one greater than the maximum block number). If these "
3273 "three arguments are omitted, then the defaults cause all allocated blocks to "
3276 "残りの 3 つの引き数は、どの割り当てられたブロックを B<free>(3) で解放すべきか"
3277 "を指定する。 これらの 3 つの引き数の指定は任意で、 最初のものから順に以下の情"
3278 "報を指定する。 1 つ目の引き数は、 ブロックを解放するループで使用するステップ"
3279 "サイズを指定する (デフォルト値は 1 で、 1 は指定した範囲のすべてのブロックを"
3280 "解放することを意味する)。 2 つ目の引き数は、 解放する先頭ブロックの場所番号を"
3281 "指定する (デフォルト値は 0 で、 0 は先頭の割り当て済みブロックを意味する)。 "
3282 "3 つ目の引き数は、 解放する最終ブロックの場所番号よりひとつ大きい値を指定す"
3283 "る (デフォルト値は最大ブロック番号よりもひとつ大きい値である)。 これらの 3 つ"
3284 "の引き数が省略された場合、 デフォルトではすべての割り当てられたブロックが解放"
3288 #: build/C/man3/mallinfo.3:200
3290 "In the following example run of the program, 1000 allocations of 100 bytes "
3291 "are performed, and then every second allocated block is freed:"
3293 "以下のプログラムの実行例では、 100 バイトの割り当てを 1000 回実行し、 割り当"
3294 "てたブロックの 2 つに 1 つを解放する。"
3297 #: build/C/man3/mallinfo.3:215
3300 "$ B<./a.out 1000 100 2>\n"
3301 "============== Before allocating blocks ==============\n"
3302 "Total non-mmapped bytes (arena): 0\n"
3303 "# of free chunks (ordblks): 1\n"
3304 "# of free fastbin blocks (smblks): 0\n"
3305 "# of mapped regions (hblks): 0\n"
3306 "Bytes in mapped regions (hblkhd): 0\n"
3307 "Max. total allocated space (usmblks): 0\n"
3308 "Free bytes held in fastbins (fsmblks): 0\n"
3309 "Total allocated space (uordblks): 0\n"
3310 "Total free space (fordblks): 0\n"
3311 "Topmost releasable block (keepcost): 0\n"
3313 "$ B<./a.out 1000 100 2>\n"
3314 "============== Before allocating blocks ==============\n"
3315 "Total non-mmapped bytes (arena): 0\n"
3316 "# of free chunks (ordblks): 1\n"
3317 "# of free fastbin blocks (smblks): 0\n"
3318 "# of mapped regions (hblks): 0\n"
3319 "Bytes in mapped regions (hblkhd): 0\n"
3320 "Max. total allocated space (usmblks): 0\n"
3321 "Free bytes held in fastbins (fsmblks): 0\n"
3322 "Total allocated space (uordblks): 0\n"
3323 "Total free space (fordblks): 0\n"
3324 "Topmost releasable block (keepcost): 0\n"
3327 #: build/C/man3/mallinfo.3:227
3330 "============== After allocating blocks ==============\n"
3331 "Total non-mmapped bytes (arena): 135168\n"
3332 "# of free chunks (ordblks): 1\n"
3333 "# of free fastbin blocks (smblks): 0\n"
3334 "# of mapped regions (hblks): 0\n"
3335 "Bytes in mapped regions (hblkhd): 0\n"
3336 "Max. total allocated space (usmblks): 0\n"
3337 "Free bytes held in fastbins (fsmblks): 0\n"
3338 "Total allocated space (uordblks): 104000\n"
3339 "Total free space (fordblks): 31168\n"
3340 "Topmost releasable block (keepcost): 31168\n"
3342 "============== After allocating blocks ==============\n"
3343 "Total non-mmapped bytes (arena): 135168\n"
3344 "# of free chunks (ordblks): 1\n"
3345 "# of free fastbin blocks (smblks): 0\n"
3346 "# of mapped regions (hblks): 0\n"
3347 "Bytes in mapped regions (hblkhd): 0\n"
3348 "Max. total allocated space (usmblks): 0\n"
3349 "Free bytes held in fastbins (fsmblks): 0\n"
3350 "Total allocated space (uordblks): 104000\n"
3351 "Total free space (fordblks): 31168\n"
3352 "Topmost releasable block (keepcost): 31168\n"
3355 #: build/C/man3/mallinfo.3:239
3358 "============== After freeing blocks ==============\n"
3359 "Total non-mmapped bytes (arena): 135168\n"
3360 "# of free chunks (ordblks): 501\n"
3361 "# of free fastbin blocks (smblks): 0\n"
3362 "# of mapped regions (hblks): 0\n"
3363 "Bytes in mapped regions (hblkhd): 0\n"
3364 "Max. total allocated space (usmblks): 0\n"
3365 "Free bytes held in fastbins (fsmblks): 0\n"
3366 "Total allocated space (uordblks): 52000\n"
3367 "Total free space (fordblks): 83168\n"
3368 "Topmost releasable block (keepcost): 31168\n"
3370 "============== After freeing blocks ==============\n"
3371 "Total non-mmapped bytes (arena): 135168\n"
3372 "# of free chunks (ordblks): 501\n"
3373 "# of free fastbin blocks (smblks): 0\n"
3374 "# of mapped regions (hblks): 0\n"
3375 "Bytes in mapped regions (hblkhd): 0\n"
3376 "Max. total allocated space (usmblks): 0\n"
3377 "Free bytes held in fastbins (fsmblks): 0\n"
3378 "Total allocated space (uordblks): 52000\n"
3379 "Total free space (fordblks): 83168\n"
3380 "Topmost releasable block (keepcost): 31168\n"
3383 #: build/C/man3/mallinfo.3:241 build/C/man3/malloc_info.3:180
3384 #: build/C/man3/mallopt.3:579 build/C/man3/mcheck.3:197 build/C/man2/mmap.2:921
3385 #: build/C/man2/mprotect.2:304 build/C/man7/pkeys.7:183
3387 msgid "Program source"
3391 #: build/C/man3/mallinfo.3:247
3394 #| "#include E<lt>malloc.hE<gt>\n"
3395 #| "#include E<lt>stdio.hE<gt>\n"
3396 #| "#include E<lt>stdlib.hE<gt>\n"
3398 "#include E<lt>malloc.hE<gt>\n"
3399 "#include E<lt>stdlib.hE<gt>\n"
3400 "#include E<lt>string.hE<gt>\n"
3402 "#include E<lt>malloc.hE<gt>\n"
3403 "#include E<lt>stdio.hE<gt>\n"
3404 "#include E<lt>stdlib.hE<gt>\n"
3407 #: build/C/man3/mallinfo.3:252
3411 "display_mallinfo(void)\n"
3413 " struct mallinfo mi;\n"
3416 "display_mallinfo(void)\n"
3418 " struct mallinfo mi;\n"
3421 #: build/C/man3/mallinfo.3:254
3423 msgid " mi = mallinfo();\n"
3424 msgstr " mi = mallinfo();\n"
3427 #: build/C/man3/mallinfo.3:266
3430 " printf(\"Total non-mmapped bytes (arena): %d\\en\", mi.arena);\n"
3431 " printf(\"# of free chunks (ordblks): %d\\en\", mi.ordblks);\n"
3432 " printf(\"# of free fastbin blocks (smblks): %d\\en\", mi.smblks);\n"
3433 " printf(\"# of mapped regions (hblks): %d\\en\", mi.hblks);\n"
3434 " printf(\"Bytes in mapped regions (hblkhd): %d\\en\", mi.hblkhd);\n"
3435 " printf(\"Max. total allocated space (usmblks): %d\\en\", mi.usmblks);\n"
3436 " printf(\"Free bytes held in fastbins (fsmblks): %d\\en\", mi.fsmblks);\n"
3437 " printf(\"Total allocated space (uordblks): %d\\en\", mi.uordblks);\n"
3438 " printf(\"Total free space (fordblks): %d\\en\", mi.fordblks);\n"
3439 " printf(\"Topmost releasable block (keepcost): %d\\en\", mi.keepcost);\n"
3442 " printf(\"Total non-mmapped bytes (arena): %d\\en\", mi.arena);\n"
3443 " printf(\"# of free chunks (ordblks): %d\\en\", mi.ordblks);\n"
3444 " printf(\"# of free fastbin blocks (smblks): %d\\en\", mi.smblks);\n"
3445 " printf(\"# of mapped regions (hblks): %d\\en\", mi.hblks);\n"
3446 " printf(\"Bytes in mapped regions (hblkhd): %d\\en\", mi.hblkhd);\n"
3447 " printf(\"Max. total allocated space (usmblks): %d\\en\", mi.usmblks);\n"
3448 " printf(\"Free bytes held in fastbins (fsmblks): %d\\en\", mi.fsmblks);\n"
3449 " printf(\"Total allocated space (uordblks): %d\\en\", mi.uordblks);\n"
3450 " printf(\"Total free space (fordblks): %d\\en\", mi.fordblks);\n"
3451 " printf(\"Topmost releasable block (keepcost): %d\\en\", mi.keepcost);\n"
3455 #: build/C/man3/mallinfo.3:274
3459 #| "main(int argc, char *argv[])\n"
3461 #| "#define MAX_ALLOCS 2000000\n"
3462 #| " char *alloc[MAX_ALLOCS];\n"
3463 #| " int numBlocks, j, freeBegin, freeEnd, freeStep;\n"
3464 #| " size_t blockSize;\n"
3467 "main(int argc, char *argv[])\n"
3469 "#define MAX_ALLOCS 2000000\n"
3470 " char *alloc[MAX_ALLOCS];\n"
3471 " int numBlocks, freeBegin, freeEnd, freeStep;\n"
3472 " size_t blockSize;\n"
3475 "main(int argc, char *argv[])\n"
3477 "#define MAX_ALLOCS 2000000\n"
3478 " char *alloc[MAX_ALLOCS];\n"
3479 " int numBlocks, j, freeBegin, freeEnd, freeStep;\n"
3480 " size_t blockSize;\n"
3483 #: build/C/man3/mallinfo.3:280
3486 #| " if (argc E<lt> 3 || strcmp(argv[1], \"--help\") == 0)\n"
3487 #| " usageErr(\"%s num-blocks block-size [free-step [start-free \"\n"
3488 #| " \"[end-free]]]\\en\", argv[0]);\n"
3490 " if (argc E<lt> 3 || strcmp(argv[1], \"--help\") == 0) {\n"
3491 " fprintf(stderr, \"%s num-blocks block-size [free-step \"\n"
3492 " \"[start-free [end-free]]]\\en\", argv[0]);\n"
3493 " exit(EXIT_FAILURE);\n"
3496 " if (argc E<lt> 3 || strcmp(argv[1], \"--help\") == 0)\n"
3497 " usageErr(\"%s num-blocks block-size [free-step [start-free \"\n"
3498 " \"[end-free]]]\\en\", argv[0]);\n"
3501 #: build/C/man3/mallinfo.3:286
3504 " numBlocks = atoi(argv[1]);\n"
3505 " blockSize = atoi(argv[2]);\n"
3506 " freeStep = (argc E<gt> 3) ? atoi(argv[3]) : 1;\n"
3507 " freeBegin = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
3508 " freeEnd = (argc E<gt> 5) ? atoi(argv[5]) : numBlocks;\n"
3510 " numBlocks = atoi(argv[1]);\n"
3511 " blockSize = atoi(argv[2]);\n"
3512 " freeStep = (argc E<gt> 3) ? atoi(argv[3]) : 1;\n"
3513 " freeBegin = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
3514 " freeEnd = (argc E<gt> 5) ? atoi(argv[5]) : numBlocks;\n"
3517 #: build/C/man3/mallinfo.3:289
3520 " printf(\"============== Before allocating blocks ==============\\en\");\n"
3521 " display_mallinfo();\n"
3523 " printf(\"============== Before allocating blocks ==============\\en\");\n"
3524 " display_mallinfo();\n"
3527 #: build/C/man3/mallinfo.3:295
3530 #| " for (j = 0; j E<lt> numBlocks; j++) {\n"
3531 #| " if (numBlocks E<gt>= MAX_ALLOCS)\n"
3532 #| " fatal(\"Too many allocations\");\n"
3534 " for (int j = 0; j E<lt> numBlocks; j++) {\n"
3535 " if (numBlocks E<gt>= MAX_ALLOCS) {\n"
3536 " fprintf(stderr, \"Too many allocations\\en\");\n"
3537 " exit(EXIT_FAILURE);\n"
3540 " for (j = 0; j E<lt> numBlocks; j++) {\n"
3541 " if (numBlocks E<gt>= MAX_ALLOCS)\n"
3542 " fatal(\"Too many allocations\");\n"
3545 #: build/C/man3/mallinfo.3:302
3548 #| " alloc[j] = malloc(blockSize);\n"
3549 #| " if (alloc[j] == NULL)\n"
3550 #| " errExit(\"malloc\");\n"
3553 " alloc[j] = malloc(blockSize);\n"
3554 " if (alloc[j] == NULL) {\n"
3555 " perror(\"malloc\");\n"
3556 " exit(EXIT_FAILURE);\n"
3560 " alloc[j] = malloc(blockSize);\n"
3561 " if (alloc[j] == NULL)\n"
3562 " errExit(\"malloc\");\n"
3566 #: build/C/man3/mallinfo.3:305
3569 " printf(\"\\en============== After allocating blocks ==============\\en\");\n"
3570 " display_mallinfo();\n"
3572 " printf(\"\\en============== After allocating blocks ==============\\en\");\n"
3573 " display_mallinfo();\n"
3576 #: build/C/man3/mallinfo.3:308
3579 #| " for (j = freeBegin; j E<lt> freeEnd; j += freeStep)\n"
3580 #| " free(alloc[j]);\n"
3582 " for (int j = freeBegin; j E<lt> freeEnd; j += freeStep)\n"
3583 " free(alloc[j]);\n"
3585 " for (j = freeBegin; j E<lt> freeEnd; j += freeStep)\n"
3586 " free(alloc[j]);\n"
3589 #: build/C/man3/mallinfo.3:311
3592 " printf(\"\\en============== After freeing blocks ==============\\en\");\n"
3593 " display_mallinfo();\n"
3595 " printf(\"\\en============== After freeing blocks ==============\\en\");\n"
3596 " display_mallinfo();\n"
3599 #: build/C/man3/mallinfo.3:314 build/C/man3/malloc_info.3:265
3600 #: build/C/man3/mallopt.3:612 build/C/man3/mcheck.3:224 build/C/man2/mmap.2:993
3601 #: build/C/man3/shm_open.3:423 build/C/man3/shm_open.3:503
3602 #: build/C/man2/shmop.2:435 build/C/man2/shmop.2:498
3603 #: build/C/man2/memfd_create.2:493 build/C/man2/memfd_create.2:545
3604 #: build/C/man2/membarrier.2:380 build/C/man2/membarrier.2:469
3605 #: build/C/man7/pkeys.7:291
3608 " exit(EXIT_SUCCESS);\n"
3611 " exit(EXIT_SUCCESS);\n"
3615 #: build/C/man3/mallinfo.3:324
3617 "B<mmap>(2), B<malloc>(3), B<malloc_info>(3), B<malloc_stats>(3), "
3618 "B<malloc_trim>(3), B<mallopt>(3)"
3620 "B<mmap>(2), B<malloc>(3), B<malloc_info>(3), B<malloc_stats>(3), "
3621 "B<malloc_trim>(3), B<mallopt>(3)"
3624 #: build/C/man3/malloc_get_state.3:25
3626 msgid "MALLOC_GET_STATE"
3627 msgstr "MALLOC_GET_STATE"
3630 #: build/C/man3/malloc_get_state.3:28
3632 "malloc_get_state, malloc_set_state - record and restore state of malloc "
3634 msgstr "malloc_get_state, malloc_set_state - malloc 実装の状態を保存/復元する"
3637 #: build/C/man3/malloc_get_state.3:31 build/C/man3/malloc_hook.3:18
3638 #: build/C/man3/malloc_info.3:31 build/C/man3/posix_memalign.3:41
3640 msgid "B<#include E<lt>malloc.hE<gt>>\n"
3641 msgstr "B<#include E<lt>malloc.hE<gt>>\n"
3644 #: build/C/man3/malloc_get_state.3:33
3646 #| msgid "B<void* malloc_get_state(void);>\n"
3647 msgid "B<void *malloc_get_state(void);>\n"
3648 msgstr "B<void* malloc_get_state(void);>\n"
3651 #: build/C/man3/malloc_get_state.3:35
3653 msgid "B<int malloc_set_state(void *>I<state>B<);>\n"
3654 msgstr "B<int malloc_set_state(void *>I<state>B<);>\n"
3657 #: build/C/man3/malloc_get_state.3:39
3659 #| msgid "These functions are provided in glibc 2.2 and later."
3660 msgid "I<Note>: these function are removed in glibc version 2.25."
3661 msgstr "これらの関数は glibc 2.2 以降で提供されている。"
3664 #: build/C/man3/malloc_get_state.3:56
3666 "The B<malloc_get_state>() function records the current state of all "
3667 "B<malloc>(3) internal bookkeeping variables (but not the actual contents of "
3668 "the heap or the state of B<malloc_hook>(3) functions pointers). The state "
3669 "is recorded in a system-dependent opaque data structure dynamically "
3670 "allocated via B<malloc>(3), and a pointer to that data structure is returned "
3671 "as the function result. (It is the caller's responsibility to B<free>(3) "
3674 "B<malloc_get_state>() 関数は B<malloc>(3) 内部のすべての管理用変数を記録する "
3675 "(ただし、 ヒープの実際の内容と B<malloc_hook>(3) 関数ポインターの状態は記録さ"
3676 "れない)。 状態は B<malloc>(3) で動的に確保されたシステム依存の opaque な (内"
3677 "部構造は分からない) データ構造体に記録され、 関数の結果としてそのデータ構造体"
3678 "へのポインターが返される (このメモリーは呼び出し元が責任をもって B<free>(3) "
3682 #: build/C/man3/malloc_get_state.3:64
3684 "The B<malloc_set_state>() function restores the state of all B<malloc>(3) "
3685 "internal bookkeeping variables to the values recorded in the opaque data "
3686 "structure pointed to by I<state>."
3688 "B<malloc_set_state>() 関数は、 B<malloc>(3) 内部のすべての管理用変数を "
3689 "I<state> が指す opaque なデータ構造体から復元する。"
3692 #: build/C/man3/malloc_get_state.3:71
3694 "On success, B<malloc_get_state>() returns a pointer to a newly allocated "
3695 "opaque data structure. On error (for example, memory could not be allocated "
3696 "for the data structure), B<malloc_get_state>() returns NULL."
3698 "成功すると、 B<malloc_get_state>() は新しく割り当てられたデータ構造体へのポイ"
3699 "ンターを返す。 エラーの場合 (例えば、データ構造体に必要なメモリーが割り当てら"
3700 "れなかったなど)、 B<malloc_get_state>() は NULL を返す。"
3702 #. if(ms->magic != MALLOC_STATE_MAGIC) return -1;
3703 #. /* Must fail if the major version is too high. */
3704 #. if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2;
3706 #: build/C/man3/malloc_get_state.3:89
3708 "On success, B<malloc_set_state>() returns 0. If the implementation detects "
3709 "that I<state> does not point to a correctly formed data structure, "
3710 "B<malloc_set_state>() returns -1. If the implementation detects that the "
3711 "version of the data structure referred to by I<state> is a more recent "
3712 "version than this implementation knows about, B<malloc_set_state>() returns "
3715 "成功すると、 B<malloc_set_state>() は 0 を返す。 実装が I<state> が正しく作成"
3716 "されたデータ構造体を指していないと検出した場合、 B<malloc_set_state>() は -1 "
3717 "を返す。 I<state> が参照するデータ構造体のバージョンがこの実装が認識するバー"
3718 "ジョンよりも新しいと実装が検出した場合、 B<malloc_set_state>() は -2 を返す。"
3721 #: build/C/man3/malloc_get_state.3:100
3723 #| msgid "B<malloc>(3), B<mallopt>(3)"
3725 "B<malloc_get_state>(),\n"
3726 "B<malloc_set_state>()"
3727 msgstr "B<malloc>(3), B<mallopt>(3)"
3730 #: build/C/man3/malloc_get_state.3:105 build/C/man3/malloc_hook.3:84
3731 #: build/C/man3/mcheck.3:168 build/C/man3/mtrace.3:102
3732 msgid "These functions are GNU extensions."
3733 msgstr "これらの関数は GNU による拡張である。"
3736 #: build/C/man3/malloc_get_state.3:111
3738 "These functions are useful when using this B<malloc>(3) implementation as "
3739 "part of a shared library, and the heap contents are saved/restored via some "
3740 "other method. This technique is used by GNU Emacs to implement its \"dumping"
3743 "これらの関数が役に立つのは、 この B<malloc>(3) の実装が共有ライブラリの一部と"
3744 "して使用され、 ヒープの内容が何か他の方法で保存/復元される場合である。 この手"
3745 "法は GNU Emacs が「ダンプ」関数 (\"dumping\" function) を実装するのに使用され"
3748 #. i.e., calls __malloc_check_init()
3749 #. i.e., malloc checking is not already in use
3750 #. and the caller requested malloc checking
3752 #: build/C/man3/malloc_get_state.3:128
3754 "Hook function pointers are never saved or restored by these functions, with "
3755 "two exceptions: if malloc checking (see B<mallopt>(3)) was in use when "
3756 "B<malloc_get_state>() was called, then B<malloc_set_state>() resets malloc "
3757 "checking hooks if possible; if malloc checking was not in use in the "
3758 "recorded state, but the caller has requested malloc checking, then the hooks "
3761 "これらの関数がフック関数ポインターの保存と復元を行うことはない。 ただし、 2 "
3762 "つ例外がある。 B<malloc_get_state>() が呼び出された際に malloc チェック "
3763 "(B<mallopt>(3) 参照) が使用中の場合、 B<malloc_set_state>() は可能なら "
3764 "malloc チェックフックをリセットする。 また、 保存された状態の malloc チェック"
3765 "が使用中でないが、 呼び出し元が malloc チェックを要求していた場合、 フックは "
3769 #: build/C/man3/malloc_get_state.3:131
3770 msgid "B<malloc>(3), B<mallopt>(3)"
3771 msgstr "B<malloc>(3), B<mallopt>(3)"
3774 #: build/C/man3/malloc_hook.3:10
3777 msgstr "MALLOC_HOOK"
3780 #: build/C/man3/malloc_hook.3:15
3782 "__malloc_hook, __malloc_initialize_hook, __memalign_hook, __free_hook, "
3783 "__realloc_hook, __after_morecore_hook - malloc debugging variables"
3785 "__malloc_hook, __malloc_initialize_hook, __memalign_hook, __free_hook, "
3786 "__realloc_hook, __after_morecore_hook - malloc デバッグ用の変数"
3789 #: build/C/man3/malloc_hook.3:20
3791 msgid "B<void *(*__malloc_hook)(size_t >I<size>B<, const void *>I<caller>B<);>\n"
3792 msgstr "B<void *(*__malloc_hook)(size_t >I<size>B<, const void *>I<caller>B<);>\n"
3795 #: build/C/man3/malloc_hook.3:23
3797 msgid "B<void *(*__realloc_hook)(void *>I<ptr>B<, size_t >I<size>B<, const void *>I<caller>B<);>\n"
3798 msgstr "B<void *(*__realloc_hook)(void *>I<ptr>B<, size_t >I<size>B<, const void *>I<caller>B<);>\n"
3801 #: build/C/man3/malloc_hook.3:26
3804 "B<void *(*__memalign_hook)(size_t >I<alignment>B<, size_t >I<size>B<,>\n"
3805 "B< const void *>I<caller>B<);>\n"
3807 "B<void *(*__memalign_hook)(size_t >I<alignment>B<, size_t >I<size>B<,>\n"
3808 "B< const void *>I<caller>B<);>\n"
3811 #: build/C/man3/malloc_hook.3:28
3813 msgid "B<void (*__free_hook)(void *>I<ptr>B<, const void *>I<caller>B<);>\n"
3814 msgstr "B<void (*__free_hook)(void *>I<ptr>B<, const void *>I<caller>B<);>\n"
3817 #: build/C/man3/malloc_hook.3:30
3819 msgid "B<void (*__malloc_initialize_hook)(void);>\n"
3820 msgstr "B<void (*__malloc_initialize_hook)(void);>\n"
3823 #: build/C/man3/malloc_hook.3:32
3825 msgid "B<void (*__after_morecore_hook)(void);>\n"
3826 msgstr "B<void (*__after_morecore_hook)(void);>\n"
3829 #: build/C/man3/malloc_hook.3:43
3831 "The GNU C library lets you modify the behavior of B<malloc>(3), "
3832 "B<realloc>(3), and B<free>(3) by specifying appropriate hook functions. "
3833 "You can use these hooks to help you debug programs that use dynamic memory "
3834 "allocation, for example."
3836 "GNU C ライブラリでは、適切なフック関数 (hook function) を指定することで "
3837 "B<malloc>(3), B<realloc>(3), B<free>(3) の動作を変更することができる。例え"
3838 "ば、動的にメモリー割り当てを行う プログラムのデバッグにこれらのフックを使うこ"
3842 #: build/C/man3/malloc_hook.3:50
3844 "The variable B<__malloc_initialize_hook> points at a function that is called "
3845 "once when the malloc implementation is initialized. This is a weak "
3846 "variable, so it can be overridden in the application with a definition like "
3849 "変数 B<__malloc_initialize_hook> は malloc の実装が初期化される際に一度だけ呼"
3850 "ばれる関数へのポインターである。 この変数は書き換え可能 (weak) であり、アプリ"
3851 "ケーション内で 以下のような定義で上書きできる:"
3854 #: build/C/man3/malloc_hook.3:54
3856 #| msgid " void (*__malloc_initialize_hook)(void) = my_init_hook;\n"
3857 msgid "void (*__malloc_initialize_hook)(void) = my_init_hook;\n"
3858 msgstr " void (*__malloc_initialize_hook)(void) = my_init_hook;\n"
3861 #: build/C/man3/malloc_hook.3:60
3863 "Now the function I<my_init_hook>() can do the initialization of all hooks."
3865 "なお、関数 I<my_init_hook>() で全てのフックの初期化をすることができる。"
3868 #: build/C/man3/malloc_hook.3:76
3870 "The four functions pointed to by B<__malloc_hook>, B<__realloc_hook>, "
3871 "B<__memalign_hook>, B<__free_hook> have a prototype like the functions "
3872 "B<malloc>(3), B<realloc>(3), B<memalign>(3), B<free>(3), respectively, "
3873 "except that they have a final argument I<caller> that gives the address of "
3874 "the caller of B<malloc>(3), etc."
3876 "B<__malloc_hook>, B<__realloc_hook>, B<__memalign_hook>, B<__free_hook> で指"
3877 "される 4 つの関数は、各々 B<malloc>(3), B<realloc>(3), B<memalign>(3), "
3878 "B<free>(3) とよく似たプロトタイプを持っているが、 一番最後の引き数 "
3879 "I<caller> をとる点が異なる。 引き数 I<caller> には、 B<malloc>(3) などの呼び"
3880 "出し元 (caller) のアドレスが格納される。"
3883 #: build/C/man3/malloc_hook.3:82
3885 "The variable B<__after_morecore_hook> points at a function that is called "
3886 "each time after B<sbrk>(2) was asked for more memory."
3888 "変数 B<__after_morecore_hook> は、領域の追加要求があり B<sbrk>(2) が呼ばれた"
3889 "後で毎回呼び出される関数へのポインターである。"
3891 #. https://bugzilla.redhat.com/show_bug.cgi?id=450187
3892 #. http://sourceware.org/bugzilla/show_bug.cgi?id=9957
3894 #: build/C/man3/malloc_hook.3:94
3897 #| "The use of these hook functions is not safe in multithreaded programs, "
3898 #| "and they are now deprecated. Programmers should instead preempt calls to "
3899 #| "the relevant functions by defining and exporting functions such as "
3900 #| "\"malloc\" and \"free\"."
3902 "The use of these hook functions is not safe in multithreaded programs, and "
3903 "they are now deprecated. From glibc 2.24 onwards, the "
3904 "B<__malloc_initialize_hook> variable has been removed from the API. "
3905 "Programmers should instead preempt calls to the relevant functions by "
3906 "defining and exporting functions such as \"malloc\" and \"free\"."
3908 "マルチスレッドプログラムでは、 これらのフック関数の使用は安全ではなく、 今で"
3909 "は非推奨である。 プログラマは、 \"malloc\" や \"free\" のような関数を定義して"
3910 "公開して、 関連する関数を呼び出すようにすべきである。"
3913 #: build/C/man3/malloc_hook.3:96
3914 msgid "Here is a short example of how to use these variables."
3915 msgstr "これらの変数の使い方の簡単な例を以下に示す。"
3918 #: build/C/man3/malloc_hook.3:100
3921 "#include E<lt>stdio.hE<gt>\n"
3922 "#include E<lt>malloc.hE<gt>\n"
3924 "#include E<lt>stdio.hE<gt>\n"
3925 "#include E<lt>malloc.hE<gt>\n"
3928 #: build/C/man3/malloc_hook.3:104
3931 "/* Prototypes for our hooks. */\n"
3932 "static void my_init_hook(void);\n"
3933 "static void *my_malloc_hook(size_t, const void *);\n"
3935 "/* 使おうとするフックのプロトタイプ宣言 */\n"
3936 "static void my_init_hook(void);\n"
3937 "static void *my_malloc_hook(size_t, const void *);\n"
3940 #: build/C/man3/malloc_hook.3:107
3943 "/* Variables to save original hooks. */\n"
3944 "static void *(*old_malloc_hook)(size_t, const void *);\n"
3946 "/* 元々のフックを保存するための変数 */\n"
3947 "static void *(*old_malloc_hook)(size_t, const void *);\n"
3950 #: build/C/man3/malloc_hook.3:110
3953 "/* Override initializing hook from the C library. */\n"
3954 "void (*__malloc_initialize_hook) (void) = my_init_hook;\n"
3956 "/* C ライブラリから呼ばれる初期化フックを上書きする */\n"
3957 "void (*__malloc_initialize_hook) (void) = my_init_hook;\n"
3960 #: build/C/man3/malloc_hook.3:117
3964 "my_init_hook(void)\n"
3966 " old_malloc_hook = __malloc_hook;\n"
3967 " __malloc_hook = my_malloc_hook;\n"
3971 "my_init_hook(void)\n"
3973 " old_malloc_hook = __malloc_hook;\n"
3974 " __malloc_hook = my_malloc_hook;\n"
3978 #: build/C/man3/malloc_hook.3:122
3982 "my_malloc_hook(size_t size, const void *caller)\n"
3987 "my_malloc_hook(size_t size, const void *caller)\n"
3992 #: build/C/man3/malloc_hook.3:125
3995 " /* Restore all old hooks */\n"
3996 " __malloc_hook = old_malloc_hook;\n"
3998 " /* 元々のフックを全て戻す */\n"
3999 " __malloc_hook = old_malloc_hook;\n"
4002 #: build/C/man3/malloc_hook.3:128
4005 " /* Call recursively */\n"
4006 " result = malloc(size);\n"
4008 " /* malloc の再帰的呼び出し */\n"
4009 " result = malloc(size);\n"
4012 #: build/C/man3/malloc_hook.3:131
4015 " /* Save underlying hooks */\n"
4016 " old_malloc_hook = __malloc_hook;\n"
4018 " /* 現在設定されているフック (underlying hook) を保存する */\n"
4019 " old_malloc_hook = __malloc_hook;\n"
4022 #: build/C/man3/malloc_hook.3:135
4025 #| " /* printf() might call malloc(), so protect it too. */\n"
4026 #| " printf(\"malloc(%u) called from %p returns %p\\en\",\n"
4027 #| " (unsigned int) size, caller, result);\n"
4029 " /* printf() might call malloc(), so protect it too. */\n"
4030 " printf(\"malloc(%zu) called from %p returns %p\\en\",\n"
4031 " size, caller, result);\n"
4033 " /* printf() は malloc() を呼び出す可能性があるので\n"
4034 " ここでもガードを行う (元々のフックのままにしておく) */\n"
4035 " printf(\"malloc(%u) called from %p returns %p\\en\",\n"
4036 " (unsigned int) size, caller, result);\n"
4039 #: build/C/man3/malloc_hook.3:138
4042 " /* Restore our own hooks */\n"
4043 " __malloc_hook = my_malloc_hook;\n"
4045 " /* ユーザーが使おうとするフックを再設定する */\n"
4046 " __malloc_hook = my_malloc_hook;\n"
4049 #: build/C/man3/malloc_hook.3:141
4059 #: build/C/man3/malloc_hook.3:147
4060 msgid "B<mallinfo>(3), B<malloc>(3), B<mcheck>(3), B<mtrace>(3)"
4061 msgstr "B<mallinfo>(3), B<malloc>(3), B<mcheck>(3), B<mtrace>(3)"
4064 #: build/C/man3/malloc_info.3:25
4067 msgstr "MALLOC_INFO"
4070 #: build/C/man3/malloc_info.3:28
4071 msgid "malloc_info - export malloc state to a stream"
4072 msgstr "malloc_info - malloc の状態をストリームに出力する"
4075 #: build/C/man3/malloc_info.3:33
4077 msgid "B<int malloc_info(int >I<options>B<, FILE *>I<stream>B<);>\n"
4078 msgstr "B<int malloc_info(int >I<options>B<, FILE *>I<stream>B<);>\n"
4081 #: build/C/man3/malloc_info.3:44
4083 "The B<malloc_info>() function exports an XML string that describes the "
4084 "current state of the memory-allocation implementation in the caller. The "
4085 "string is printed on the file stream I<stream>. The exported string "
4086 "includes information about all arenas (see B<malloc>(3))."
4088 "B<malloc_info>() 関数は、 呼び出し元のメモリー割り当て実装の現在の状態を表す "
4089 "XML 文字列を出力する。 文字列は、 ファイルストリーム I<stream> に出力され"
4090 "る。 出力された文字列には、 全ての割り当て領域の情報が含まれる (B<malloc>(3) "
4094 #: build/C/man3/malloc_info.3:48
4095 msgid "As currently implemented, I<options> must be zero."
4096 msgstr "現在の実装では、 I<options> は 0 でなければならない。"
4099 #: build/C/man3/malloc_info.3:55
4101 "On success, B<malloc_info>() returns 0; on error, it returns -1, with "
4102 "I<errno> set to indicate the cause."
4104 "B<malloc_info>() は、成功すると 0 を返す。 エラーの場合、-1 を返し、 "
4105 "I<errno> にエラーの原因を示す値を設定する。"
4108 #: build/C/man3/malloc_info.3:60
4109 msgid "I<options> was nonzero."
4110 msgstr "I<options> が 0 でなかった。"
4113 #: build/C/man3/malloc_info.3:63
4114 msgid "B<malloc_info>() was added to glibc in version 2.10."
4115 msgstr "B<malloc_info>() は glibc バージョン 2.10 で追加された。"
4118 #: build/C/man3/malloc_info.3:73
4120 #| msgid "B<malloc>(3)"
4121 msgid "B<malloc_info>()"
4122 msgstr "B<malloc>(3)"
4125 #: build/C/man3/malloc_info.3:78 build/C/man3/malloc_stats.3:69
4126 #: build/C/man3/malloc_trim.3:76 build/C/man3/malloc_usable_size.3:62
4127 msgid "This function is a GNU extension."
4128 msgstr "この関数は GNU による拡張である。"
4131 #: build/C/man3/malloc_info.3:84
4133 "The memory-allocation information is provided as an XML string (rather than "
4134 "a C structure) because the information may change over time (according to "
4135 "changes in the underlying implementation). The output XML string includes a "
4138 "メモリー割り当て情報は (C の構造体ではなく) XML 文字列として提供される。 これ"
4139 "は、 この情報は時間をたつと (内部で使用している実装によって) 変わる可能性があ"
4140 "るからである。 出力される XML 文字列にはバージョンフィールドが付いている。"
4143 #: build/C/man3/malloc_info.3:90
4145 "The B<open_memstream>(3) function can be used to send the output of "
4146 "B<malloc_info>() directly into a buffer in memory, rather than to a file."
4148 "B<open_memstream>(3) 関数を使うと、 B<malloc_info>() の出力を、 ファイルでは"
4149 "なくメモリー内のバッファーに直接送ることができる。"
4152 #: build/C/man3/malloc_info.3:97
4154 "The B<malloc_info>() function is designed to address deficiencies in "
4155 "B<malloc_stats>(3) and B<mallinfo>(3)."
4157 "B<malloc_info>() 関数は、 B<malloc_stats>(3) と B<mallinfo>(3) の不備を解決す"
4161 #: build/C/man3/malloc_info.3:108
4163 "The program below takes up to four command-line arguments, of which the "
4164 "first three are mandatory. The first argument specifies the number of "
4165 "threads that the program should create. All of the threads, including the "
4166 "main thread, allocate the number of blocks of memory specified by the second "
4167 "argument. The third argument controls the size of the blocks to be "
4168 "allocated. The main thread creates blocks of this size, the second thread "
4169 "created by the program allocates blocks of twice this size, the third thread "
4170 "allocates blocks of three times this size, and so on."
4172 "以下のプログラムは最大で 4 つのコマンドライン引数を取り、 最初の 3 つは必須で"
4173 "ある。 最初の引数は、このプログラムが生成するスレッド数を指定する。 メインス"
4174 "レッドを含む全てのスレッドが第 2 引数で指定した数のメモリーブロックの割り当て"
4175 "を行う。 第 3 引数は割り当てるブロックのサイズを制御する。 メインスレッドはこ"
4176 "のサイズのブロックを作成し、 このプログラムが生成する 2 番目のスレッドはこの"
4177 "サイズの 2 倍のサイズのブロックを、 3 番目のスレッドはこのサイズの 3 倍のサイ"
4178 "ズのブロックを割り当て、 以下同様である。"
4181 #: build/C/man3/malloc_info.3:115
4183 "The program calls B<malloc_info>() twice to display the memory-allocation "
4184 "state. The first call takes place before any threads are created or memory "
4185 "allocated. The second call is performed after all threads have allocated "
4188 "このプログラムは B<malloc_info>() を 2 回呼び出し、メモリー割り当て状態を表示"
4189 "する。 最初の呼び出しはスレッドの生成もメモリーの割り当ても行われる前に実行さ"
4190 "れる。 2 回目の呼び出しは全てのスレッドがメモリー割り当てを行った後に実行され"
4194 #: build/C/man3/malloc_info.3:123
4196 "In the following example, the command-line arguments specify the creation of "
4197 "one additional thread, and both the main thread and the additional thread "
4198 "allocate 10000 blocks of memory. After the blocks of memory have been "
4199 "allocated, B<malloc_info>() shows the state of two allocation arenas."
4201 "以下の例では、 コマンドライン引数で、 追加でスレッドを一つ生成し、メインス"
4202 "レッドと追加のスレッドの両方が 10000 個のメモリーブロックを割り当てるように指"
4203 "定している。 メモリーブロックの割り当て後の B<malloc_info>() では、 2 つの割"
4207 #: build/C/man3/malloc_info.3:148
4210 "$ B<getconf GNU_LIBC_VERSION>\n"
4212 "$ B<./a.out 1 10000 100>\n"
4213 "============ Before allocating blocks ============\n"
4214 "E<lt>malloc version=\"1\"E<gt>\n"
4215 "E<lt>heap nr=\"0\"E<gt>\n"
4217 "E<lt>/sizesE<gt>\n"
4218 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4219 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4220 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
4221 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
4222 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
4223 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
4225 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4226 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4227 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
4228 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
4229 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
4230 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
4231 "E<lt>/mallocE<gt>\n"
4233 "$ B<getconf GNU_LIBC_VERSION>\n"
4235 "$ B<./a.out 1 10000 100>\n"
4236 "============ Before allocating blocks ============\n"
4237 "E<lt>malloc version=\"1\"E<gt>\n"
4238 "E<lt>heap nr=\"0\"E<gt>\n"
4240 "E<lt>/sizesE<gt>\n"
4241 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4242 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4243 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
4244 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
4245 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
4246 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
4248 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4249 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4250 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
4251 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
4252 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
4253 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
4254 "E<lt>/mallocE<gt>\n"
4257 #: build/C/man3/malloc_info.3:178
4260 "============ After allocating blocks ============\n"
4261 "E<lt>malloc version=\"1\"E<gt>\n"
4262 "E<lt>heap nr=\"0\"E<gt>\n"
4264 "E<lt>/sizesE<gt>\n"
4265 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4266 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4267 "E<lt>system type=\"current\" size=\"1081344\"/E<gt>\n"
4268 "E<lt>system type=\"max\" size=\"1081344\"/E<gt>\n"
4269 "E<lt>aspace type=\"total\" size=\"1081344\"/E<gt>\n"
4270 "E<lt>aspace type=\"mprotect\" size=\"1081344\"/E<gt>\n"
4272 "E<lt>heap nr=\"1\"E<gt>\n"
4274 "E<lt>/sizesE<gt>\n"
4275 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4276 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4277 "E<lt>system type=\"current\" size=\"1032192\"/E<gt>\n"
4278 "E<lt>system type=\"max\" size=\"1032192\"/E<gt>\n"
4279 "E<lt>aspace type=\"total\" size=\"1032192\"/E<gt>\n"
4280 "E<lt>aspace type=\"mprotect\" size=\"1032192\"/E<gt>\n"
4282 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4283 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4284 "E<lt>system type=\"current\" size=\"2113536\"/E<gt>\n"
4285 "E<lt>system type=\"max\" size=\"2113536\"/E<gt>\n"
4286 "E<lt>aspace type=\"total\" size=\"2113536\"/E<gt>\n"
4287 "E<lt>aspace type=\"mprotect\" size=\"2113536\"/E<gt>\n"
4288 "E<lt>/mallocE<gt>\n"
4290 "============ After allocating blocks ============\n"
4291 "E<lt>malloc version=\"1\"E<gt>\n"
4292 "E<lt>heap nr=\"0\"E<gt>\n"
4294 "E<lt>/sizesE<gt>\n"
4295 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4296 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4297 "E<lt>system type=\"current\" size=\"1081344\"/E<gt>\n"
4298 "E<lt>system type=\"max\" size=\"1081344\"/E<gt>\n"
4299 "E<lt>aspace type=\"total\" size=\"1081344\"/E<gt>\n"
4300 "E<lt>aspace type=\"mprotect\" size=\"1081344\"/E<gt>\n"
4302 "E<lt>heap nr=\"1\"E<gt>\n"
4304 "E<lt>/sizesE<gt>\n"
4305 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4306 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4307 "E<lt>system type=\"current\" size=\"1032192\"/E<gt>\n"
4308 "E<lt>system type=\"max\" size=\"1032192\"/E<gt>\n"
4309 "E<lt>aspace type=\"total\" size=\"1032192\"/E<gt>\n"
4310 "E<lt>aspace type=\"mprotect\" size=\"1032192\"/E<gt>\n"
4312 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
4313 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
4314 "E<lt>system type=\"current\" size=\"2113536\"/E<gt>\n"
4315 "E<lt>system type=\"max\" size=\"2113536\"/E<gt>\n"
4316 "E<lt>aspace type=\"total\" size=\"2113536\"/E<gt>\n"
4317 "E<lt>aspace type=\"mprotect\" size=\"2113536\"/E<gt>\n"
4318 "E<lt>/mallocE<gt>\n"
4321 #: build/C/man3/malloc_info.3:187
4324 "#include E<lt>unistd.hE<gt>\n"
4325 "#include E<lt>stdlib.hE<gt>\n"
4326 "#include E<lt>pthread.hE<gt>\n"
4327 "#include E<lt>malloc.hE<gt>\n"
4328 "#include E<lt>errno.hE<gt>\n"
4330 "#include E<lt>unistd.hE<gt>\n"
4331 "#include E<lt>stdlib.hE<gt>\n"
4332 "#include E<lt>pthread.hE<gt>\n"
4333 "#include E<lt>malloc.hE<gt>\n"
4334 "#include E<lt>errno.hE<gt>\n"
4337 #: build/C/man3/malloc_info.3:190
4340 "static size_t blockSize;\n"
4341 "static int numThreads, numBlocks;\n"
4343 "static size_t blockSize;\n"
4344 "static int numThreads, numBlocks;\n"
4347 #: build/C/man3/malloc_info.3:193 build/C/man3/shm_open.3:324
4348 #: build/C/man2/shmop.2:349 build/C/man2/memfd_create.2:421
4349 #: build/C/man2/memfd_create.2:507
4352 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
4355 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
4359 #: build/C/man3/malloc_info.3:198
4362 #| "static void *\n"
4363 #| "thread_func(void *arg)\n"
4366 #| " int tn = (int) arg;\n"
4369 "thread_func(void *arg)\n"
4371 " int tn = (int) arg;\n"
4374 "thread_func(void *arg)\n"
4377 " int tn = (int) arg;\n"
4380 #: build/C/man3/malloc_info.3:201
4383 " /* The multiplier \\(aq(2 + tn)\\(aq ensures that each thread (including\n"
4384 " the main thread) allocates a different amount of memory */\n"
4386 " /* The multiplier \\(aq(2 + tn)\\(aq ensures that each thread (including\n"
4387 " the main thread) allocates a different amount of memory */\n"
4390 #: build/C/man3/malloc_info.3:205
4393 #| " for (j = 0; j E<lt> numBlocks; j++)\n"
4394 #| " if (malloc(blockSize * (2 + tn)) == NULL)\n"
4395 #| " errExit(\"malloc-thread\");\n"
4397 " for (int j = 0; j E<lt> numBlocks; j++)\n"
4398 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
4399 " errExit(\"malloc-thread\");\n"
4401 " for (j = 0; j E<lt> numBlocks; j++)\n"
4402 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
4403 " errExit(\"malloc-thread\");\n"
4406 #: build/C/man3/malloc_info.3:209
4409 " sleep(100); /* Sleep until main thread terminates */\n"
4413 " sleep(100); /* Sleep until main thread terminates */\n"
4418 #: build/C/man3/malloc_info.3:214
4422 #| "main(int argc, char *argv[])\n"
4427 "main(int argc, char *argv[])\n"
4432 "main(int argc, char *argv[])\n"
4437 #: build/C/man3/malloc_info.3:221
4440 " if (argc E<lt> 4) {\n"
4441 " fprintf(stderr,\n"
4442 " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n"
4444 " exit(EXIT_FAILURE);\n"
4447 " if (argc E<lt> 4) {\n"
4448 " fprintf(stderr,\n"
4449 " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n"
4451 " exit(EXIT_FAILURE);\n"
4455 #: build/C/man3/malloc_info.3:226
4458 " numThreads = atoi(argv[1]);\n"
4459 " numBlocks = atoi(argv[2]);\n"
4460 " blockSize = atoi(argv[3]);\n"
4461 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
4463 " numThreads = atoi(argv[1]);\n"
4464 " numBlocks = atoi(argv[2]);\n"
4465 " blockSize = atoi(argv[3]);\n"
4466 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
4469 #: build/C/man3/malloc_info.3:230
4472 #| " thr = calloc(numThreads, sizeof(pthread_t));\n"
4473 #| " if (thr == NULL)\n"
4474 #| " errExit(\"calloc\");\n"
4476 " pthread_t *thr = calloc(numThreads, sizeof(*thr));\n"
4477 " if (thr == NULL)\n"
4478 " errExit(\"calloc\");\n"
4480 " thr = calloc(numThreads, sizeof(pthread_t));\n"
4481 " if (thr == NULL)\n"
4482 " errExit(\"calloc\");\n"
4485 #: build/C/man3/malloc_info.3:233
4488 " printf(\"============ Before allocating blocks ============\\en\");\n"
4489 " malloc_info(0, stdout);\n"
4491 " printf(\"============ Before allocating blocks ============\\en\");\n"
4492 " malloc_info(0, stdout);\n"
4495 #: build/C/man3/malloc_info.3:235
4497 msgid " /* Create threads that allocate different amounts of memory */\n"
4498 msgstr " /* Create threads that allocate different amounts of memory */\n"
4501 #: build/C/man3/malloc_info.3:241
4504 #| " for (tn = 0; tn E<lt> numThreads; tn++) {\n"
4505 #| " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
4506 #| " (void *) tn);\n"
4507 #| " if (errno != 0)\n"
4508 #| " errExit(\"pthread_create\");\n"
4510 " for (int tn = 0; tn E<lt> numThreads; tn++) {\n"
4511 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
4513 " if (errno != 0)\n"
4514 " errExit(\"pthread_create\");\n"
4516 " for (tn = 0; tn E<lt> numThreads; tn++) {\n"
4517 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
4519 " if (errno != 0)\n"
4520 " errExit(\"pthread_create\");\n"
4523 #: build/C/man3/malloc_info.3:246
4526 " /* If we add a sleep interval after the start-up of each\n"
4527 " thread, the threads likely won\\(aqt contend for malloc\n"
4528 " mutexes, and therefore additional arenas won\\(aqt be\n"
4529 " allocated (see malloc(3)). */\n"
4531 " /* If we add a sleep interval after the start-up of each\n"
4532 " thread, the threads likely won\\(aqt contend for malloc\n"
4533 " mutexes, and therefore additional arenas won\\(aqt be\n"
4534 " allocated (see malloc(3)). */\n"
4537 #: build/C/man3/malloc_info.3:250
4540 " if (sleepTime E<gt> 0)\n"
4541 " sleep(sleepTime);\n"
4544 " if (sleepTime E<gt> 0)\n"
4545 " sleep(sleepTime);\n"
4549 #: build/C/man3/malloc_info.3:252
4551 msgid " /* The main thread also allocates some memory */\n"
4552 msgstr " /* The main thread also allocates some memory */\n"
4555 #: build/C/man3/malloc_info.3:256
4558 #| " for (j = 0; j E<lt> numBlocks; j++)\n"
4559 #| " if (malloc(blockSize) == NULL)\n"
4560 #| " errExit(\"malloc\");\n"
4562 " for (int j = 0; j E<lt> numBlocks; j++)\n"
4563 " if (malloc(blockSize) == NULL)\n"
4564 " errExit(\"malloc\");\n"
4566 " for (j = 0; j E<lt> numBlocks; j++)\n"
4567 " if (malloc(blockSize) == NULL)\n"
4568 " errExit(\"malloc\");\n"
4571 #: build/C/man3/malloc_info.3:259
4574 " sleep(2); /* Give all threads a chance to\n"
4575 " complete allocations */\n"
4577 " sleep(2); /* Give all threads a chance to\n"
4578 " complete allocations */\n"
4581 #: build/C/man3/malloc_info.3:262
4584 " printf(\"\\en============ After allocating blocks ============\\en\");\n"
4585 " malloc_info(0, stdout);\n"
4587 " printf(\"\\en============ After allocating blocks ============\\en\");\n"
4588 " malloc_info(0, stdout);\n"
4591 #: build/C/man3/malloc_info.3:272
4593 "B<mallinfo>(3), B<malloc>(3), B<malloc_stats>(3), B<mallopt>(3), "
4594 "B<open_memstream>(3)"
4596 "B<mallinfo>(3), B<malloc>(3), B<malloc_stats>(3), B<mallopt>(3), "
4597 "B<open_memstream>(3)"
4600 #: build/C/man3/malloc_stats.3:25
4602 msgid "MALLOC_STATS"
4603 msgstr "MALLOC_STATS"
4606 #: build/C/man3/malloc_stats.3:25 build/C/man3/malloc_trim.3:25
4607 #: build/C/man7/shm_overview.7:26
4609 #| msgid "2014-08-19"
4614 #: build/C/man3/malloc_stats.3:28
4615 msgid "malloc_stats - print memory allocation statistics"
4616 msgstr "malloc_stats - メモリー割り当ての統計を表示する"
4619 #: build/C/man3/malloc_stats.3:32
4620 msgid "B<void malloc_stats(void);>"
4621 msgstr "B<void malloc_stats(void);>"
4624 #. Available already in glibc 2.0, possibly earlier
4626 #: build/C/man3/malloc_stats.3:54
4628 "The B<malloc_stats>() function prints (on standard error) statistics about "
4629 "memory allocated by B<malloc>(3) and related functions. For each arena "
4630 "(allocation area), this function prints the total amount of memory allocated "
4631 "and the total number of bytes consumed by in-use allocations. (These two "
4632 "values correspond to the I<arena> and I<uordblks> fields retrieved by "
4633 "B<mallinfo>(3).) In addition, the function prints the sum of these two "
4634 "statistics for all arenas, and the maximum number of blocks and bytes that "
4635 "were ever simultaneously allocated using B<mmap>(2)."
4637 "B<malloc_stats>() 関数は B<malloc>(3) や関連する関数により割り当てられたメモ"
4638 "リーに関する統計を (標準エラーに) 出力する。 各領域 (割り当てエリア) につい"
4639 "て、 この関数は割り当てられているメモリーの総量と現在の割り当てが使用している"
4640 "総バイト数を出力する (これらの二つの値は B<mallinfo>(3) で取得できる "
4641 "I<arena> と I<uordblks> フィールドに対応している)。 また、この関数は、 すべて"
4642 "の領域のこれら二つの統計情報の合計値と、 B<mmap>(2) を使って同時に割り当てら"
4643 "れたブロック数とバイト数の最大値を表示する。"
4646 #: build/C/man3/malloc_stats.3:64
4648 #| msgid "B<malloc>(3)"
4649 msgid "B<malloc_stats>()"
4650 msgstr "B<malloc>(3)"
4653 #: build/C/man3/malloc_stats.3:73
4655 "More detailed information about memory allocations in the main arena can be "
4656 "obtained using B<mallinfo>(3)."
4658 "B<mallinfo>(3) を使用すると、 メイン領域のメモリー割り当てに関するより詳細な"
4662 #: build/C/man3/malloc_stats.3:79
4664 "B<mmap>(2), B<mallinfo>(3), B<malloc>(3), B<malloc_info>(3), B<mallopt>(3)"
4666 "B<mmap>(2), B<mallinfo>(3), B<malloc>(3), B<malloc_info>(3), B<mallopt>(3)"
4669 #: build/C/man3/malloc_trim.3:25
4672 msgstr "MALLOC_TRIM"
4675 #: build/C/man3/malloc_trim.3:28
4677 #| msgid "malloc_trim - release free memory from the top of the heap"
4678 msgid "malloc_trim - release free memory from the heap"
4679 msgstr "malloc_trim - ヒープの一番上から未使用メモリーを解放する"
4682 #: build/C/man3/malloc_trim.3:32
4683 msgid "B<int malloc_trim(size_t >I<pad>B<);>"
4684 msgstr "B<int malloc_trim(size_t >I<pad>B<);>"
4687 #: build/C/man3/malloc_trim.3:41
4690 #| "The B<malloc_trim>() function attempts to release free memory at the top "
4691 #| "of the heap (by calling B<sbrk>(2) with a suitable argument)."
4693 "The B<malloc_trim>() function attempts to release free memory from the heap "
4694 "(by calling B<sbrk>(2) or B<madvise>(2) with suitable arguments)."
4696 "B<malloc_trim>() 関数は (適切な引き数で B<sbrk>(2) を呼び出して) ヒープの一番"
4700 #: build/C/man3/malloc_trim.3:52
4702 "The I<pad> argument specifies the amount of free space to leave untrimmed at "
4703 "the top of the heap. If this argument is 0, only the minimum amount of "
4704 "memory is maintained at the top of the heap (i.e., one page or less). A "
4705 "nonzero argument can be used to maintain some trailing space at the top of "
4706 "the heap in order to allow future allocations to be made without having to "
4707 "extend the heap with B<sbrk>(2)."
4709 "I<pad> 引き数は、 ヒープの一番上から切り詰める際に残す未使用領域の量を指定す"
4710 "る。 この引き数が 0 の場合、 ヒープの一番上の最小量のメモリーだけを維持でき"
4711 "る (つまり 1 ページかそれ未満)。 0 以外の引き数を指定すると、 ヒープの一番上"
4712 "にある程度の量の未使用領域を残し、 将来の割り当てを B<sbrk>(2) でヒープを拡張"
4716 #: build/C/man3/malloc_trim.3:57
4718 "The B<malloc_trim>() function returns 1 if memory was actually released "
4719 "back to the system, or 0 if it was not possible to release any memory."
4721 "B<malloc_trim>() 関数はメモリーが実際に解放されシステムに戻された場合に 1 を"
4722 "返し、 どのメモリーも解放できなかった場合は 0 を返す。"
4725 #. Available already in glibc 2.0, possibly earlier
4727 #: build/C/man3/malloc_trim.3:61
4728 msgid "No errors are defined."
4729 msgstr "エラーは定義されていない。"
4732 #: build/C/man3/malloc_trim.3:71
4734 #| msgid "B<malloc>(3)"
4735 msgid "B<malloc_trim>()"
4736 msgstr "B<malloc>(3)"
4739 #: build/C/man3/malloc_trim.3:85
4741 "This function is automatically called by B<free>(3) in certain "
4742 "circumstances; see the discussion of B<M_TOP_PAD> and B<M_TRIM_THRESHOLD> in "
4745 "この関数は、 特定の状況では B<free>(3) により自動的に呼び出される。 "
4746 "B<mallopt>(3) の B<M_TOP_PAD> と B<M_TRIM_THRESHOLD> の議論を参照。"
4749 #: build/C/man3/malloc_trim.3:91
4751 "Only the main heap (using B<sbrk>(2)) honors the I<pad> argument; thread "
4755 #. See commit 68631c8eb92ff38d9da1ae34f6aa048539b199cc
4756 #. (dated 2007-12-16) which adds iteration over all
4757 #. arenas and frees all pages in chunks which are free.
4759 #: build/C/man3/malloc_trim.3:97
4761 "Since glibc 2.8 this function frees memory in all arenas and in all chunks "
4762 "with whole free pages."
4766 #: build/C/man3/malloc_trim.3:100
4769 #| "The B<malloc_trim>() function attempts to release free memory at the top "
4770 #| "of the heap (by calling B<sbrk>(2) with a suitable argument)."
4772 "Before glibc 2.8 this function only freed memory at the top of the heap in "
4775 "B<malloc_trim>() 関数は (適切な引き数で B<sbrk>(2) を呼び出して) ヒープの一番"
4779 #: build/C/man3/malloc_trim.3:104
4780 msgid "B<sbrk>(2), B<malloc>(3), B<mallopt>(3)"
4781 msgstr "B<sbrk>(2), B<malloc>(3), B<mallopt>(3)"
4784 #: build/C/man3/malloc_usable_size.3:25
4786 msgid "MALLOC_USABLE_SIZE"
4787 msgstr "MALLOC_USABLE_SIZE"
4790 #: build/C/man3/malloc_usable_size.3:28
4791 msgid "malloc_usable_size - obtain size of block of memory allocated from heap"
4793 "malloc_usable_size - ヒープから確保したメモリーブロックのサイズを取得する"
4796 #: build/C/man3/malloc_usable_size.3:32
4797 msgid "B<size_t malloc_usable_size (void *>I<ptr>B<);>"
4798 msgstr "B<size_t malloc_usable_size (void *>I<ptr>B<);>"
4801 #: build/C/man3/malloc_usable_size.3:40
4803 "The B<malloc_usable_size>() function returns the number of usable bytes in "
4804 "the block pointed to by I<ptr>, a pointer to a block of memory allocated by "
4805 "B<malloc>(3) or a related function."
4807 "B<malloc_usable_size>() 関数は、 I<ptr> が指すブロックで使用可能なバイト数を"
4808 "返す。 I<ptr> は、B<malloc>(3) や同様の関数で割り当てられたメモリーブロックへ"
4812 #: build/C/man3/malloc_usable_size.3:48
4814 "B<malloc_usable_size>() returns the number of usable bytes in the block of "
4815 "allocated memory pointed to by I<ptr>. If I<ptr> is NULL, 0 is returned."
4817 "B<malloc_usable_size>() は I<ptr> が指す割り当て済みメモリーブロックで使用可"
4818 "能なバイト数を返す。 I<ptr> が NULL の場合、 0 が返される。"
4821 #: build/C/man3/malloc_usable_size.3:58
4823 #| msgid "B<size_t malloc_usable_size (void *>I<ptr>B<);>"
4824 msgid "B<malloc_usable_size>()"
4825 msgstr "B<size_t malloc_usable_size (void *>I<ptr>B<);>"
4828 #: build/C/man3/malloc_usable_size.3:72
4830 "The value returned by B<malloc_usable_size>() may be greater than the "
4831 "requested size of the allocation because of alignment and minimum size "
4832 "constraints. Although the excess bytes can be overwritten by the "
4833 "application without ill effects, this is not good programming practice: the "
4834 "number of excess bytes in an allocation depends on the underlying "
4837 "B<malloc_usable_size>() が返す値は、 要求された割り当てサイズよりも大きい場合"
4838 "がある。 これは、メモリーアラインメントと最小サイズの制約のためである。 この"
4839 "超過バイトをアプリケーションは悪影響なしで上書きすることができるが、 これを行"
4840 "うのはプログラミングマナーとしてはよいこととは言えない。 アプリケーションの超"
4841 "過バイトの量は、内部の実装に依存する。"
4844 #: build/C/man3/malloc_usable_size.3:74
4845 msgid "The main use of this function is for debugging and introspection."
4846 msgstr "この関数の主な使用目的はデバッグと内部調査である。"
4849 #: build/C/man3/malloc_usable_size.3:76
4850 msgid "B<malloc>(3)"
4851 msgstr "B<malloc>(3)"
4854 #: build/C/man3/mallopt.3:25
4860 #: build/C/man3/mallopt.3:25 build/C/man3/mcheck.3:25 build/C/man2/mremap.2:30
4861 #: build/C/man2/msync.2:25 build/C/man2/pkey_alloc.2:25 build/C/man7/pkeys.7:25
4863 #| msgid "2010-06-10"
4868 #: build/C/man3/mallopt.3:28
4869 msgid "mallopt - set memory allocation parameters"
4870 msgstr "mallopt - メモリー割り当てパラメーターを設定する"
4873 #: build/C/man3/mallopt.3:32
4874 msgid "B<int mallopt(int >I<param>B<, int >I<value>B<);>"
4875 msgstr "B<int mallopt(int >I<param>B<, int >I<value>B<);>"
4878 #: build/C/man3/mallopt.3:43
4880 "The B<mallopt>() function adjusts parameters that control the behavior of "
4881 "the memory-allocation functions (see B<malloc>(3)). The I<param> argument "
4882 "specifies the parameter to be modified, and I<value> specifies the new value "
4883 "for that parameter."
4885 "B<mallopt>() 関数は、メモリー割り当て関数 (B<malloc>(3) を参照) の動作を\n"
4886 "制御するパラメーターの調整を行う。\n"
4887 "I<param> 引き数で変更するパラメーターを指定し、\n"
4888 "I<value> 引き数でそのパラメーターの新しい値を指定する。"
4891 #: build/C/man3/mallopt.3:46
4892 msgid "The following values can be specified for I<param>:"
4893 msgstr "I<param> には以下の値を指定することができる。"
4896 #: build/C/man3/mallopt.3:46
4898 #| msgid "B<M_MMAP_MAX>"
4899 msgid "B<M_ARENA_MAX>"
4900 msgstr "B<M_MMAP_MAX>"
4903 #: build/C/man3/mallopt.3:58
4905 "If this parameter has a nonzero value, it defines a hard limit on the "
4906 "maximum number of arenas that can be created. An arena represents a pool of "
4907 "memory that can be used by B<malloc>(3) (and similar) calls to service "
4908 "allocation requests. Arenas are thread safe and therefore may have multiple "
4909 "concurrent memory requests. The trade-off is between the number of threads "
4910 "and the number of arenas. The more arenas you have, the lower the per-"
4911 "thread contention, but the higher the memory usage."
4915 #: build/C/man3/mallopt.3:63
4917 "The default value of this parameter is 0, meaning that the limit on the "
4918 "number of arenas is determined according to the setting of B<M_ARENA_TEST>."
4922 #: build/C/man3/mallopt.3:69
4924 "This parameter has been available since glibc 2.10 via B<--enable-"
4925 "experimental-malloc>, and since glibc 2.15 by default. In some versions of "
4926 "the allocator there was no limit on the number of created arenas (e.g., "
4927 "CentOS 5, RHEL 5)."
4931 #: build/C/man3/mallopt.3:77
4933 "When employing newer glibc versions, applications may in some cases exhibit "
4934 "high contention when accessing arenas. In these cases, it may be beneficial "
4935 "to increase B<M_ARENA_MAX> to match the number of threads. This is similar "
4936 "in behavior to strategies taken by tcmalloc and jemalloc (e.g., per-thread "
4937 "allocation pools)."
4941 #: build/C/man3/mallopt.3:77
4943 msgid "B<M_ARENA_TEST>"
4947 #: build/C/man3/mallopt.3:85
4949 "This parameter specifies a value, in number of arenas created, at which "
4950 "point the system configuration will be examined to determine a hard limit on "
4951 "the number of created arenas. (See B<M_ARENA_MAX> for the definition of an "
4956 #: build/C/man3/mallopt.3:90
4958 "The computation of the arena hard limit is implementation-defined and is "
4959 "usually calculated as a multiple of the number of available CPUs. Once the "
4960 "hard limit is computed, the result is final and constrains the total number "
4965 #: build/C/man3/mallopt.3:96
4967 "The default value for the B<M_ARENA_TEST> parameter is 2 on systems where "
4968 "I<sizeof(long)> is 4; otherwise the default value is 8."
4972 #: build/C/man3/mallopt.3:100
4974 "This parameter has been available since glibc 2.10 via B<--enable-"
4975 "experimental-malloc>, and since glibc 2.15 by default."
4979 #: build/C/man3/mallopt.3:106
4981 "The value of B<M_ARENA_TEST> is not used when B<M_ARENA_MAX> has a nonzero "
4986 #: build/C/man3/mallopt.3:106
4988 msgid "B<M_CHECK_ACTION>"
4989 msgstr "B<M_CHECK_ACTION>"
4992 #: build/C/man3/mallopt.3:112
4994 "Setting this parameter controls how glibc responds when various kinds of "
4995 "programming errors are detected (e.g., freeing the same pointer twice). The "
4996 "3 least significant bits (2, 1, and 0) of the value assigned to this "
4997 "parameter determine the glibc behavior, as follows:"
5001 #: build/C/man3/mallopt.3:113
5007 #: build/C/man3/mallopt.3:123
5009 "If this bit is set, then print a one-line message on I<stderr> that provides "
5010 "details about the error. The message starts with the string \"***\\ glibc "
5011 "detected\\ ***\", followed by the program name, the name of the memory-"
5012 "allocation function in which the error was detected, a brief description of "
5013 "the error, and the memory address where the error was detected."
5017 #: build/C/man3/mallopt.3:123
5023 #: build/C/man3/mallopt.3:138
5025 "If this bit is set, then, after printing any error message specified by bit "
5026 "0, the program is terminated by calling B<abort>(3). In glibc versions "
5027 "since 2.4, if bit 0 is also set, then, between printing the error message "
5028 "and aborting, the program also prints a stack trace in the manner of "
5029 "B<backtrace>(3), and prints the process's memory mapping in the style of I</"
5030 "proc/[pid]/maps> (see B<proc>(5))."
5034 #: build/C/man3/mallopt.3:138
5036 msgid "Bit 2 (since glibc 2.4)"
5037 msgstr "Bit 2 (glibc 2.4 以降)"
5040 #: build/C/man3/mallopt.3:145
5042 "This bit has an effect only if bit 0 is also set. If this bit is set, then "
5043 "the one-line message describing the error is simplified to contain just the "
5044 "name of the function where the error was detected and the brief description "
5049 #: build/C/man3/mallopt.3:150
5050 msgid "The remaining bits in I<value> are ignored."
5054 #: build/C/man3/mallopt.3:154
5056 "Combining the above details, the following numeric values are meaningful for "
5057 "B<M_CHECK_ACTION>:"
5061 #: build/C/man3/mallopt.3:155
5067 #: build/C/man3/mallopt.3:157
5068 msgid "Ignore error conditions; continue execution (with undefined results)."
5072 #: build/C/man3/mallopt.3:157
5078 #: build/C/man3/mallopt.3:159
5079 msgid "Print a detailed error message and continue execution."
5083 #: build/C/man3/mallopt.3:159
5089 #: build/C/man3/mallopt.3:161
5090 msgid "Abort the program."
5094 #: build/C/man3/mallopt.3:161
5100 #: build/C/man3/mallopt.3:164
5102 "Print detailed error message, stack trace, and memory mappings, and abort "
5107 #: build/C/man3/mallopt.3:164
5113 #: build/C/man3/mallopt.3:166
5114 msgid "Print a simple error message and continue execution."
5118 #: build/C/man3/mallopt.3:166
5124 #: build/C/man3/mallopt.3:169
5126 "Print simple error message, stack trace, and memory mappings, and abort the "
5131 #: build/C/man3/mallopt.3:175
5133 "Since glibc 2.3.4, the default value for the B<M_CHECK_ACTION> parameter is "
5134 "3. In glibc version 2.3.3 and earlier, the default value is 1."
5138 #: build/C/man3/mallopt.3:180
5140 "Using a nonzero B<M_CHECK_ACTION> value can be useful because otherwise a "
5141 "crash may happen much later, and the true cause of the problem is then very "
5142 "hard to track down."
5146 #: build/C/man3/mallopt.3:180
5148 msgid "B<M_MMAP_MAX>"
5149 msgstr "B<M_MMAP_MAX>"
5151 #. The following text adapted from comments in the glibc source:
5153 #: build/C/man3/mallopt.3:190
5155 "This parameter specifies the maximum number of allocation requests that may "
5156 "be simultaneously serviced using B<mmap>(2). This parameter exists because "
5157 "some systems have a limited number of internal tables for use by B<mmap>(2), "
5158 "and using more than a few of them may degrade performance."
5162 #: build/C/man3/mallopt.3:197
5164 "The default value is 65,536, a value which has no special significance and "
5165 "which serves only as a safeguard. Setting this parameter to 0 disables the "
5166 "use of B<mmap>(2) for servicing large allocation requests."
5170 #: build/C/man3/mallopt.3:197
5172 msgid "B<M_MMAP_THRESHOLD>"
5173 msgstr "B<M_MMAP_THRESHOLD>"
5176 #: build/C/man3/mallopt.3:206
5178 "For allocations greater than or equal to the limit specified (in bytes) by "
5179 "B<M_MMAP_THRESHOLD> that can't be satisfied from the free list, the memory-"
5180 "allocation functions employ B<mmap>(2) instead of increasing the program "
5181 "break using B<sbrk>(2)."
5185 #: build/C/man3/mallopt.3:226
5187 "Allocating memory using B<mmap>(2) has the significant advantage that the "
5188 "allocated memory blocks can always be independently released back to the "
5189 "system. (By contrast, the heap can be trimmed only if memory is freed at "
5190 "the top end.) On the other hand, there are some disadvantages to the use of "
5191 "B<mmap>(2): deallocated space is not placed on the free list for reuse by "
5192 "later allocations; memory may be wasted because B<mmap>(2) allocations must "
5193 "be page-aligned; and the kernel must perform the expensive task of zeroing "
5194 "out memory allocated via B<mmap>(2). Balancing these factors leads to a "
5195 "default setting of 128*1024 for the B<M_MMAP_THRESHOLD> parameter."
5199 #: build/C/man3/mallopt.3:233
5201 "The lower limit for this parameter is 0. The upper limit is "
5202 "B<DEFAULT_MMAP_THRESHOLD_MAX>: 512*1024 on 32-bit systems or "
5203 "I<4*1024*1024*sizeof(long)> on 64-bit systems."
5207 #: build/C/man3/mallopt.3:251
5209 "I<Note:> Nowadays, glibc uses a dynamic mmap threshold by default. The "
5210 "initial value of the threshold is 128*1024, but when blocks larger than the "
5211 "current threshold and less than or equal to B<DEFAULT_MMAP_THRESHOLD_MAX> "
5212 "are freed, the threshold is adjusted upward to the size of the freed block. "
5213 "When dynamic mmap thresholding is in effect, the threshold for trimming the "
5214 "heap is also dynamically adjusted to be twice the dynamic mmap threshold. "
5215 "Dynamic adjustment of the mmap threshold is disabled if any of the "
5216 "B<M_TRIM_THRESHOLD>, B<M_TOP_PAD>, B<M_MMAP_THRESHOLD>, or B<M_MMAP_MAX> "
5217 "parameters is set."
5221 #: build/C/man3/mallopt.3:251
5223 msgid "B<M_MXFAST> (since glibc 2.3)"
5224 msgstr "B<M_MXFAST> (glibc 2.3 以降)"
5226 #. The following text adapted from comments in the glibc sources:
5228 #: build/C/man3/mallopt.3:263
5230 "Set the upper limit for memory allocation requests that are satisfied using "
5231 "\"fastbins\". (The measurement unit for this parameter is bytes.) Fastbins "
5232 "are storage areas that hold deallocated blocks of memory of the same size "
5233 "without merging adjacent free blocks. Subsequent reallocation of blocks of "
5234 "the same size can be handled very quickly by allocating from the fastbin, "
5235 "although memory fragmentation and the overall memory footprint of the "
5236 "program can increase."
5240 #: build/C/man3/mallopt.3:272
5242 "The default value for this parameter is I<64*sizeof(size_t)/4> (i.e., 64 on "
5243 "32-bit architectures). The range for this parameter is 0 to "
5244 "I<80*sizeof(size_t)/4>. Setting B<M_MXFAST> to 0 disables the use of "
5249 #: build/C/man3/mallopt.3:272
5251 msgid "B<M_PERTURB> (since glibc 2.4)"
5252 msgstr "B<M_PERTURB> (glibc 2.4 以降)"
5255 #: build/C/man3/mallopt.3:287
5257 "If this parameter is set to a nonzero value, then bytes of allocated memory "
5258 "(other than allocations via B<calloc>(3)) are initialized to the complement "
5259 "of the value in the least significant byte of I<value>, and when allocated "
5260 "memory is released using B<free>(3), the freed bytes are set to the least "
5261 "significant byte of I<value>. This can be useful for detecting errors where "
5262 "programs incorrectly rely on allocated memory being initialized to zero, or "
5263 "reuse values in memory that has already been freed."
5267 #: build/C/man3/mallopt.3:289
5268 msgid "The default value for this parameter is 0."
5272 #: build/C/man3/mallopt.3:289
5274 msgid "B<M_TOP_PAD>"
5275 msgstr "B<M_TOP_PAD>"
5278 #: build/C/man3/mallopt.3:296
5280 "This parameter defines the amount of padding to employ when calling "
5281 "B<sbrk>(2) to modify the program break. (The measurement unit for this "
5282 "parameter is bytes.) This parameter has an effect in the following "
5287 #: build/C/man3/mallopt.3:303
5289 "When the program break is increased, then B<M_TOP_PAD> bytes are added to "
5290 "the B<sbrk>(2) request."
5294 #: build/C/man3/mallopt.3:309
5296 "When the heap is trimmed as a consequence of calling B<free>(3) (see the "
5297 "discussion of B<M_TRIM_THRESHOLD>) this much free space is preserved at the "
5302 #: build/C/man3/mallopt.3:313
5304 "In either case, the amount of padding is always rounded to a system page "
5309 #: build/C/man3/mallopt.3:320
5311 "Modifying B<M_TOP_PAD> is a trade-off between increasing the number of "
5312 "system calls (when the parameter is set low) and wasting unused memory at "
5313 "the top of the heap (when the parameter is set high)."
5316 #. DEFAULT_TOP_PAD in glibc source
5318 #: build/C/man3/mallopt.3:323
5319 msgid "The default value for this parameter is 128*1024."
5323 #: build/C/man3/mallopt.3:323
5325 msgid "B<M_TRIM_THRESHOLD>"
5326 msgstr "B<M_TRIM_THRESHOLD>"
5329 #: build/C/man3/mallopt.3:339
5331 "When the amount of contiguous free memory at the top of the heap grows "
5332 "sufficiently large, B<free>(3) employs B<sbrk>(2) to release this memory "
5333 "back to the system. (This can be useful in programs that continue to "
5334 "execute for a long period after freeing a significant amount of memory.) "
5335 "The B<M_TRIM_THRESHOLD> parameter specifies the minimum size (in bytes) that "
5336 "this block of memory must reach before B<sbrk>(2) is used to trim the heap."
5340 #: build/C/man3/mallopt.3:344
5342 "The default value for this parameter is 128*1024. Setting "
5343 "B<M_TRIM_THRESHOLD> to -1 disables trimming completely."
5350 #: build/C/man3/mallopt.3:352
5352 "Modifying B<M_TRIM_THRESHOLD> is a trade-off between increasing the number "
5353 "of system calls (when the parameter is set low) and wasting unused memory "
5354 "at the top of the heap (when the parameter is set high)."
5358 #: build/C/man3/mallopt.3:352
5360 msgid "Environment variables"
5364 #: build/C/man3/mallopt.3:367
5366 "A number of environment variables can be defined to modify some of the same "
5367 "parameters as are controlled by B<mallopt>(). Using these variables has the "
5368 "advantage that the source code of the program need not be changed. To be "
5369 "effective, these variables must be defined before the first call to a memory-"
5370 "allocation function. (If the same parameters are adjusted via B<mallopt>(), "
5371 "then the B<mallopt>() settings take precedence.) For security reasons, "
5372 "these variables are ignored in set-user-ID and set-group-ID programs."
5376 #: build/C/man3/mallopt.3:370
5378 "The environment variables are as follows (note the trailing underscore at "
5379 "the end of the name of some variables):"
5383 #: build/C/man3/mallopt.3:370
5385 #| msgid "B<MALLOC_MMAP_MAX_>"
5386 msgid "B<MALLOC_ARENA_MAX>"
5387 msgstr "B<MALLOC_MMAP_MAX_>"
5390 #: build/C/man3/mallopt.3:375
5391 msgid "Controls the same parameter as B<mallopt>() B<M_ARENA_MAX>."
5395 #: build/C/man3/mallopt.3:375
5397 #| msgid "B<MALLOC_CHECK_>"
5398 msgid "B<MALLOC_ARENA_TEST>"
5399 msgstr "B<MALLOC_CHECK_>"
5402 #: build/C/man3/mallopt.3:380
5403 msgid "Controls the same parameter as B<mallopt>() B<M_ARENA_TEST>."
5407 #: build/C/man3/mallopt.3:380
5409 msgid "B<MALLOC_CHECK_>"
5410 msgstr "B<MALLOC_CHECK_>"
5412 #. On glibc 2.12/x86, a simple malloc()+free() loop is about 70% slower
5413 #. when MALLOC_CHECK_ was set.
5415 #: build/C/man3/mallopt.3:397
5417 "This environment variable controls the same parameter as B<mallopt>() "
5418 "B<M_CHECK_ACTION>. If this variable is set to a nonzero value, then a "
5419 "special implementation of the memory-allocation functions is used. (This is "
5420 "accomplished using the B<malloc_hook>(3) feature.) This implementation "
5421 "performs additional error checking, but is slower than the standard set of "
5422 "memory-allocation functions. (This implementation does not detect all "
5423 "possible errors; memory leaks can still occur.)"
5427 #: build/C/man3/mallopt.3:402
5429 "The value assigned to this environment variable should be a single digit, "
5430 "whose meaning is as described for B<M_CHECK_ACTION>. Any characters beyond "
5431 "the initial digit are ignored."
5435 #: build/C/man3/mallopt.3:411
5437 "For security reasons, the effect of B<MALLOC_CHECK_> is disabled by default "
5438 "for set-user-ID and set-group-ID programs. However, if the file I</etc/suid-"
5439 "debug> exists (the content of the file is irrelevant), then B<MALLOC_CHECK_> "
5440 "also has an effect for set-user-ID and set-group-ID programs."
5444 #: build/C/man3/mallopt.3:411
5446 msgid "B<MALLOC_MMAP_MAX_>"
5447 msgstr "B<MALLOC_MMAP_MAX_>"
5450 #: build/C/man3/mallopt.3:416
5451 msgid "Controls the same parameter as B<mallopt>() B<M_MMAP_MAX>."
5455 #: build/C/man3/mallopt.3:416
5457 msgid "B<MALLOC_MMAP_THRESHOLD_>"
5458 msgstr "B<MALLOC_MMAP_THRESHOLD_>"
5461 #: build/C/man3/mallopt.3:421
5462 msgid "Controls the same parameter as B<mallopt>() B<M_MMAP_THRESHOLD>."
5466 #: build/C/man3/mallopt.3:421
5468 msgid "B<MALLOC_PERTURB_>"
5469 msgstr "B<MALLOC_PERTURB_>"
5472 #: build/C/man3/mallopt.3:426
5473 msgid "Controls the same parameter as B<mallopt>() B<M_PERTURB>."
5477 #: build/C/man3/mallopt.3:426
5479 msgid "B<MALLOC_TRIM_THRESHOLD_>"
5480 msgstr "B<MALLOC_TRIM_THRESHOLD_>"
5483 #: build/C/man3/mallopt.3:431
5484 msgid "Controls the same parameter as B<mallopt>() B<M_TRIM_THRESHOLD>."
5488 #: build/C/man3/mallopt.3:431
5490 msgid "B<MALLOC_TOP_PAD_>"
5491 msgstr "B<MALLOC_TOP_PAD_>"
5494 #: build/C/man3/mallopt.3:436
5495 msgid "Controls the same parameter as B<mallopt>() B<M_TOP_PAD>."
5499 #: build/C/man3/mallopt.3:441
5500 msgid "On success, B<mallopt>() returns 1. On error, it returns 0."
5501 msgstr "B<mallopt>() は成功すると 1 を返す。エラーの場合は 0 を返す。"
5504 #. Available already in glibc 2.0, possibly earlier
5506 #: build/C/man3/mallopt.3:449
5507 msgid "On error, I<errno> is I<not> set."
5508 msgstr "エラーの場合、I<errno> は設定I<されない>。"
5512 #: build/C/man3/mallopt.3:463
5514 "This function is not specified by POSIX or the C standards. A similar "
5515 "function exists on many System V derivatives, but the range of values for "
5516 "I<param> varies across systems. The SVID defined options B<M_MXFAST>, "
5517 "B<M_NLBLKS>, B<M_GRAIN>, and B<M_KEEP>, but only the first of these is "
5518 "implemented in glibc."
5522 #: build/C/man3/mallopt.3:467
5523 msgid "Specifying an invalid value for I<param> does not generate an error."
5526 #. FIXME . This looks buggy:
5527 #. setting the M_MXFAST limit rounds up: (s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)
5528 #. malloc requests are rounded up:
5529 #. (req) + SIZE_SZ + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK
5530 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=12129
5532 #: build/C/man3/mallopt.3:475
5534 "A calculation error within the glibc implementation means that a call of the "
5539 #: build/C/man3/mallopt.3:479
5541 #| msgid " mallopt(M_MXFAST, n)\n"
5542 msgid "mallopt(M_MXFAST, n)\n"
5543 msgstr " mallopt(M_MXFAST, n)\n"
5545 #. Bins are multiples of 2 * sizeof(size_t) + sizeof(size_t)
5547 #: build/C/man3/mallopt.3:492
5549 "does not result in fastbins being employed for all allocations of size up to "
5550 "I<n>. To ensure desired results, I<n> should be rounded up to the next "
5551 "multiple greater than or equal to I<(2k+1)*sizeof(size_t)>, where I<k> is an "
5555 #. FIXME . http://sources.redhat.com/bugzilla/show_bug.cgi?id=12140
5557 #: build/C/man3/mallopt.3:513
5559 "If B<mallopt>() is used to set B<M_PERTURB>, then, as expected, the bytes "
5560 "of allocated memory are initialized to the complement of the byte in "
5561 "I<value>, and when that memory is freed, the bytes of the region are "
5562 "initialized to the byte specified in I<value>. However, there is an off-by-"
5563 "I<sizeof(size_t)> error in the implementation: instead of initializing "
5564 "precisely the block of memory being freed by the call I<free(p)>, the block "
5565 "starting at I<p+sizeof(size_t)> is initialized."
5569 #: build/C/man3/mallopt.3:522
5571 "The program below demonstrates the use of B<M_CHECK_ACTION>. If the program "
5572 "is supplied with an (integer) command-line argument, then that argument is "
5573 "used to set the B<M_CHECK_ACTION> parameter. The program then allocates a "
5574 "block of memory, and frees it twice (an error)."
5578 #: build/C/man3/mallopt.3:526
5580 "The following shell session shows what happens when we run this program "
5581 "under glibc, with the default value for B<M_CHECK_ACTION>:"
5585 #: build/C/man3/mallopt.3:546
5589 "main(): returned from first free() call\n"
5590 "*** glibc detected *** ./a.out: double free or corruption (top): 0x09d30008 ***\n"
5591 "======= Backtrace: =========\n"
5592 "/lib/libc.so.6(+0x6c501)[0x523501]\n"
5593 "/lib/libc.so.6(+0x6dd70)[0x524d70]\n"
5594 "/lib/libc.so.6(cfree+0x6d)[0x527e5d]\n"
5595 "\\&./a.out[0x80485db]\n"
5596 "/lib/libc.so.6(__libc_start_main+0xe7)[0x4cdce7]\n"
5597 "\\&./a.out[0x8048471]\n"
5598 "======= Memory map: ========\n"
5599 "001e4000-001fe000 r-xp 00000000 08:06 1083555 /lib/libgcc_s.so.1\n"
5600 "001fe000-001ff000 r--p 00019000 08:06 1083555 /lib/libgcc_s.so.1\n"
5601 "[some lines omitted]\n"
5602 "b7814000-b7817000 rw-p 00000000 00:00 0\n"
5603 "bff53000-bff74000 rw-p 00000000 00:00 0 [stack]\n"
5604 "Aborted (core dumped)\n"
5607 "main(): returned from first free() call\n"
5608 "*** glibc detected *** ./a.out: double free or corruption (top): 0x09d30008 ***\n"
5609 "======= Backtrace: =========\n"
5610 "/lib/libc.so.6(+0x6c501)[0x523501]\n"
5611 "/lib/libc.so.6(+0x6dd70)[0x524d70]\n"
5612 "/lib/libc.so.6(cfree+0x6d)[0x527e5d]\n"
5613 "\\&./a.out[0x80485db]\n"
5614 "/lib/libc.so.6(__libc_start_main+0xe7)[0x4cdce7]\n"
5615 "\\&./a.out[0x8048471]\n"
5616 "======= Memory map: ========\n"
5617 "001e4000-001fe000 r-xp 00000000 08:06 1083555 /lib/libgcc_s.so.1\n"
5618 "001fe000-001ff000 r--p 00019000 08:06 1083555 /lib/libgcc_s.so.1\n"
5619 "[some lines omitted]\n"
5620 "b7814000-b7817000 rw-p 00000000 00:00 0\n"
5621 "bff53000-bff74000 rw-p 00000000 00:00 0 [stack]\n"
5622 "Aborted (core dumped)\n"
5625 #: build/C/man3/mallopt.3:551
5627 "The following runs show the results when employing other values for "
5628 "B<M_CHECK_ACTION>:"
5632 #: build/C/man3/mallopt.3:564
5635 "$ B<./a.out 1> # Diagnose error and continue\n"
5636 "main(): returned from first free() call\n"
5637 "*** glibc detected *** ./a.out: double free or corruption (top): 0x09cbe008 ***\n"
5638 "main(): returned from second free() call\n"
5639 "$ B<./a.out 2> # Abort without error message\n"
5640 "main(): returned from first free() call\n"
5641 "Aborted (core dumped)\n"
5642 "$ B<./a.out 0> # Ignore error and continue\n"
5643 "main(): returned from first free() call\n"
5644 "main(): returned from second free() call\n"
5646 "$ B<./a.out 1> # Diagnose error and continue\n"
5647 "main(): returned from first free() call\n"
5648 "*** glibc detected *** ./a.out: double free or corruption (top): 0x09cbe008 ***\n"
5649 "main(): returned from second free() call\n"
5650 "$ B<./a.out 2> # Abort without error message\n"
5651 "main(): returned from first free() call\n"
5652 "Aborted (core dumped)\n"
5653 "$ B<./a.out 0> # Ignore error and continue\n"
5654 "main(): returned from first free() call\n"
5655 "main(): returned from second free() call\n"
5658 #: build/C/man3/mallopt.3:570
5660 "The next run shows how to set the same parameter using the B<MALLOC_CHECK_> "
5661 "environment variable:"
5665 #: build/C/man3/mallopt.3:577
5668 "$ B<MALLOC_CHECK_=1 ./a.out>\n"
5669 "main(): returned from first free() call\n"
5670 "*** glibc detected *** ./a.out: free(): invalid pointer: 0x092c2008 ***\n"
5671 "main(): returned from second free() call\n"
5673 "$ B<MALLOC_CHECK_=1 ./a.out>\n"
5674 "main(): returned from first free() call\n"
5675 "*** glibc detected *** ./a.out: free(): invalid pointer: 0x092c2008 ***\n"
5676 "main(): returned from second free() call\n"
5679 #: build/C/man3/mallopt.3:585
5682 "#include E<lt>malloc.hE<gt>\n"
5683 "#include E<lt>stdio.hE<gt>\n"
5684 "#include E<lt>stdlib.hE<gt>\n"
5686 "#include E<lt>malloc.hE<gt>\n"
5687 "#include E<lt>stdio.hE<gt>\n"
5688 "#include E<lt>stdlib.hE<gt>\n"
5691 #: build/C/man3/mallopt.3:590 build/C/man3/mcheck.3:208
5695 "main(int argc, char *argv[])\n"
5700 "main(int argc, char *argv[])\n"
5705 #: build/C/man3/mallopt.3:597
5708 " if (argc E<gt> 1) {\n"
5709 " if (mallopt(M_CHECK_ACTION, atoi(argv[1])) != 1) {\n"
5710 " fprintf(stderr, \"mallopt() failed\");\n"
5711 " exit(EXIT_FAILURE);\n"
5715 " if (argc E<gt> 1) {\n"
5716 " if (mallopt(M_CHECK_ACTION, atoi(argv[1])) != 1) {\n"
5717 " fprintf(stderr, \"mallopt() failed\");\n"
5718 " exit(EXIT_FAILURE);\n"
5723 #: build/C/man3/mallopt.3:603
5726 " p = malloc(1000);\n"
5727 " if (p == NULL) {\n"
5728 " fprintf(stderr, \"malloc() failed\");\n"
5729 " exit(EXIT_FAILURE);\n"
5732 " p = malloc(1000);\n"
5733 " if (p == NULL) {\n"
5734 " fprintf(stderr, \"malloc() failed\");\n"
5735 " exit(EXIT_FAILURE);\n"
5739 #: build/C/man3/mallopt.3:606
5743 " printf(\"main(): returned from first free() call\\en\");\n"
5746 " printf(\"main(): returned from first free() call\\en\");\n"
5749 #: build/C/man3/mallopt.3:609
5753 " printf(\"main(): returned from second free() call\\en\");\n"
5756 " printf(\"main(): returned from second free() call\\en\");\n"
5759 #: build/C/man3/mallopt.3:627
5761 "B<mmap>(2), B<sbrk>(2), B<mallinfo>(3), B<malloc>(3), B<malloc_hook>(3), "
5762 "B<malloc_info>(3), B<malloc_stats>(3), B<malloc_trim>(3), B<mcheck>(3), "
5763 "B<mtrace>(3), B<posix_memalign>(3)"
5765 "B<mmap>(2), B<sbrk>(2), B<mallinfo>(3), B<malloc>(3), B<malloc_hook>(3), "
5766 "B<malloc_info>(3), B<malloc_stats>(3), B<malloc_trim>(3), B<mcheck>(3), "
5767 "B<mtrace>(3), B<posix_memalign>(3)"
5770 #: build/C/man3/mcheck.3:25
5776 #: build/C/man3/mcheck.3:28
5778 "mcheck, mcheck_check_all, mcheck_pedantic, mprobe - heap consistency checking"
5782 #: build/C/man3/mcheck.3:31
5784 msgid "B<#include E<lt>mcheck.hE<gt>>\n"
5785 msgstr "B<#include E<lt>mcheck.hE<gt>>\n"
5788 #: build/C/man3/mcheck.3:33
5790 msgid "B<int mcheck(void (*>I<abortfunc>B<)(enum mcheck_status >I<mstatus>B<));>\n"
5794 #: build/C/man3/mcheck.3:35
5796 msgid "B<int mcheck_pedantic(void (*>I<abortfunc>B<)(enum mcheck_status >I<mstatus>B<));>\n"
5800 #: build/C/man3/mcheck.3:37
5802 msgid "B<void mcheck_check_all(void);>\n"
5803 msgstr "B<void mcheck_check_all(void);>\n"
5806 #: build/C/man3/mcheck.3:39
5808 msgid "B<enum mcheck_status mprobe(void *>I<ptr>B<);>\n"
5809 msgstr "B<enum mcheck_status mprobe(void *>I<ptr>B<);>\n"
5812 #: build/C/man3/mcheck.3:51
5814 "The B<mcheck>() function installs a set of debugging hooks for the "
5815 "B<malloc>(3) family of memory-allocation functions. These hooks cause "
5816 "certain consistency checks to be performed on the state of the heap. The "
5817 "checks can detect application errors such as freeing a block of memory more "
5818 "than once or corrupting the bookkeeping data structures that immediately "
5819 "precede a block of allocated memory."
5823 #: build/C/man3/mcheck.3:63
5825 "To be effective, the B<mcheck>() function must be called before the first "
5826 "call to B<malloc>(3) or a related function. In cases where this is "
5827 "difficult to ensure, linking the program with I<-lmcheck> inserts an "
5828 "implicit call to B<mcheck>() (with a NULL argument) before the first call "
5829 "to a memory-allocation function."
5833 #: build/C/man3/mcheck.3:71
5835 "The B<mcheck_pedantic>() function is similar to B<mcheck>(), but performs "
5836 "checks on all allocated blocks whenever one of the memory-allocation "
5837 "functions is called. This can be very slow!"
5841 #: build/C/man3/mcheck.3:78
5843 "The B<mcheck_check_all>() function causes an immediate check on all "
5844 "allocated blocks. This call is effective only if B<mcheck>() is called "
5849 #: build/C/man3/mcheck.3:91
5851 "If the system detects an inconsistency in the heap, the caller-supplied "
5852 "function pointed to by I<abortfunc> is invoked with a single argument, "
5853 "I<mstatus>, that indicates what type of inconsistency was detected. If "
5854 "I<abortfunc> is NULL, a default function prints an error message on "
5855 "I<stderr> and calls B<abort>(3)."
5859 #: build/C/man3/mcheck.3:103
5861 "The B<mprobe>() function performs a consistency check on the block of "
5862 "allocated memory pointed to by I<ptr>. The B<mcheck>() function should be "
5863 "called beforehand (otherwise B<mprobe>() returns B<MCHECK_DISABLED>)."
5867 #: build/C/man3/mcheck.3:111
5869 "The following list describes the values returned by B<mprobe>() or passed "
5870 "as the I<mstatus> argument when I<abortfunc> is invoked:"
5874 #: build/C/man3/mcheck.3:111
5876 msgid "B<MCHECK_DISABLED> (B<mprobe>() only)"
5880 #: build/C/man3/mcheck.3:116
5882 "B<mcheck>() was not called before the first memory allocation function was "
5883 "called. Consistency checking is not possible."
5887 #: build/C/man3/mcheck.3:116
5889 msgid "B<MCHECK_OK> (B<mprobe>() only)"
5893 #: build/C/man3/mcheck.3:119
5894 msgid "No inconsistency detected."
5898 #: build/C/man3/mcheck.3:119
5900 msgid "B<MCHECK_HEAD>"
5901 msgstr "B<MCHECK_HEAD>"
5904 #: build/C/man3/mcheck.3:122
5905 msgid "Memory preceding an allocated block was clobbered."
5909 #: build/C/man3/mcheck.3:122
5911 msgid "B<MCHECK_TAIL>"
5912 msgstr "B<MCHECK_TAIL>"
5915 #: build/C/man3/mcheck.3:125
5916 msgid "Memory following an allocated block was clobbered."
5920 #: build/C/man3/mcheck.3:125
5922 msgid "B<MCHECK_FREE>"
5923 msgstr "B<MCHECK_FREE>"
5926 #: build/C/man3/mcheck.3:129
5927 msgid "A block of memory was freed twice."
5931 #: build/C/man3/mcheck.3:134
5933 "B<mcheck>() and B<mcheck_pedantic>() return 0 on success, or -1 on error."
5937 #: build/C/man3/mcheck.3:145
5939 "The B<mcheck_pedantic>() and B<mcheck_check_all>() functions are available "
5940 "since glibc 2.2. The B<mcheck>() and B<mprobe>() functions are present "
5941 "since at least glibc 2.0"
5945 #: build/C/man3/mcheck.3:156
5949 "B<mcheck_pedantic>(),\n"
5953 #: build/C/man3/mcheck.3:156 build/C/man3/mcheck.3:161
5954 #: build/C/man3/posix_memalign.3:200 build/C/man3/posix_memalign.3:202
5955 #: build/C/man3/posix_memalign.3:207
5961 #: build/C/man3/mcheck.3:159
5963 #| msgid "B<void mcheck_check_all(void);>\n"
5965 "B<mcheck_check_all>(),\n"
5967 msgstr "B<void mcheck_check_all(void);>\n"
5970 #: build/C/man3/mcheck.3:161
5972 msgid "MT-Unsafe race:mcheck\n"
5973 msgstr "MT-Unsafe race:mcheck\n"
5976 #: build/C/man3/mcheck.3:163
5978 msgid "const:malloc_hooks"
5981 #. But is MALLOC_CHECK_ slower?
5983 #: build/C/man3/mcheck.3:180
5985 "Linking a program with I<-lmcheck> and using the B<MALLOC_CHECK_> "
5986 "environment variable (described in B<mallopt>(3)) cause the same kinds of "
5987 "errors to be detected. But, using B<MALLOC_CHECK_> does not require the "
5988 "application to be relinked."
5992 #: build/C/man3/mcheck.3:186
5994 "The program below calls B<mcheck>() with a NULL argument and then frees the "
5995 "same block of memory twice. The following shell session demonstrates what "
5996 "happens when running the program:"
6000 #: build/C/man3/mcheck.3:191
6008 #: build/C/man3/mcheck.3:195
6011 "About to free a second time\n"
6012 "block freed twice\n"
6013 "Aborted (core dumped)\n"
6017 #: build/C/man3/mcheck.3:203
6020 "#include E<lt>stdlib.hE<gt>\n"
6021 "#include E<lt>stdio.hE<gt>\n"
6022 "#include E<lt>mcheck.hE<gt>\n"
6024 "#include E<lt>stdlib.hE<gt>\n"
6025 "#include E<lt>stdio.hE<gt>\n"
6026 "#include E<lt>mcheck.hE<gt>\n"
6029 #: build/C/man3/mcheck.3:211
6032 " if (mcheck(NULL) != 0) {\n"
6033 " fprintf(stderr, \"mcheck() failed\\en\");\n"
6037 #: build/C/man3/mcheck.3:214
6040 " exit(EXIT_FAILURE);\n"
6043 " exit(EXIT_FAILURE);\n"
6047 #: build/C/man3/mcheck.3:216
6049 msgid " p = malloc(1000);\n"
6050 msgstr " p = malloc(1000);\n"
6053 #: build/C/man3/mcheck.3:221
6056 " fprintf(stderr, \"About to free\\en\");\n"
6058 " fprintf(stderr, \"\\enAbout to free a second time\\en\");\n"
6063 #: build/C/man3/mcheck.3:229
6064 msgid "B<malloc>(3), B<mallopt>(3), B<mtrace>(3)"
6065 msgstr "B<malloc>(3), B<mallopt>(3), B<mtrace>(3)"
6068 #: build/C/man2/mlock.2:26
6074 #: build/C/man2/mlock.2:29
6076 #| msgid "mlock, munlock, mlockall, munlockall - lock and unlock memory"
6077 msgid "mlock, mlock2, munlock, mlockall, munlockall - lock and unlock memory"
6078 msgstr "mlock - メモリーのロックとロック解除を行う"
6081 #: build/C/man2/mlock.2:32 build/C/man2/mmap.2:46 build/C/man2/mmap2.2:35
6082 #: build/C/man2/mprotect.2:39 build/C/man3/posix_madvise.3:26
6084 msgid "B<#include E<lt>sys/mman.hE<gt>>\n"
6085 msgstr "B<#include E<lt>sys/mman.hE<gt>>\n"
6088 #: build/C/man2/mlock.2:36
6091 #| "B<int mlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6092 #| "B<int munlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6094 "B<int mlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6095 "B<int mlock2(const void *>I<addr>B<, size_t >I<len>B<, int >I<flags>B<);>\n"
6096 "B<int munlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6098 "B<int mlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6099 "B<int munlock(const void *>I<addr>B<, size_t >I<len>B<);>\n"
6102 #: build/C/man2/mlock.2:39
6105 "B<int mlockall(int >I<flags>B<);>\n"
6106 "B<int munlockall(void);>\n"
6108 "B<int mlockall(int >I<flags>B<);>\n"
6109 "B<int munlockall(void);>\n"
6112 #: build/C/man2/mlock.2:48
6114 "B<mlock>(), B<mlock2>(), and B<mlockall>() lock part or all of the calling "
6115 "process's virtual address space into RAM, preventing that memory from being "
6116 "paged to the swap area."
6120 #: build/C/man2/mlock.2:56
6123 #| "B<mlock>() and B<mlockall>() respectively lock part or all of the "
6124 #| "calling process's virtual address space into RAM, preventing that memory "
6125 #| "from being paged to the swap area. B<munlock>() and B<munlockall>() "
6126 #| "perform the converse operation, respectively unlocking part or all of the "
6127 #| "calling process's virtual address space, so that pages in the specified "
6128 #| "virtual address range may once more to be swapped out if required by the "
6129 #| "kernel memory manager. Memory locking and unlocking are performed in "
6130 #| "units of whole pages."
6132 "B<munlock>() and B<munlockall>() perform the converse operation, unlocking "
6133 "part or all of the calling process's virtual address space, so that pages in "
6134 "the specified virtual address range may once more to be swapped out if "
6135 "required by the kernel memory manager."
6137 "B<mlock>() と B<mlockall>() はそれぞれ、呼び出し元プロセスの仮想アドレス空"
6138 "間の一部または全部を RAM 上にロックし、メモリーがスワップエリアにページングさ"
6139 "れるのを防ぐ。 B<munlock>() と B<munlockall>() は逆の操作で、それぞれ呼び出"
6140 "し元プロセスの仮想アドレス空間の一部または全部を ロック解除する。つまり、指定"
6141 "された仮想アドレス範囲のページは カーネルメモリーマネージャーから要求されれば"
6142 "スワップアウトするようになる。 メモリーのロックとロック解除はページ単位で行わ"
6146 #: build/C/man2/mlock.2:58
6147 msgid "Memory locking and unlocking are performed in units of whole pages."
6151 #: build/C/man2/mlock.2:58
6153 #| msgid "mlock() and munlock()"
6154 msgid "mlock(), mlock2(), and munlock()"
6155 msgstr "mlock() と munlock()"
6158 #: build/C/man2/mlock.2:68
6160 "B<mlock>() locks pages in the address range starting at I<addr> and "
6161 "continuing for I<len> bytes. All pages that contain a part of the specified "
6162 "address range are guaranteed to be resident in RAM when the call returns "
6163 "successfully; the pages are guaranteed to stay in RAM until later unlocked."
6165 "B<mlock>() は I<addr> から始まる長さ I<len> バイトのアドレス範囲のページを"
6166 "ロックする。 呼び出しが成功した場合には、 指定されたアドレス範囲を含む全ての"
6167 "ページは RAM に残り続けることが保証される。 これらのページは後でロック解除さ"
6168 "れるまで RAM に残り続けることが保証される。"
6170 #. commit a8ca5d0ecbdde5cc3d7accacbd69968b0c98764e
6171 #. commit de60f5f10c58d4f34b68622442c0e04180367f3f
6172 #. commit b0f205c2a3082dd9081f9a94e50658c5fa906ff1
6174 #: build/C/man2/mlock.2:82
6177 #| "B<mlock>() locks pages in the address range starting at I<addr> and "
6178 #| "continuing for I<len> bytes. All pages that contain a part of the "
6179 #| "specified address range are guaranteed to be resident in RAM when the "
6180 #| "call returns successfully; the pages are guaranteed to stay in RAM until "
6181 #| "later unlocked."
6183 "B<mlock2>() also locks pages in the specified range starting at I<addr> and "
6184 "continuing for I<len> bytes. However, the state of the pages contained in "
6185 "that range after the call returns successfully will depend on the value in "
6186 "the I<flags> argument."
6188 "B<mlock>() は I<addr> から始まる長さ I<len> バイトのアドレス範囲のページを"
6189 "ロックする。 呼び出しが成功した場合には、 指定されたアドレス範囲を含む全ての"
6190 "ページは RAM に残り続けることが保証される。 これらのページは後でロック解除さ"
6191 "れるまで RAM に残り続けることが保証される。"
6194 #: build/C/man2/mlock.2:86
6197 #| "The I<flags> argument is constructed as the bitwise OR of one or more of "
6198 #| "the following constants:"
6199 msgid "The I<flags> argument can be either 0 or the following constant:"
6200 msgstr "I<flags> 引数は以下の内容の一つまたは複数のビット OR から構成される:"
6203 #: build/C/man2/mlock.2:86
6205 #| msgid "B<EFAULT>"
6206 msgid "B<MLOCK_ONFAULT>"
6210 #: build/C/man2/mlock.2:91
6212 "Lock pages that are currently resident and mark the entire range so that the "
6213 "remaining nonresident pages are locked when they are populated by a page "
6218 #: build/C/man2/mlock.2:98
6219 msgid "If I<flags> is 0, B<mlock2>() behaves exactly the same as B<mlock>()."
6223 #: build/C/man2/mlock.2:107
6225 "B<munlock>() unlocks pages in the address range starting at I<addr> and "
6226 "continuing for I<len> bytes. After this call, all pages that contain a part "
6227 "of the specified memory range can be moved to external swap space again by "
6230 "B<munlock>() は、 I<addr> から始まる長さ I<len> バイトのアドレス範囲のページ"
6231 "のロックを解除する。 この呼び出しを行った後は、カーネルが、指定されたメモリー"
6232 "範囲を含む 全てのページを外部のスワップ空間に移動できるようになる。"
6235 #: build/C/man2/mlock.2:107
6237 msgid "mlockall() and munlockall()"
6238 msgstr "mlockall() と munlockall()"
6241 #: build/C/man2/mlock.2:117
6243 "B<mlockall>() locks all pages mapped into the address space of the calling "
6244 "process. This includes the pages of the code, data and stack segment, as "
6245 "well as shared libraries, user space kernel data, shared memory, and memory-"
6246 "mapped files. All mapped pages are guaranteed to be resident in RAM when "
6247 "the call returns successfully; the pages are guaranteed to stay in RAM until "
6250 "B<mlockall>() は呼び出し元プロセスのアドレス空間にマップされている全てのペー"
6251 "ジを ロックする。これにはコード、データ、スタックの 各セグメント、共有ライブ"
6252 "ラリ、カーネルのユーザー空間データ、 共有メモリー、メモリーマップされたファイ"
6253 "ルが含まれる。 システムコールが成功した場合には全てのマップされたページは "
6254 "RAM に 残ることを保証される。 これらのページは後でロック解除されるまで RAM に"
6258 #: build/C/man2/mlock.2:122
6260 "The I<flags> argument is constructed as the bitwise OR of one or more of the "
6261 "following constants:"
6262 msgstr "I<flags> 引数は以下の内容の一つまたは複数のビット OR から構成される:"
6265 #: build/C/man2/mlock.2:122
6267 msgid "B<MCL_CURRENT>"
6268 msgstr "B<MCL_CURRENT>"
6271 #: build/C/man2/mlock.2:126
6273 "Lock all pages which are currently mapped into the address space of the "
6276 "現在、プロセスのアドレス空間にマップされている全てのページをロックする。"
6279 #: build/C/man2/mlock.2:126
6281 msgid "B<MCL_FUTURE>"
6282 msgstr "B<MCL_FUTURE>"
6285 #: build/C/man2/mlock.2:133
6288 #| "Lock all pages which will become mapped into the address space of the "
6289 #| "process in the future. These could be for instance new pages required by "
6290 #| "a growing heap and stack as well as new memory-mapped files or shared "
6291 #| "memory regions."
6293 "Lock all pages which will become mapped into the address space of the "
6294 "process in the future. These could be, for instance, new pages required by "
6295 "a growing heap and stack as well as new memory-mapped files or shared memory "
6298 "将来、プロセスのアドレス空間にマップされる全てのページをロックする。 例えば、"
6299 "ヒープ (heap) やスタックの成長により新しく必要になったページだけで なく、新し"
6300 "くメモリーマップされたファイルや共有メモリー領域もロックされる。"
6303 #: build/C/man2/mlock.2:133
6305 #| msgid "B<MAP_POPULATE> (since Linux 2.5.46)"
6306 msgid "B<MCL_ONFAULT> (since Linux 4.4)"
6307 msgstr "B<MAP_POPULATE> (Linux 2.5.46 以降)"
6310 #: build/C/man2/mlock.2:160
6312 "Used together with B<MCL_CURRENT>, B<MCL_FUTURE>, or both. Mark all current "
6313 "(with B<MCL_CURRENT>) or future (with B<MCL_FUTURE>) mappings to lock "
6314 "pages when they are faulted in. When used with B<MCL_CURRENT>, all present "
6315 "pages are locked, but B<mlockall>() will not fault in non-present pages. "
6316 "When used with B<MCL_FUTURE>, all future mappings will be marked to lock "
6317 "pages when they are faulted in, but they will not be populated by the lock "
6318 "when the mapping is created. B<MCL_ONFAULT> must be used with either "
6319 "B<MCL_CURRENT> or B<MCL_FUTURE> or both."
6323 #: build/C/man2/mlock.2:173
6325 "If B<MCL_FUTURE> has been specified, then a later system call (e.g., "
6326 "B<mmap>(2), B<sbrk>(2), B<malloc>(3)), may fail if it would cause the number "
6327 "of locked bytes to exceed the permitted maximum (see below). In the same "
6328 "circumstances, stack growth may likewise fail: the kernel will deny stack "
6329 "expansion and deliver a B<SIGSEGV> signal to the process."
6331 "B<MCL_FUTURE> が指定されていると、以後のシステムコール (例えば、 B<mmap>(2), "
6332 "B<sbrk>(2), B<malloc>(3)) は、ロックするバイト数が許可された最大値 (下記参"
6333 "照) を超えた場合に 失敗する可能性がある。 同様に、スタックの成長も失敗する可"
6334 "能性がある。 その場合、カーネルはスタックの拡張を拒否し、 B<SIGSEGV> をプロセ"
6338 #: build/C/man2/mlock.2:177
6340 "B<munlockall>() unlocks all pages mapped into the address space of the "
6343 "B<munlockall>() は、呼び出し元プロセスのアドレス空間にマッピングされている "
6347 #: build/C/man2/mlock.2:183
6350 #| "On success these system calls return 0. On error, -1 is returned, "
6351 #| "I<errno> is set appropriately, and no changes are made to any locks in "
6352 #| "the address space of the process."
6354 "On success, these system calls return 0. On error, -1 is returned, I<errno> "
6355 "is set appropriately, and no changes are made to any locks in the address "
6356 "space of the process."
6358 "成功した場合は、これらのシステムコールはゼロを返す。 エラーの場合は -1 が返さ"
6359 "れ、 I<errno> が適切に設定され、プロセスのアドレス空間におけるロックは変更さ"
6363 #: build/C/man2/mlock.2:192
6365 "(Linux 2.6.9 and later) the caller had a nonzero B<RLIMIT_MEMLOCK> soft "
6366 "resource limit, but tried to lock more memory than the limit permitted. "
6367 "This limit is not enforced if the process is privileged (B<CAP_IPC_LOCK>)."
6369 "(Linux 2.6.9 以降) 呼び出し元は非ゼロの ソフト資源制限 B<RLIMIT_MEMLOCK> を持"
6370 "つが、制限が許可している以上のメモリーをロックしようとした。 この制限は、プロ"
6371 "セスが特権 (B<CAP_IPC_LOCK>) を持っている場合は適用されない。"
6373 #. In the case of mlock(), this check is somewhat buggy: it doesn't
6374 #. take into account whether the to-be-locked range overlaps with
6375 #. already locked pages. Thus, suppose we allocate
6376 #. (num_physpages / 4 + 1) of memory, and lock those pages once using
6377 #. mlock(), and then lock the *same* page range a second time.
6378 #. In the case, the second mlock() call will fail, since the check
6379 #. calculates that the process is trying to lock (num_physpages / 2 + 2)
6380 #. pages, which of course is not true. (MTK, Nov 04, kernel 2.4.28)
6382 #: build/C/man2/mlock.2:204
6384 "(Linux 2.4 and earlier) the calling process tried to lock more than half of "
6387 "(Linux 2.4 以前) 呼び出し元プロセスが RAM の半分以上をロックしようとした。"
6389 #. SVr4 documents an additional EAGAIN error code.
6391 #: build/C/man2/mlock.2:210
6393 "The caller is not privileged, but needs privilege (B<CAP_IPC_LOCK>) to "
6394 "perform the requested operation."
6396 "呼び出し側が特権を持っていないが、\n"
6397 "要求された操作を実行するには特権 (B<CAP_IPC_LOCK>) が必要である。"
6400 #: build/C/man2/mlock.2:216
6402 #| msgid "For B<mlock>() and B<munlock>():"
6403 msgid "For B<mlock>(), B<mlock2>(), and B<munlock>():"
6404 msgstr "B<mlock>() と B<munlock>() 用として:"
6407 #: build/C/man2/mlock.2:219
6408 msgid "Some or all of the specified address range could not be locked."
6409 msgstr "指定されたアドレス範囲の一部または全てをロックすることができなかった。"
6412 #: build/C/man2/mlock.2:226
6415 #| "The result of the addition I<start>+I<len> was less than I<start> (e.g., "
6416 #| "the addition may have resulted in an overflow)."
6418 "The result of the addition I<addr>+I<len> was less than I<addr> (e.g., the "
6419 "addition may have resulted in an overflow)."
6421 "I<start>+I<len> の加算の結果が I<start> よりも小さかった\n"
6422 "(例えば、加算でオーバーフローが発生したなど)。"
6425 #: build/C/man2/mlock.2:231
6426 msgid "(Not on Linux) I<addr> was not a multiple of the page size."
6428 "(Linux ではこの意味で使われない) I<addr> がページサイズの倍数ではない。"
6431 #: build/C/man2/mlock.2:235
6433 "Some of the specified address range does not correspond to mapped pages in "
6434 "the address space of the process."
6436 "指定されたアドレス範囲がプロセスのアドレス空間にマップされたページと 一致しな"
6439 #. I.e., the number of VMAs would exceed the 64kB maximum
6441 #: build/C/man2/mlock.2:244
6443 "Locking or unlocking a region would result in the total number of mappings "
6444 "with distinct attributes (e.g., locked versus unlocked) exceeding the "
6445 "allowed maximum. (For example, unlocking a range in the middle of a "
6446 "currently locked mapping would result in three mappings: two locked mappings "
6447 "at each end and an unlocked mapping in the middle.)"
6451 #: build/C/man2/mlock.2:247
6453 #| msgid "For B<mlockall>():"
6454 msgid "For B<mlock2>():"
6455 msgstr "B<mlockall>() 用として:"
6458 #: build/C/man2/mlock.2:250
6459 msgid "Unknown I<flags> were specified."
6460 msgstr "未知の I<flags> が指定された。"
6463 #: build/C/man2/mlock.2:253
6464 msgid "For B<mlockall>():"
6465 msgstr "B<mlockall>() 用として:"
6468 #: build/C/man2/mlock.2:261
6470 "Unknown I<flags> were specified or B<MCL_ONFAULT> was specified without "
6471 "either B<MCL_FUTURE> or B<MCL_CURRENT>."
6475 #: build/C/man2/mlock.2:264
6476 msgid "For B<munlockall>():"
6477 msgstr "B<munlockall>() 用として:"
6480 #: build/C/man2/mlock.2:268
6482 "(Linux 2.6.8 and earlier) The caller was not privileged (B<CAP_IPC_LOCK>)."
6484 "(Linux 2.6.8 以前) 呼び出し元が権限 (B<CAP_IPC_LOCK>) を持っていない。"
6487 #: build/C/man2/mlock.2:272
6490 #| "The B<remap_file_pages>() system call appeared in Linux 2.5.46; glibc "
6491 #| "support was added in version 2.3.3."
6493 "B<mlock2>() is available since Linux 4.4; glibc support was added in "
6496 "B<remap_file_pages>() システムコールは Linux 2.5.46 で登場した。 glibc での"
6497 "サポートは glibc バージョン 2.3.3 で追加された。"
6499 #. SVr4 documents an additional error condition EMFILE.
6501 #: build/C/man2/mlock.2:274 build/C/man2/shmctl.2:467 build/C/man2/shmget.2:283
6502 #: build/C/man2/shmop.2:230
6504 #| msgid "POSIX.1-2001, SVr4."
6505 msgid "POSIX.1-2001, POSIX.1-2008, SVr4."
6506 msgstr "POSIX.1-2001, SVr4."
6509 #: build/C/man2/mlock.2:277
6511 #| msgid "B<fallocate>() is Linux-specific."
6512 msgid "B<mlock2>() is Linux specific."
6513 msgstr "B<fallocate>() は Linux 固有である。"
6516 #: build/C/man2/mlock.2:289
6518 "On POSIX systems on which B<mlock>() and B<munlock>() are available, "
6519 "B<_POSIX_MEMLOCK_RANGE> is defined in I<E<lt>unistd.hE<gt>> and the number "
6520 "of bytes in a page can be determined from the constant B<PAGESIZE> (if "
6521 "defined) in I<E<lt>limits.hE<gt>> or by calling I<sysconf(_SC_PAGESIZE)>."
6523 "B<mlock>() と B<munlock>() が使用可能な POSIX システムでは "
6524 "B<_POSIX_MEMLOCK_RANGE> が I<E<lt>unistd.hE<gt>> で定義されている。 また、"
6525 "ページあたりのバイト数は、 I<E<lt>limits.hE<gt>> で定義される定数 "
6526 "B<PAGESIZE> から (定義されている場合)、もしくは I<sysconf(_SC_PAGESIZE)> を呼"
6529 #. POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
6530 #. -1: unavailable, 0: ask using sysconf().
6531 #. glibc defines it to 1.
6533 #: build/C/man2/mlock.2:302
6535 "On POSIX systems on which B<mlockall>() and B<munlockall>() are available, "
6536 "B<_POSIX_MEMLOCK> is defined in I<E<lt>unistd.hE<gt>> to a value greater "
6537 "than 0. (See also B<sysconf>(3).)"
6539 "B<mlockall>() と B<munlockall>() が利用可能な POSIX システムでは、 "
6540 "B<_POSIX_MEMLOCK> は I<E<lt>unistd.hE<gt>> で 0 より大きい値に定義されている "
6541 "(B<sysconf>(3) も参照のこと)。"
6544 #: build/C/man2/mlock.2:320
6546 "Memory locking has two main applications: real-time algorithms and high-"
6547 "security data processing. Real-time applications require deterministic "
6548 "timing, and, like scheduling, paging is one major cause of unexpected "
6549 "program execution delays. Real-time applications will usually also switch "
6550 "to a real-time scheduler with B<sched_setscheduler>(2). Cryptographic "
6551 "security software often handles critical bytes like passwords or secret keys "
6552 "as data structures. As a result of paging, these secrets could be "
6553 "transferred onto a persistent swap store medium, where they might be "
6554 "accessible to the enemy long after the security software has erased the "
6555 "secrets in RAM and terminated. (But be aware that the suspend mode on "
6556 "laptops and some desktop computers will save a copy of the system's RAM to "
6557 "disk, regardless of memory locks.)"
6559 "メモリーのロックの用途としては主に二つある: リアルタイム アルゴリズムと高いセ"
6560 "キュリティの必要なデータ処理である。リアルタイムの アプリケーションは決定的な"
6561 "タイミングやスケジューリングを必要とするが、 ページングは予期しないプログラム"
6562 "の実行遅延をもたらす主要な要因となる。 リアルタイムのアプリケーションはたいて"
6563 "いは B<sched_setscheduler>(2) でリアルタイムスケジューラに変更される。 暗号"
6564 "やセキュリティのソフトウェアはしばしばパスワードや秘密鍵のデータの ような重要"
6565 "なバイト列を扱う。ページングの結果、これらの秘密が スワップ用の固定媒体に転送"
6566 "されるかもしれない。そして、セキュリティ ソフトウェアが RAM 上の秘密を削除し"
6567 "て終了したずっと後になっても、 このスワップされたデータには敵がアクセスできる"
6568 "可能性がある (しかし、ラップトップといくつかのデスクトップコンピュータの サス"
6569 "ペンドモードはシステムの RAM の内容をメモリーのロックに関わらず ディスクに保"
6573 #: build/C/man2/mlock.2:333
6575 "Real-time processes that are using B<mlockall>() to prevent delays on page "
6576 "faults should reserve enough locked stack pages before entering the time-"
6577 "critical section, so that no page fault can be caused by function calls. "
6578 "This can be achieved by calling a function that allocates a sufficiently "
6579 "large automatic variable (an array) and writes to the memory occupied by "
6580 "this array in order to touch these stack pages. This way, enough pages will "
6581 "be mapped for the stack and can be locked into RAM. The dummy writes ensure "
6582 "that not even copy-on-write page faults can occur in the critical section."
6584 "リアルタイムプロセスが B<mlockall>() を使ってページフォールトによる遅延を防"
6585 "ごうとする場合、 関数呼び出しによってページフォールトが発生しないように、 時"
6586 "間制限の厳しい部分 (time-critical section) に入る前に 十分な量のロックされた"
6587 "スタックを確保しておく必要がある。 これを実現するには、十分な大きさの自動変"
6588 "数 (の配列) を確保し、 これらのスタック用のページがメモリー上に確保されるよう"
6589 "にこの配列に 書き込みを行う関数を用意し、これを呼び出せばよい。こうすること"
6590 "で、 十分な量のページがスタックにマッピングされ、RAM にロックされる。 ダミー"
6591 "の書き込みを行うことによって、 時間制限の厳しい部分 (critical section) 内では"
6592 "書き込み時コピーによる ページフォールトさえも発生しないことが保証される。"
6595 #: build/C/man2/mlock.2:348
6598 #| "Memory locks are not inherited by a child created via B<fork>(2) and are "
6599 #| "automatically removed (unlocked) during an B<execve>(2) or when the "
6600 #| "process terminates. The B<mlockall>() B<MCL_FUTURE> setting is not "
6601 #| "inherited by a child created via B<fork>(2) and is cleared during an "
6604 "Memory locks are not inherited by a child created via B<fork>(2) and are "
6605 "automatically removed (unlocked) during an B<execve>(2) or when the process "
6606 "terminates. The B<mlockall>() B<MCL_FUTURE> and B<MCL_FUTURE | "
6607 "MCL_ONFAULT> settings are not inherited by a child created via B<fork>(2) "
6608 "and are cleared during an B<execve>(2)."
6610 "メモリーロックは B<fork>(2) で作成された子プロセスには継承されず、 "
6611 "B<execve>(2) が呼ばれたり、プロセスが終了した場合は 自動的に削除される (ロッ"
6612 "ク解除される)。 B<mlockall>() の B<MCL_FUTURE> 設定は B<fork>(2) で作成された"
6613 "子プロセスには継承されず、 B<execve>(2) の中でクリアされる。"
6616 #: build/C/man2/mlock.2:362
6618 "Note that B<fork>(2) will prepare the address space for a copy-on-write "
6619 "operation. The consequence is that any write access that follows will cause "
6620 "a page fault that in turn may cause high latencies for a real-time process. "
6621 "Therefore, it is crucial not to invoke B<fork>(2) after an B<mlockall>() "
6622 "or B<mlock>() operation\\(emnot even from a thread which runs at a low "
6623 "priority within a process which also has a thread running at elevated "
6628 #: build/C/man2/mlock.2:366
6630 "The memory lock on an address range is automatically removed if the address "
6631 "range is unmapped via B<munmap>(2)."
6633 "あるアドレス範囲に対するメモリーロックは、そのアドレス範囲が B<munmap>(2) に"
6634 "よってアンマップされた場合は削除される。"
6637 #: build/C/man2/mlock.2:380
6640 #| "Memory locks do not stack, that is, pages which have been locked several "
6641 #| "times by calls to B<mlock>() or B<mlockall>() will be unlocked by a "
6642 #| "single call to B<munlock>() for the corresponding range or by "
6643 #| "B<munlockall>(). Pages which are mapped to several locations or by "
6644 #| "several processes stay locked into RAM as long as they are locked at "
6645 #| "least at one location or by at least one process."
6647 "Memory locks do not stack, that is, pages which have been locked several "
6648 "times by calls to B<mlock>(), B<mlock2>(), or B<mlockall>() will be "
6649 "unlocked by a single call to B<munlock>() for the corresponding range or by "
6650 "B<munlockall>(). Pages which are mapped to several locations or by several "
6651 "processes stay locked into RAM as long as they are locked at least at one "
6652 "location or by at least one process."
6654 "メモリーのロックは累積しない。 すなわち複数回 B<mlock>() や B<mlockall>() "
6655 "を呼び出してロックされたページでも、 対応する範囲に対して B<munlock>() を 1 "
6656 "回呼び出したり B<munlockall>() を呼び出したりするだけでロック解除される。 複"
6657 "数の場所や複数のプロセスにマップされているページは、少なくとも一つの場所、 一"
6658 "つのプロセスでロックされている限りは RAM に残り続ける。"
6661 #: build/C/man2/mlock.2:389
6663 "If a call to B<mlockall>() which uses the B<MCL_FUTURE> flag is followed by "
6664 "another call that does not specify this flag, the changes made by the "
6665 "B<MCL_FUTURE> call will be lost."
6669 #: build/C/man2/mlock.2:400
6671 "The B<mlock2>() B<MLOCK_ONFAULT> flag and the B<mlockall>() B<MCL_ONFAULT> "
6672 "flag allow efficient memory locking for applications that deal with large "
6673 "mappings where only a (small) portion of pages in the mapping are touched. "
6674 "In such cases, locking all of the pages in a mapping would incur a "
6675 "significant penalty for memory locking."
6679 #: build/C/man2/mlock.2:416
6682 #| "Under Linux, B<mlock>() and B<munlock>() automatically round I<addr> "
6683 #| "down to the nearest page boundary. However, POSIX.1-2001 allows an "
6684 #| "implementation to require that I<addr> is page aligned, so portable "
6685 #| "applications should ensure this."
6687 "Under Linux, B<mlock>(), B<mlock2>(), and B<munlock>() automatically round "
6688 "I<addr> down to the nearest page boundary. However, the POSIX.1 "
6689 "specification of B<mlock>() and B<munlock>() allows an implementation to "
6690 "require that I<addr> is page aligned, so portable applications should ensure "
6693 "Linux では、 B<mlock>() と B<munlock>() は自動的に I<addr> を端数切り捨てに"
6694 "より一番近いページ境界へと丸める。 しかし POSIX.1-2001 は I<addr> がページ境"
6695 "界に合っていることを要求する実装も許している。 そのため移植性を意図したアプリ"
6696 "ケーションではきちんと境界に合わせた方が良い。"
6699 #: build/C/man2/mlock.2:430
6702 #| "The I<VmLck> field of the Linux-specific I</proc/PID/status> file shows "
6703 #| "how many kilobytes of memory the process with ID I<PID> has locked using "
6704 #| "B<mlock>(), B<mlockall>(), and B<mmap>(2) B<MAP_LOCKED>."
6706 "The I<VmLck> field of the Linux-specific I</proc/[pid]/status> file shows "
6707 "how many kilobytes of memory the process with ID I<PID> has locked using "
6708 "B<mlock>(), B<mlock2>(), B<mlockall>(), and B<mmap>(2) B<MAP_LOCKED>."
6710 "Linux 固有の I</proc/PID/status> ファイルの I<VmLck> フィールドには、\n"
6711 "B<mlock>(), B<mlockall>() および B<mmap>(2) B<MAP_LOCKED> を使って、\n"
6712 "ID が I<PID> のプロセスがロックしているメモリー量 (キロバイト単位) が\n"
6716 #: build/C/man2/mlock.2:430
6718 msgid "Limits and permissions"
6722 #: build/C/man2/mlock.2:437
6724 "In Linux 2.6.8 and earlier, a process must be privileged (B<CAP_IPC_LOCK>) "
6725 "in order to lock memory and the B<RLIMIT_MEMLOCK> soft resource limit "
6726 "defines a limit on how much memory the process may lock."
6728 "Linux 2.6.8 以前では、メモリーをロックするためには特権 (B<CAP_IPC_LOCK>) が"
6729 "必要で、 ソフト資源制限 B<RLIMIT_MEMLOCK> はプロセスがどれだけのメモリーを"
6733 #: build/C/man2/mlock.2:443
6735 "Since Linux 2.6.9, no limits are placed on the amount of memory that a "
6736 "privileged process can lock and the B<RLIMIT_MEMLOCK> soft resource limit "
6737 "instead defines a limit on how much memory an unprivileged process may lock."
6739 "Linux 2.6.9 以降では、特権を持つプロセスがロックできるメモリー量は無制限とな"
6740 "り、 代わりにソフト資源制限 B<RLIMIT_MEMLOCK> は特権を持たないプロセスがロッ"
6741 "クできるメモリー量の制限を定義する。"
6743 #. commit 0cf2f6f6dc605e587d2c1120f295934c77e810e8
6745 #: build/C/man2/mlock.2:466
6747 "In Linux 4.8 and earlier, a bug in the kernel's accounting of locked memory "
6748 "for unprivileged processes (i.e., without B<CAP_IPC_LOCK>) meant that if "
6749 "the region specified by I<addr> and I<len> overlapped an existing lock, then "
6750 "the already locked bytes in the overlapping region were counted twice when "
6751 "checking against the limit. Such double accounting could incorrectly "
6752 "calculate a \"total locked memory\" value for the process that exceeded the "
6753 "B<RLIMIT_MEMLOCK> limit, with the result that B<mlock>() and B<mlock2>() "
6754 "would fail on requests that should have succeeded. This bug was fixed in "
6759 #: build/C/man2/mlock.2:474
6761 "In the 2.4 series Linux kernels up to and including 2.4.17, a bug caused the "
6762 "B<mlockall>() B<MCL_FUTURE> flag to be inherited across a B<fork>(2). This "
6763 "was rectified in kernel 2.4.18."
6765 "2.4.17 までの 2.4 シリーズの Linux カーネルには、 B<mlockall>() "
6766 "B<MCL_FUTURE> フラグが B<fork>(2) で継承されると言うバグがある。 これはカー"
6769 #. See the following LKML thread:
6770 #. http://marc.theaimsgroup.com/?l=linux-kernel&m=113801392825023&w=2
6771 #. "Rationale for RLIMIT_MEMLOCK"
6774 #: build/C/man2/mlock.2:491
6776 "Since kernel 2.6.9, if a privileged process calls I<mlockall(MCL_FUTURE)> "
6777 "and later drops privileges (loses the B<CAP_IPC_LOCK> capability by, for "
6778 "example, setting its effective UID to a nonzero value), then subsequent "
6779 "memory allocations (e.g., B<mmap>(2), B<brk>(2)) will fail if the "
6780 "B<RLIMIT_MEMLOCK> resource limit is encountered."
6782 "カーネル 2.6.9 以降では、特権を持ったプロセスが I<mlockall(MCL_FUTURE)> を呼"
6783 "び出した後で、特権をなくした場合 (例えば、 実効 UID を 0 以外の値に変更するな"
6784 "どにより、 B<CAP_IPC_LOCK> ケーパビリティを失った場合)、リソース上限 "
6785 "B<RLIMIT_MEMLOCK> に達すると、それ以降のメモリー割り当て (例えば B<mmap>(2), "
6789 #: build/C/man2/mlock.2:499
6792 #| "B<mmap>(2), B<setrlimit>(2), B<shmctl>(2), B<sysconf>(3), B<proc>(5), "
6793 #| "B<capabilities>(7)"
6795 "B<mincore>(2), B<mmap>(2), B<setrlimit>(2), B<shmctl>(2), B<sysconf>(3), "
6796 "B<proc>(5), B<capabilities>(7)"
6798 "B<mmap>(2), B<setrlimit>(2), B<shmctl>(2), B<sysconf>(3), B<proc>(5),\n"
6799 "B<capabilities>(7)"
6802 #: build/C/man2/mmap.2:40
6808 #: build/C/man2/mmap.2:43
6809 msgid "mmap, munmap - map or unmap files or devices into memory"
6810 msgstr "mmap, munmap - ファイルやデバイスをメモリーにマップ/アンマップする"
6813 #: build/C/man2/mmap.2:51
6816 "B<void *mmap(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<, int >I<flags>B<,>\n"
6817 "B< int >I<fd>B<, off_t >I<offset>B<);>\n"
6818 "B<int munmap(void *>I<addr>B<, size_t >I<length>B<);>\n"
6820 "B<void *mmap(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<, int >I<flags>B<,>\n"
6821 "B< int >I<fd>B<, off_t >I<offset>B<);>\n"
6822 "B<int munmap(void *>I<addr>B<, size_t >I<length>B<);>\n"
6825 #: build/C/man2/mmap.2:54
6826 msgid "See NOTES for information on feature test macro requirements."
6827 msgstr "機能検査マクロの要件に関する情報は「注意」の節を参照。"
6830 #: build/C/man2/mmap.2:63
6833 #| "B<mmap>() creates a new mapping in the virtual address space of the "
6834 #| "calling process. The starting address for the new mapping is specified "
6835 #| "in I<addr>. The I<length> argument specifies the length of the mapping."
6837 "B<mmap>() creates a new mapping in the virtual address space of the calling "
6838 "process. The starting address for the new mapping is specified in I<addr>. "
6839 "The I<length> argument specifies the length of the mapping (which must be "
6842 "B<mmap>() は、新しいマッピングを呼び出し元プロセスの仮想アドレス空間に作成す"
6843 "る。 新しいマッピングの開始アドレスは I<addr> で指定される。マッピングの長さ"
6844 "は I<length> 引き数で指定される。"
6846 #. Before Linux 2.6.24, the address was rounded up to the next page
6847 #. boundary; since 2.6.24, it is rounded down!
6849 #: build/C/man2/mmap.2:83
6852 #| "If I<addr> is NULL, then the kernel chooses the address at which to "
6853 #| "create the mapping; this is the most portable method of creating a new "
6854 #| "mapping. If I<addr> is not NULL, then the kernel takes it as a hint "
6855 #| "about where to place the mapping; on Linux, the mapping will be created "
6856 #| "at a nearby page boundary. The address of the new mapping is returned as "
6857 #| "the result of the call."
6859 "If I<addr> is NULL, then the kernel chooses the (page-aligned) address at "
6860 "which to create the mapping; this is the most portable method of creating a "
6861 "new mapping. If I<addr> is not NULL, then the kernel takes it as a hint "
6862 "about where to place the mapping; on Linux, the kernel will pick a nearby "
6863 "page boundary (but always above or equal to the value specified by I</proc/"
6864 "sys/vm/mmap_min_addr>) and attempt to create the mapping there. If another "
6865 "mapping already exists there, the kernel picks a new address that may or may "
6866 "not depend on the hint. The address of the new mapping is returned as the "
6867 "result of the call."
6869 "I<addr> が NULL の場合、カーネルがマッピングを作成するアドレスを選択する。 こ"
6870 "の方法は最も移植性のある新しいマッピングの作成方法である。 I<addr> が NULL で"
6871 "ない場合、カーネルはマッピングをどこに配置するかのヒントとして I<addr> を使用"
6872 "する。Linux では、マッピングはすぐ近くのページ境界に作成される。 新しいマッピ"
6873 "ングのアドレスは、呼び出しの返り値として返される。"
6876 #: build/C/man2/mmap.2:95
6878 "The contents of a file mapping (as opposed to an anonymous mapping; see "
6879 "B<MAP_ANONYMOUS> below), are initialized using I<length> bytes starting at "
6880 "offset I<offset> in the file (or other object) referred to by the file "
6881 "descriptor I<fd>. I<offset> must be a multiple of the page size as returned "
6882 "by I<sysconf(_SC_PAGE_SIZE)>."
6884 "ファイルマッピングの内容は、 ファイルディスクリプター I<fd> で参照されるファ"
6885 "イル (もしくは他のオブジェクト) のオフセット I<offset> から開始される "
6886 "I<length> バイトのデータで初期化される (ファイルマッピングは無名マッピングの"
6887 "反対語である。 B<MAP_ANONYMOUS> を参照)。 I<offset> は "
6888 "I<sysconf(_SC_PAGE_SIZE)> が返すページサイズの倍数でなければならない。"
6891 #: build/C/man2/mmap.2:101
6893 "After the B<mmap>() call has returned, the file descriptor, I<fd>, can be "
6894 "closed immediately without invalidating the mapping."
6898 #: build/C/man2/mmap.2:109
6900 "The I<prot> argument describes the desired memory protection of the mapping "
6901 "(and must not conflict with the open mode of the file). It is either "
6902 "B<PROT_NONE> or the bitwise OR of one or more of the following flags:"
6904 "引き数 I<prot> には、マッピングのメモリー保護をどのように行なうかを指定する "
6905 "(ファイルのオープンモードと矛盾してはいけない)。 I<prot> には、 B<PROT_NONE> "
6906 "か、以下のフラグをひとつ以上ビット毎の論理和 (OR) をとったものを 指定できる。"
6909 #: build/C/man2/mmap.2:109 build/C/man2/mprotect.2:73
6911 msgid "B<PROT_EXEC>"
6912 msgstr "B<PROT_EXEC>"
6915 #: build/C/man2/mmap.2:112
6916 msgid "Pages may be executed."
6917 msgstr "ページは実行可能である。"
6920 #: build/C/man2/mmap.2:112 build/C/man2/mprotect.2:67
6922 msgid "B<PROT_READ>"
6923 msgstr "B<PROT_READ>"
6926 #: build/C/man2/mmap.2:115
6927 msgid "Pages may be read."
6928 msgstr "ページは読み込み可能である。"
6931 #: build/C/man2/mmap.2:115 build/C/man2/mprotect.2:70
6933 msgid "B<PROT_WRITE>"
6934 msgstr "B<PROT_WRITE>"
6937 #: build/C/man2/mmap.2:118
6938 msgid "Pages may be written."
6939 msgstr "ページに書き込み可能である。"
6942 #: build/C/man2/mmap.2:118 build/C/man2/mprotect.2:64
6944 msgid "B<PROT_NONE>"
6945 msgstr "B<PROT_NONE>"
6948 #: build/C/man2/mmap.2:122
6949 msgid "Pages may not be accessed."
6950 msgstr "ページにはアクセスできない。"
6953 #: build/C/man2/mmap.2:122
6955 msgid "The flags argument"
6959 #: build/C/man2/mmap.2:131
6961 "The I<flags> argument determines whether updates to the mapping are visible "
6962 "to other processes mapping the same region, and whether updates are carried "
6963 "through to the underlying file. This behavior is determined by including "
6964 "exactly one of the following values in I<flags>:"
6966 "I<flags> 引き数により、マッピングに対する更新が同じ領域をマッピングしている "
6967 "他のプロセスに見えるか、更新がマッピング元のファイルを通じて 伝えられるか、が"
6968 "決定される。この動作は、以下の値のいずれか一つだけ (複数は指定できない) を "
6969 "I<flags> に含めることで指定する。"
6972 #: build/C/man2/mmap.2:131
6974 msgid "B<MAP_SHARED>"
6975 msgstr "B<MAP_SHARED>"
6978 #: build/C/man2/mmap.2:140
6981 #| "Share this mapping. Updates to the mapping are visible to other "
6982 #| "processes that map this file, and are carried through to the underlying "
6983 #| "file. The file may not actually be updated until B<msync>(2) or "
6984 #| "B<munmap>() is called."
6986 "Share this mapping. Updates to the mapping are visible to other processes "
6987 "mapping the same region, and (in the case of file-backed mappings) are "
6988 "carried through to the underlying file. (To precisely control when updates "
6989 "are carried through to the underlying file requires the use of B<msync>(2).)"
6991 "このマッピングを共有する。 マッピングに対する更新はこのファイルをマッピングし"
6992 "ている他のプロセス から見える。更新はマッピング元のファイルを通じて伝えられ"
6993 "る。 ただし、ファイルの実際の更新は B<msync>(2) または B<munmap>() が呼ばれ"
6997 #: build/C/man2/mmap.2:140
6999 #| msgid "B<MAP_POPULATE> (since Linux 2.5.46)"
7000 msgid "B<MAP_SHARED_VALIDATE> (since Linux 4.15)"
7001 msgstr "B<MAP_POPULATE> (Linux 2.5.46 以降)"
7004 #: build/C/man2/mmap.2:157
7006 "This flag provides the same behavior as B<MAP_SHARED> except that "
7007 "B<MAP_SHARED> mappings ignore unknown flags in I<flags>. By contrast, when "
7008 "creating a mapping using B<MAP_SHARED_VALIDATE>, the kernel verifies all "
7009 "passed flags are known and fails the mapping with the error B<EOPNOTSUPP> "
7010 "for unknown flags. This mapping type is also required to be able to use "
7011 "some mapping flags (e.g., B<MAP_SYNC>)."
7015 #: build/C/man2/mmap.2:157
7017 msgid "B<MAP_PRIVATE>"
7018 msgstr "B<MAP_PRIVATE>"
7021 #: build/C/man2/mmap.2:166
7023 "Create a private copy-on-write mapping. Updates to the mapping are not "
7024 "visible to other processes mapping the same file, and are not carried "
7025 "through to the underlying file. It is unspecified whether changes made to "
7026 "the file after the B<mmap>() call are visible in the mapped region."
7028 "プライベートな copy-on-write (書き込み時コピー) マップを生成する。 マッピング"
7029 "に対する更新は同じファイルをマッピングしている他のプロセス には見えず、更新が"
7030 "マッピング元のファイルを通じて伝えられることもない。 B<mmap>() の呼び出し後"
7031 "にマッピング元のファイルに対して行われた変更が、 マップ領域に反映されるかどう"
7035 #: build/C/man2/mmap.2:174
7037 "Both B<MAP_SHARED> and B<MAP_PRIVATE> are described in POSIX.1-2001 and "
7038 "POSIX.1-2008. B<MAP_SHARED_VALIDATE> is a Linux extension."
7042 #: build/C/man2/mmap.2:177
7044 "In addition, zero or more of the following values can be ORed in I<flags>:"
7046 "さらに、以下の値のうち 0 個以上をビット毎の論理和 (OR) で I<flags> に指定する"
7050 #: build/C/man2/mmap.2:177
7052 msgid "B<MAP_32BIT> (since Linux 2.4.20, 2.6)"
7053 msgstr "B<MAP_32BIT> (Linux 2.4.20, 2.6 以降)"
7055 #. See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08
7057 #: build/C/man2/mmap.2:193
7060 #| "Put the mapping into the first 2 Gigabytes of the process address space. "
7061 #| "This flag is supported only on x86-64, for 64-bit programs. It was added "
7062 #| "to allow thread stacks to be allocated somewhere in the first 2GB of "
7063 #| "memory, so as to improve context-switch performance on some early 64-bit "
7064 #| "processors. Modern x86-64 processors no longer have this performance "
7065 #| "problem, so use of this flag is not required on those systems. The "
7066 #| "B<MAP_32BIT> flag is ignored when B<MAP_FIXED> is set."
7068 "Put the mapping into the first 2 Gigabytes of the process address space. "
7069 "This flag is supported only on x86-64, for 64-bit programs. It was added to "
7070 "allow thread stacks to be allocated somewhere in the first 2\\ GB of memory, "
7071 "so as to improve context-switch performance on some early 64-bit "
7072 "processors. Modern x86-64 processors no longer have this performance "
7073 "problem, so use of this flag is not required on those systems. The "
7074 "B<MAP_32BIT> flag is ignored when B<MAP_FIXED> is set."
7076 "マッピングをプロセスのアドレス空間の先頭 2 ギガバイト以内に配置する。 このフ"
7077 "ラグがサポートされているのは x86-64 アーキテクチャー上の 64 ビットプログラム"
7078 "のみである。 このフラグが追加されたのは、スレッドのスタックをメモリーの先頭 "
7079 "2GB 以内の どこかに割り当てることで、初期のいくつかの 64 ビットプロセッサにお"
7080 "ける コンテキストスイッチの性能問題を改善するためである。 最近の x86-64 プロ"
7081 "セッサではこの性能問題はもはや存在せず、 そのようなシステムではこのフラグを使"
7082 "用する必要はない。 B<MAP_FIXED> がセットされている場合は、 B<MAP_32BIT> フラ"
7086 #: build/C/man2/mmap.2:193
7089 msgstr "B<MAP_ANON>"
7092 #: build/C/man2/mmap.2:198
7094 "Synonym for B<MAP_ANONYMOUS>; provided for compatibility with other "
7099 #: build/C/man2/mmap.2:198
7101 msgid "B<MAP_ANONYMOUS>"
7102 msgstr "B<MAP_ANONYMOUS>"
7104 #. See the pgoff overflow check in do_mmap().
7105 #. See the offset check in sys_mmap in arch/x86/kernel/sys_x86_64.c.
7107 #: build/C/man2/mmap.2:223
7110 #| "The mapping is not backed by any file; its contents are initialized to "
7111 #| "zero. The I<fd> and I<offset> arguments are ignored; however, some "
7112 #| "implementations require I<fd> to be -1 if B<MAP_ANONYMOUS> (or "
7113 #| "B<MAP_ANON>) is specified, and portable applications should ensure "
7114 #| "this. The use of B<MAP_ANONYMOUS> in conjunction with B<MAP_SHARED> is "
7115 #| "supported on Linux only since kernel 2.4."
7117 "The mapping is not backed by any file; its contents are initialized to "
7118 "zero. The I<fd> argument is ignored; however, some implementations require "
7119 "I<fd> to be -1 if B<MAP_ANONYMOUS> (or B<MAP_ANON>) is specified, and "
7120 "portable applications should ensure this. The I<offset> argument should be "
7121 "zero. The use of B<MAP_ANONYMOUS> in conjunction with B<MAP_SHARED> is "
7122 "supported on Linux only since kernel 2.4."
7124 "マッピングはどのファイルとも関連付けされない。 マッピングの内容は 0 で初期化"
7125 "される。 引き数 I<fd> と I<offset> は無視される。 ただし、実装によっては "
7126 "B<MAP_ANONYMOUS> (もしくは B<MAP_ANON>) が指定された場合、 I<fd> を -1 にす"
7127 "る必要があり、 移植性が必要なアプリケーションでは必ず I<fd> を -1 にすべきで"
7128 "ある。 B<MAP_ANONYMOUS> と B<MAP_SHARED> を組み合わせての利用は カーネル 2.4 "
7129 "以降の Linux でのみサポートされている。"
7132 #: build/C/man2/mmap.2:223
7134 msgid "B<MAP_DENYWRITE>"
7135 msgstr "B<MAP_DENYWRITE>"
7137 #. Introduced in 1.1.36, removed in 1.3.24.
7139 #: build/C/man2/mmap.2:231
7142 #| "This flag is ignored. (Long ago, it signaled that attempts to write to "
7143 #| "the underlying file should fail with B<ETXTBUSY>. But this was a source "
7144 #| "of denial-of-service attacks.)"
7146 "This flag is ignored. (Long ago\\(emLinux 2.0 and earlier\\(emit signaled "
7147 "that attempts to write to the underlying file should fail with B<ETXTBSY>. "
7148 "But this was a source of denial-of-service attacks.)"
7150 "このフラグは無視される (ずっと前は、マップ元のファイルへの書き込みを行おうと"
7151 "すると、エラー B<ETXTBUSY> で失敗するようにシグナルが設定されていたが、これ"
7152 "は denial-of-service (サービス拒否) 攻撃の原因となった)。"
7155 #: build/C/man2/mmap.2:231
7157 msgid "B<MAP_EXECUTABLE>"
7158 msgstr "B<MAP_EXECUTABLE>"
7160 #. Introduced in 1.1.38, removed in 1.3.24. Flag tested in proc_follow_link.
7161 #. (Long ago, it signaled that the underlying file is an executable.
7162 #. However, that information was not really used anywhere.)
7163 #. Linus talked about DOS related to MAP_EXECUTABLE, but he was thinking of
7166 #: build/C/man2/mmap.2:239
7167 msgid "This flag is ignored."
7168 msgstr "このフラグは無視される。"
7171 #: build/C/man2/mmap.2:239
7174 msgstr "B<MAP_FILE>"
7176 #. On some systems, this was required as the opposite of
7177 #. MAP_ANONYMOUS -- mtk, 1 May 2007
7179 #: build/C/man2/mmap.2:245
7180 msgid "Compatibility flag. Ignored."
7181 msgstr "互換性のためのフラグ。無視される。"
7184 #: build/C/man2/mmap.2:245
7186 msgid "B<MAP_FIXED>"
7187 msgstr "B<MAP_FIXED>"
7190 #: build/C/man2/mmap.2:263
7193 #| "Don't interpret I<addr> as a hint: place the mapping at exactly that "
7194 #| "address. I<addr> must be a multiple of the page size. If the memory "
7195 #| "region specified by I<addr> and I<len> overlaps pages of any existing "
7196 #| "mapping(s), then the overlapped part of the existing mapping(s) will be "
7197 #| "discarded. If the specified address cannot be used, B<mmap>() will "
7198 #| "fail. Because requiring a fixed address for a mapping is less portable, "
7199 #| "the use of this option is discouraged."
7201 "Don't interpret I<addr> as a hint: place the mapping at exactly that "
7202 "address. I<addr> must be suitably aligned: for most architectures a "
7203 "multiple of the page size is sufficient; however, some architectures may "
7204 "impose additional restrictions. If the memory region specified by I<addr> "
7205 "and I<len> overlaps pages of any existing mapping(s), then the overlapped "
7206 "part of the existing mapping(s) will be discarded. If the specified address "
7207 "cannot be used, B<mmap>() will fail."
7209 "I<addr> をアドレスのヒントとして使用するのではなく、 I<addr> で指定されたアド"
7210 "レスをそのまま使用してマッピングを配置する。 I<addr> はページサイズの倍数でな"
7211 "ければならない。 I<addr> と I<len> で指定されたメモリー領域が既存のマッピング"
7212 "のページと重なる場合、 既存のマッピングの重なった部分は捨てられる。 もし指定"
7213 "されたアドレスが使用できない場合、 B<mmap>() は失敗する。 マッピングに対して"
7214 "固定アドレスを要求するのは移植性の面で劣るので、 このオプションは使用しないこ"
7218 #: build/C/man2/mmap.2:271
7220 "Software that aspires to be portable should use the B<MAP_FIXED> flag with "
7221 "care, keeping in mind that the exact layout of a process's memory mappings "
7222 "is allowed to change significantly between kernel versions, C library "
7223 "versions, and operating system releases. I<Carefully read the discussion of "
7224 "this flag in NOTES!>"
7228 #: build/C/man2/mmap.2:271
7230 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
7231 msgid "B<MAP_FIXED_NOREPLACE> (since Linux 4.17)"
7232 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
7234 #. commit a4ff8e8620d3f4f50ac4b41e8067b7d395056843
7236 #: build/C/man2/mmap.2:287
7238 "This flag provides behavior that is similar to B<MAP_FIXED> with respect to "
7239 "the I<addr> enforcement, but differs in that B<MAP_FIXED_NOREPLACE> never "
7240 "clobbers a preexisting mapped range. If the requested range would collide "
7241 "with an existing mapping, then this call fails with the error B<EEXIST.> "
7242 "This flag can therefore be used as a way to atomically (with respect to "
7243 "other threads) attempt to map an address range: one thread will succeed; all "
7244 "others will report failure."
7248 #: build/C/man2/mmap.2:297
7250 "Note that older kernels which do not recognize the B<MAP_FIXED_NOREPLACE> "
7251 "flag will typically (upon detecting a collision with a preexisting mapping) "
7252 "fall back to a \"non-B<MAP_FIXED>\" type of behavior: they will return an "
7253 "address that is different from the requested address. Therefore, backward-"
7254 "compatible software should check the returned address against the requested "
7259 #: build/C/man2/mmap.2:297
7261 msgid "B<MAP_GROWSDOWN>"
7262 msgstr "B<MAP_GROWSDOWN>"
7265 #: build/C/man2/mmap.2:311
7267 "This flag is used for stacks. It indicates to the kernel virtual memory "
7268 "system that the mapping should extend downward in memory. The return "
7269 "address is one page lower than the memory area that is actually created in "
7270 "the process's virtual address space. Touching an address in the \"guard\" "
7271 "page below the mapping will cause the mapping to grow by a page. This "
7272 "growth can be repeated until the mapping grows to within a page of the high "
7273 "end of the next lower mapping, at which point touching the \"guard\" page "
7274 "will result in a B<SIGSEGV> signal."
7278 #: build/C/man2/mmap.2:311
7280 msgid "B<MAP_HUGETLB> (since Linux 2.6.32)"
7281 msgstr "B<MAP_HUGETLB> (Linux 2.6.32 以降)"
7284 #: build/C/man2/mmap.2:317
7287 #| "Allocate the mapping using \"huge pages.\" See the Linux kernel source "
7288 #| "file I<Documentation/vm/hugetlbpage.txt> for further information."
7290 "Allocate the mapping using \"huge pages.\" See the Linux kernel source file "
7291 "I<Documentation/admin-guide/mm/hugetlbpage.rst> for further information, as "
7292 "well as NOTES, below."
7294 "\"huge page\" を使ってマッピングを割り当てる。詳しい情報は、Linux カーネル"
7295 "ソースの I<Documentation/vm/hugetlbpage.txt> を参照。"
7298 #: build/C/man2/mmap.2:317
7300 #| msgid "B<MADV_HUGEPAGE> (since Linux 2.6.38)"
7301 msgid "B<MAP_HUGE_2MB>, B<MAP_HUGE_1GB> (since Linux 3.8)"
7302 msgstr "B<MADV_HUGEPAGE> (Linux 2.6.38 以降)"
7304 #. See https://lwn.net/Articles/533499/
7306 #: build/C/man2/mmap.2:324
7308 "Used in conjunction with B<MAP_HUGETLB> to select alternative hugetlb page "
7309 "sizes (respectively, 2\\ MB and 1\\ GB) on systems that support multiple "
7310 "hugetlb page sizes."
7314 #: build/C/man2/mmap.2:334
7316 "More generally, the desired huge page size can be configured by encoding the "
7317 "base-2 logarithm of the desired page size in the six bits at the offset "
7318 "B<MAP_HUGE_SHIFT>. (A value of zero in this bit field provides the default "
7319 "huge page size; the default huge page size can be discovered via the "
7320 "I<Hugepagesize> field exposed by I</proc/meminfo>.) Thus, the above two "
7321 "constants are defined as:"
7325 #: build/C/man2/mmap.2:339
7328 "#define MAP_HUGE_2MB (21 E<lt>E<lt> MAP_HUGE_SHIFT)\n"
7329 "#define MAP_HUGE_1GB (30 E<lt>E<lt> MAP_HUGE_SHIFT)\n"
7333 #: build/C/man2/mmap.2:345
7335 "The range of huge page sizes that are supported by the system can be "
7336 "discovered by listing the subdirectories in I</sys/kernel/mm/hugepages>."
7340 #: build/C/man2/mmap.2:345
7342 msgid "B<MAP_LOCKED> (since Linux 2.5.37)"
7343 msgstr "B<MAP_LOCKED> (Linux 2.5.37 以降)"
7345 #. If set, the mapped pages will not be swapped out.
7347 #: build/C/man2/mmap.2:366
7349 "Mark the mapped region to be locked in the same way as B<mlock>(2). This "
7350 "implementation will try to populate (prefault) the whole range but the "
7351 "B<mmap>() call doesn't fail with B<ENOMEM> if this fails. Therefore major "
7352 "faults might happen later on. So the semantic is not as strong as "
7353 "B<mlock>(2). One should use B<mmap>() plus B<mlock>(2) when major faults "
7354 "are not acceptable after the initialization of the mapping. The "
7355 "B<MAP_LOCKED> flag is ignored in older kernels."
7359 #: build/C/man2/mmap.2:366
7361 msgid "B<MAP_NONBLOCK> (since Linux 2.5.46)"
7362 msgstr "B<MAP_NONBLOCK> (Linux 2.5.46 以降)"
7364 #. commit 54cb8821de07f2ffcd28c380ce9b93d5784b40d7
7366 #: build/C/man2/mmap.2:383
7369 #| "Only meaningful in conjunction with B<MAP_POPULATE>. Don't perform read-"
7370 #| "ahead: create page tables entries only for pages that are already present "
7371 #| "in RAM. Since Linux 2.6.23, this flag causes B<MAP_POPULATE> to do "
7372 #| "nothing. One day the combination of B<MAP_POPULATE> and B<MAP_NONBLOCK> "
7373 #| "may be reimplemented."
7375 "This flag is meaningful only in conjunction with B<MAP_POPULATE>. Don't "
7376 "perform read-ahead: create page tables entries only for pages that are "
7377 "already present in RAM. Since Linux 2.6.23, this flag causes "
7378 "B<MAP_POPULATE> to do nothing. One day, the combination of B<MAP_POPULATE> "
7379 "and B<MAP_NONBLOCK> may be reimplemented."
7381 "B<MAP_POPULATE> と組み合わせた場合のみ意味を持つ。 read-ahead (前もって読み込"
7382 "むこと) を実行しない。 単に、すでに RAM 上に存在するページに対してのみページ"
7383 "テーブルエントリーを作成する。 Linux 2.6.23 以降では、このフラグは "
7384 "B<MAP_POPULATE> に何の影響も与えない。 いつか B<MAP_POPULATE> と "
7385 "B<MAP_NONBLOCK> を組み合わせた場合の動作は実装し直されるかもしれない。"
7388 #: build/C/man2/mmap.2:383
7390 msgid "B<MAP_NORESERVE>"
7391 msgstr "B<MAP_NORESERVE>"
7394 #: build/C/man2/mmap.2:398
7396 "Do not reserve swap space for this mapping. When swap space is reserved, "
7397 "one has the guarantee that it is possible to modify the mapping. When swap "
7398 "space is not reserved one might get B<SIGSEGV> upon a write if no physical "
7399 "memory is available. See also the discussion of the file I</proc/sys/vm/"
7400 "overcommit_memory> in B<proc>(5). In kernels before 2.6, this flag had "
7401 "effect only for private writable mappings."
7403 "このマッピングに対するスワップ空間の予約を行わない。 スワップ空間を予約した場"
7404 "合は、このマッピングの変更が必ず可能なことが 保証される。予約を行わなかった場"
7405 "合、物理メモリーに空きがないと 書き込み時に B<SIGSEGV> エラーを受け取ることが"
7406 "ある。 B<proc>(5) の I</proc/sys/vm/overcommit_memory> ファイルについての議"
7407 "論も参照。 バージョン 2.6 より前のカーネルでは、このフラグは書き込み可能な プ"
7408 "ライベートマッピングについてのみ効果があった。"
7411 #: build/C/man2/mmap.2:398
7413 msgid "B<MAP_POPULATE> (since Linux 2.5.46)"
7414 msgstr "B<MAP_POPULATE> (Linux 2.5.46 以降)"
7417 #: build/C/man2/mmap.2:405
7420 #| "Populate (prefault) page tables for a mapping. For a file mapping, this "
7421 #| "causes read-ahead on the file. Later accesses to the mapping will not be "
7422 #| "blocked by page faults. B<MAP_POPULATE> is supported for private "
7423 #| "mappings only since Linux 2.6.23."
7425 "Populate (prefault) page tables for a mapping. For a file mapping, this "
7426 "causes read-ahead on the file. This will help to reduce blocking on page "
7427 "faults later. B<MAP_POPULATE> is supported for private mappings only since "
7430 "マッピング用のページテーブルを配置 (populate) する ファイルマッピングの場合に"
7431 "は、これによりファイルが先読み (read-ahead) が行われる。この以後は、マッピン"
7432 "グに対するアクセスがページフォールトで ブロックされることがなくなる。 Linux "
7433 "2.6.23 以降でのみプライベートマッピングについて B<MAP_POPULATE> がサポートさ"
7437 #: build/C/man2/mmap.2:405
7439 msgid "B<MAP_STACK> (since Linux 2.6.27)"
7440 msgstr "B<MAP_STACK> (Linux 2.6.27 以降)"
7443 #: build/C/man2/mmap.2:409
7445 "Allocate the mapping at an address suitable for a process or thread stack."
7448 #. See http://lwn.net/Articles/294642 "Tangled up in threads", 19 Aug 08
7449 #. commit cd98a04a59e2f94fa64d5bf1e26498d27427d5e7
7450 #. http://thread.gmane.org/gmane.linux.kernel/720412
7451 #. "pthread_create() slow for many threads; also time to revisit 64b
7452 #. context switch optimization?"
7454 #: build/C/man2/mmap.2:425
7456 "This flag is currently a no-op on Linux. However, by employing this flag, "
7457 "applications can ensure that they transparently obtain support if the flag "
7458 "is implemented in the future. Thus, it is used in the glibc threading "
7459 "implementation to allow for the fact that some architectures may (later) "
7460 "require special treatment for stack allocations. A further reason to employ "
7461 "this flag is portability: B<MAP_STACK> exists (and has an effect) on some "
7462 "other systems (e.g., some of the BSDs)."
7466 #: build/C/man2/mmap.2:425
7468 #| msgid "B<MAP_STACK> (since Linux 2.6.27)"
7469 msgid "B<MAP_SYNC> (since Linux 4.15)"
7470 msgstr "B<MAP_STACK> (Linux 2.6.27 以降)"
7473 #: build/C/man2/mmap.2:438
7475 "This flag is available only with the B<MAP_SHARED_VALIDATE> mapping type; "
7476 "mappings of type B<MAP_SHARED> will silently ignore this flag. This flag is "
7477 "supported only for files supporting DAX (direct mapping of persistent "
7478 "memory). For other files, creating a mapping with this flag results in an "
7479 "B<EOPNOTSUPP> error."
7483 #: build/C/man2/mmap.2:446
7485 "Shared file mappings with this flag provide the guarantee that while some "
7486 "memory is mapped writable in the address space of the process, it will be "
7487 "visible in the same file at the same offset even after the system crashes or "
7488 "is rebooted. In conjunction with the use of appropriate CPU instructions, "
7489 "this provides users of such mappings with a more efficient way of making "
7490 "data modifications persistent."
7494 #: build/C/man2/mmap.2:446
7496 msgid "B<MAP_UNINITIALIZED> (since Linux 2.6.33)"
7497 msgstr "B<MAP_UNINITIALIZED> (Linux 2.6.33 以降)"
7500 #: build/C/man2/mmap.2:456
7502 "Don't clear anonymous pages. This flag is intended to improve performance "
7503 "on embedded devices. This flag is honored only if the kernel was configured "
7504 "with the B<CONFIG_MMAP_ALLOW_UNINITIALIZED> option. Because of the security "
7505 "implications, that option is normally enabled only on embedded devices (i."
7506 "e., devices where one has complete control of the contents of user memory)."
7508 "無名ページ (anonymous page) のクリアを行わない。このフラグは組み込みデバイ"
7510 "での性能向上を目的に作られてものである。カーネルの設定で\n"
7511 "B<CONFIG_MMAP_ALLOW_UNINITIALIZED> オプションが有効になっている場合のみ、\n"
7513 "セキュリティ面の考慮から、このオプションは通常組み込みデバイス (すなわち、\n"
7514 "ユーザーメモリーの内容を完全に制御化におけるデバイス) においてのみ有効にされ"
7517 #. FIXME . for later review when Issue 8 is one day released...
7518 #. POSIX may add MAP_ANON in the future
7519 #. http://austingroupbugs.net/tag_view_page.php?tag_id=8
7520 #. http://austingroupbugs.net/view.php?id=850
7522 #: build/C/man2/mmap.2:468
7525 #| "Of the above flags, only B<MAP_FIXED> is specified in POSIX.1-2001. "
7526 #| "However, most systems also support B<MAP_ANONYMOUS> (or its synonym "
7529 "Of the above flags, only B<MAP_FIXED> is specified in POSIX.1-2001 and "
7530 "POSIX.1-2008. However, most systems also support B<MAP_ANONYMOUS> (or its "
7531 "synonym B<MAP_ANON>)."
7533 "上記のフラグの中では、 B<MAP_FIXED> だけが POSIX.1-2001 で規定されている。 し"
7534 "かしながら、ほとんどのシステムで B<MAP_ANONYMOUS> (またはその同義語である "
7535 "B<MAP_ANON>) もサポートされている。"
7538 #: build/C/man2/mmap.2:468
7544 #: build/C/man2/mmap.2:478
7546 "The B<munmap>() system call deletes the mappings for the specified address "
7547 "range, and causes further references to addresses within the range to "
7548 "generate invalid memory references. The region is also automatically "
7549 "unmapped when the process is terminated. On the other hand, closing the "
7550 "file descriptor does not unmap the region."
7552 "システムコール B<munmap>() は指定されたアドレス範囲のマップを消去し、 これ以"
7553 "降のその範囲内へのメモリー参照は不正となる。 この領域は、プロセスが終了したと"
7554 "きにも自動的にアンマップされる。 一方、ファイルディスクリプターをクローズして"
7558 #: build/C/man2/mmap.2:490
7561 #| "The address I<addr> must be a multiple of the page size. All pages "
7562 #| "containing a part of the indicated range are unmapped, and subsequent "
7563 #| "references to these pages will generate B<SIGSEGV>. It is not an error "
7564 #| "if the indicated range does not contain any mapped pages."
7566 "The address I<addr> must be a multiple of the page size (but I<length> need "
7567 "not be). All pages containing a part of the indicated range are unmapped, "
7568 "and subsequent references to these pages will generate B<SIGSEGV>. It is "
7569 "not an error if the indicated range does not contain any mapped pages."
7571 "I<addr> アドレスはページサイズの整数倍でなければならない。指定された範囲の一"
7572 "部分を 含む全てのページはアンマップされ、これ以降にこれらのページへの参照があ"
7573 "ると B<SIGSEGV> が発生する。 指定した範囲内にマップされたページが一つも含まれ"
7574 "ていない場合でも エラーにならない。"
7577 #: build/C/man2/mmap.2:501
7580 #| "On success B<mremap>() returns a pointer to the new virtual memory "
7581 #| "area. On error, the value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is "
7582 #| "returned, and I<errno> is set appropriately."
7584 "On success, B<mmap>() returns a pointer to the mapped area. On error, the "
7585 "value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is returned, and I<errno> "
7586 "is set to indicate the cause of the error."
7588 "成功した場合は B<mremap>() は新しい仮想メモリー領域へのポインターを返す。 エ"
7589 "ラーの場合は B<MAP_FAILED> (すなわち I<(void\\ *)\\ -1>) が返され、 I<errno> "
7593 #: build/C/man2/mmap.2:509
7596 #| "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> "
7597 #| "is set to indicate the cause of the error."
7599 "On success, B<munmap>() returns 0. On failure, it returns -1, and I<errno> "
7600 "is set to indicate the cause of the error (probably to B<EINVAL>)."
7602 "B<shmdt>() は、成功すると 0 を返す。 エラーの場合、-1 を返し、 I<errno> にエ"
7606 #: build/C/man2/mmap.2:528
7608 "A file descriptor refers to a non-regular file. Or a file mapping was "
7609 "requested, but I<fd> is not open for reading. Or B<MAP_SHARED> was "
7610 "requested and B<PROT_WRITE> is set, but I<fd> is not open in read/write "
7611 "(B<O_RDWR>) mode. Or B<PROT_WRITE> is set, but the file is append-only."
7613 "以下のいずれかの場合。 ファイルディスクリプターの参照先が通常のファイルではな"
7614 "い (non-regular file) 。 ファイルマッピングを要求したが I<fd> は読み込み用に"
7615 "オープンされていない。 B<MAP_SHARED> を要求して B<PROT_WRITE> をセットしたが "
7616 "I<fd> は読み書きモード (B<O_RDWR>) でオープンされていない、 B<PROT_WRITE> を"
7617 "セットしたが、ファイルは追加 (append) 専用である。"
7620 #: build/C/man2/mmap.2:532
7622 "The file has been locked, or too much memory has been locked (see "
7625 "ファイルがロックされている。またはロックされているメモリーが多すぎる "
7626 "(B<setrlimit>(2) を参照)。"
7629 #: build/C/man2/mmap.2:538
7631 "I<fd> is not a valid file descriptor (and B<MAP_ANONYMOUS> was not set)."
7633 "I<fd> が有効なファイルディスクリプター (file descriptor) ではない (かつ "
7634 "B<MAP_ANONYMOUS> がセットされていない)。"
7637 #: build/C/man2/mmap.2:538 build/C/man3/shm_open.3:201
7638 #: build/C/man2/shmget.2:230
7644 #: build/C/man2/mmap.2:548
7646 "B<MAP_FIXED_NOREPLACE> was specified in I<flags>, and the range covered by "
7647 "I<addr> and I<length> clashes with an existing mapping."
7651 #: build/C/man2/mmap.2:556
7653 "We don't like I<addr>, I<length>, or I<offset> (e.g., they are too large, or "
7654 "not aligned on a page boundary)."
7656 "I<addr> か I<length> か I<offset> が適切でない (例えば、大きすぎるとか、ペー"
7657 "ジ境界にアラインメントされていない)。"
7660 #: build/C/man2/mmap.2:561
7661 msgid "(since Linux 2.6.12) I<length> was 0."
7662 msgstr "(Linux 2.6.12 以降) I<length> が 0 であった。"
7665 #: build/C/man2/mmap.2:569
7668 #| "I<flags> contained neither B<MAP_PRIVATE> or B<MAP_SHARED>, or contained "
7669 #| "both of these values."
7671 "I<flags> contained none of B<MAP_PRIVATE>, B<MAP_SHARED> or "
7672 "B<MAP_SHARED_VALIDATE>."
7674 "I<flags> に B<MAP_PRIVATE> と B<MAP_SHARED> のどちらも含まれていなかった、も"
7678 #: build/C/man2/mmap.2:569 build/C/man3/shm_open.3:228
7679 #: build/C/man2/shmget.2:253 build/C/man2/memfd_create.2:193
7685 #: build/C/man2/mmap.2:577 build/C/man3/shm_open.3:231
7686 #: build/C/man2/shmget.2:257 build/C/man2/memfd_create.2:196
7688 "The system-wide limit on the total number of open files has been reached."
7689 msgstr "システム全体でオープンされているファイルの総数が上限に達した。"
7692 #: build/C/man2/mmap.2:581
7694 "The underlying filesystem of the specified file does not support memory "
7697 "指定されたファイルが置かれているファイルシステムがメモリーマッピングをサポー"
7701 #: build/C/man2/mmap.2:584
7702 msgid "No memory is available."
7706 #: build/C/man2/mmap.2:592
7708 "The process's maximum number of mappings would have been exceeded. This "
7709 "error can also occur for B<munmap>(), when unmapping a region in the middle "
7710 "of an existing mapping, since this results in two smaller mappings on either "
7711 "side of the region being unmapped."
7715 #: build/C/man2/mmap.2:600
7717 "(since Linux 4.7) The process's B<RLIMIT_DATA> limit, described in "
7718 "B<getrlimit>(2), would have been exceeded."
7722 #: build/C/man2/mmap.2:600 build/C/man2/shmctl.2:433
7724 msgid "B<EOVERFLOW>"
7725 msgstr "B<EOVERFLOW>"
7728 #: build/C/man2/mmap.2:612
7730 "On 32-bit architecture together with the large file extension (i.e., using "
7731 "64-bit I<off_t>): the number of pages used for I<length> plus number of "
7732 "pages used for I<offset> would overflow I<unsigned long> (32 bits)."
7734 "32 ビットアーキテクチャーで large file 拡張を使っている場合 (つまり 64 ビット"
7735 "の I<off_t> を使う場合)、 I<length> で使うページ数と I<offset> で使うページ数"
7736 "を足した値は I<unsigned long> (32 ビット) を超えてしまう (オーバーフローして"
7739 #. (Since 2.4.25 / 2.6.0.)
7741 #: build/C/man2/mmap.2:621
7743 "The I<prot> argument asks for B<PROT_EXEC> but the mapped area belongs to a "
7744 "file on a filesystem that was mounted no-exec."
7746 "I<prot> 引き数は B<PROT_EXEC> を行うように指定されているが、 no-exec でマウン"
7747 "トされたファイルシステム上のファイルに マップ領域が対応している。"
7750 #: build/C/man2/mmap.2:631
7752 "B<MAP_DENYWRITE> was set but the object specified by I<fd> is open for "
7755 "B<MAP_DENYWRITE> がセットされているが I<fd> で指定されているオブジェクトは書"
7759 #: build/C/man2/mmap.2:633
7760 msgid "Use of a mapped region can result in these signals:"
7761 msgstr "マップ領域を利用する際に、以下のシグナルが発生することがある:"
7764 #: build/C/man2/mmap.2:633
7770 #: build/C/man2/mmap.2:636
7771 msgid "Attempted write into a region mapped as read-only."
7772 msgstr "読み込み専用で mmap された領域へ書き込みを行おうとした。"
7775 #: build/C/man2/mmap.2:636
7781 #: build/C/man2/mmap.2:643
7783 "Attempted access to a page of the buffer that lies beyond the end of the "
7784 "mapped file. For an explanation of the treatment of the bytes in the page "
7785 "that corresponds to the end of a mapped file that is not a multiple of the "
7786 "page size, see NOTES."
7790 #: build/C/man2/mmap.2:654
7792 #| msgid "B<mmap>(2), B<sysconf>(3)"
7796 msgstr "B<mmap>(2), B<sysconf>(3)"
7798 #. SVr4 documents additional error codes ENXIO and ENODEV.
7799 #. SUSv2 documents additional error codes EMFILE and EOVERFLOW.
7801 #: build/C/man2/mmap.2:660
7803 #| msgid "POSIX.1-2001, SVr4."
7804 msgid "POSIX.1-2001, POSIX.1-2008, SVr4, 4.4BSD."
7805 msgstr "POSIX.1-2001, SVr4."
7807 #. POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
7808 #. -1: unavailable, 0: ask using sysconf().
7809 #. glibc defines it to 1.
7811 #: build/C/man2/mmap.2:674
7813 "On POSIX systems on which B<mmap>(), B<msync>(2), and B<munmap>() are "
7814 "available, B<_POSIX_MAPPED_FILES> is defined in I<E<lt>unistd.hE<gt>> to a "
7815 "value greater than 0. (See also B<sysconf>(3).)"
7817 "B<mmap>(), B<msync>(2) B<munmap>() が利用可能な POSIX システムでは、 "
7818 "B<_POSIX_MAPPED_FILES> は E<lt>unistd.hE<gt> で 0 より大きな値に定義される "
7819 "(B<sysconf>(3) も参照のこと)。"
7822 #: build/C/man2/mmap.2:680
7824 "Memory mapped by B<mmap>() is preserved across B<fork>(2), with the same "
7827 "B<mmap>() によってマップされたメモリーの属性は B<fork>(2) の際に継承され"
7831 #: build/C/man2/mmap.2:690
7834 #| "A file is mapped in multiples of the page size. For a file that is not a "
7835 #| "multiple of the page size, the remaining memory is zeroed when mapped, "
7836 #| "and writes to that region are not written out to the file. The effect of "
7837 #| "changing the size of the underlying file of a mapping on the pages that "
7838 #| "correspond to added or removed regions of the file is unspecified."
7840 "A file is mapped in multiples of the page size. For a file that is not a "
7841 "multiple of the page size, the remaining bytes in the partial page at the "
7842 "end of the mapping are zeroed when mapped, and modifications to that region "
7843 "are not written out to the file. The effect of changing the size of the "
7844 "underlying file of a mapping on the pages that correspond to added or "
7845 "removed regions of the file is unspecified."
7847 "ファイルはページサイズの整数倍の領域にマップされる。サイズがページサイズの 整"
7848 "数倍でないファイルの場合、マップ時に残りの領域は 0 で埋められ、この領域へ 書"
7849 "きこみを行ってもファイルに書き出されることはない。マッピングを行った元 ファイ"
7850 "ルのサイズを変更した場合、元ファイルの追加されたり削除された領域に対応 する"
7851 "マップされたページに対してどのような影響があるかは規定されていない。"
7854 #: build/C/man2/mmap.2:703
7856 "On some hardware architectures (e.g., i386), B<PROT_WRITE> implies "
7857 "B<PROT_READ>. It is architecture dependent whether B<PROT_READ> implies "
7858 "B<PROT_EXEC> or not. Portable programs should always set B<PROT_EXEC> if "
7859 "they intend to execute code in the new mapping."
7861 "(i386 などの) いくつかのアーキテクチャーでは、 B<PROT_WRITE> をセットすると、"
7862 "暗黙のうちに B<PROT_READ> がセットされる。 B<PROT_READ> をセットした際に暗黙"
7863 "のうちに B<PROT_EXEC> がセットされるかどうかは、アーキテクチャー依存である。 "
7864 "移植性を考慮したプログラムでは、 新規にマップした領域でコードを実行したい場合"
7865 "は、常に B<PROT_EXEC> をセットすべきである。"
7868 #: build/C/man2/mmap.2:718
7870 "The portable way to create a mapping is to specify I<addr> as 0 (NULL), and "
7871 "omit B<MAP_FIXED> from I<flags>. In this case, the system chooses the "
7872 "address for the mapping; the address is chosen so as not to conflict with "
7873 "any existing mapping, and will not be 0. If the B<MAP_FIXED> flag is "
7874 "specified, and I<addr> is 0 (NULL), then the mapped address will be 0 (NULL)."
7876 "マッピングを作成する移植性のある方法は、 I<addr> に 0 (NULL) を指定し、 "
7877 "I<flags> から B<MAP_FIXED> を外すことである。 この場合、システムがマッピング"
7878 "用のアドレスの選択を行う。 アドレスは既存のマッピングと衝突しないように、 か"
7879 "つ 0 にならないように選択される。 B<MAP_FIXED> フラグが指定され、かつ "
7880 "I<addr> が 0 (NULL) の場合には、マップされるアドレスが 0 (NULL) になる。"
7883 #: build/C/man2/mmap.2:751
7886 #| "Certain I<flags> constants are defined only if either B<_BSD_SOURCE> or "
7887 #| "B<_SVID_SOURCE> is defined. (Requiring B<_GNU_SOURCE> also suffices, and "
7888 #| "requiring that macro specifically would have been more logical, since "
7889 #| "these flags are all Linux-specific.) The relevant flags are: "
7890 #| "B<MAP_32BIT>, B<MAP_ANONYMOUS> (and the synonym B<MAP_ANON>), "
7891 #| "B<MAP_DENYWRITE>, B<MAP_EXECUTABLE>, B<MAP_FILE>, B<MAP_GROWSDOWN>, "
7892 #| "B<MAP_HUGETLB>, B<MAP_LOCKED>, B<MAP_NONBLOCK>, B<MAP_NORESERVE>, "
7893 #| "B<MAP_POPULATE>, and B<MAP_STACK>."
7895 "Certain I<flags> constants are defined only if suitable feature test macros "
7896 "are defined (possibly by default): B<_DEFAULT_SOURCE> with glibc 2.19 or "
7897 "later; or B<_BSD_SOURCE> or B<_SVID_SOURCE> in glibc 2.19 and earlier. "
7898 "(Employing B<_GNU_SOURCE> also suffices, and requiring that macro "
7899 "specifically would have been more logical, since these flags are all Linux-"
7900 "specific.) The relevant flags are: B<MAP_32BIT>, B<MAP_ANONYMOUS> (and the "
7901 "synonym B<MAP_ANON>), B<MAP_DENYWRITE>, B<MAP_EXECUTABLE>, B<MAP_FILE>, "
7902 "B<MAP_GROWSDOWN>, B<MAP_HUGETLB>, B<MAP_LOCKED>, B<MAP_NONBLOCK>, "
7903 "B<MAP_NORESERVE>, B<MAP_POPULATE>, and B<MAP_STACK>."
7905 "特定の I<flags> 定数は B<_BSD_SOURCE> か B<_SVID_SOURCE> のいずれかが定義され"
7906 "た場合にのみ定義される。 (B<_GNU_SOURCE> も定義されている必要がある。これらの"
7907 "フラグはすべて Linux 固有のものなので、 特に B<_GNU_SOURCE> を必要とする点は"
7908 "もっと論理的に決められるべきであった。) 関係するフラグは B<MAP_32BIT>, "
7909 "B<MAP_ANONYMOUS> (とその同義語の B<MAP_ANON>), B<MAP_DENYWRITE>, "
7910 "B<MAP_EXECUTABLE>, B<MAP_FILE>, B<MAP_GROWSDOWN>, B<MAP_HUGETLB>, "
7911 "B<MAP_LOCKED>, B<MAP_NONBLOCK>, B<MAP_NORESERVE>, B<MAP_POPULATE>, "
7915 #: build/C/man2/mmap.2:756
7917 "An application can determine which pages of a mapping are currently resident "
7918 "in the buffer/page cache using B<mincore>(2)."
7922 #: build/C/man2/mmap.2:756
7924 msgid "Using MAP_FIXED safely"
7928 #: build/C/man2/mmap.2:768
7930 "The only safe use for B<MAP_FIXED> is where the address range specified by "
7931 "I<addr> and I<length> was previously reserved using another mapping; "
7932 "otherwise, the use of B<MAP_FIXED> is hazardous because it forcibly removes "
7933 "preexisting mappings, making it easy for a multithreaded process to corrupt "
7934 "its own address space."
7938 #: build/C/man2/mmap.2:796
7940 "For example, suppose that thread A looks through I</proc/E<lt>pidE<gt>/maps> "
7941 "in order to locate an unused address range that it can map using "
7942 "B<MAP_FIXED>, while thread B simultaneously acquires part or all of that "
7943 "same address range. When thread A subsequently employs B<mmap(MAP_FIXED)>, "
7944 "it will effectively clobber the mapping that thread B created. In this "
7945 "scenario, thread B need not create a mapping directly; simply making a "
7946 "library call that, internally, uses B<dlopen>(3) to load some other shared "
7947 "library, will suffice. The B<dlopen>(3) call will map the library into the "
7948 "process's address space. Furthermore, almost any library call may be "
7949 "implemented in a way that adds memory mappings to the address space, either "
7950 "with this technique, or by simply allocating memory. Examples include "
7951 "B<brk>(2), B<malloc>(3), B<pthread_create>(3), and the PAM libraries E<.UR "
7952 "http://www.linux-pam.org> E<.UE .>"
7956 #: build/C/man2/mmap.2:803
7958 "Since Linux 4.17, a multithreaded program can use the B<MAP_FIXED_NOREPLACE> "
7959 "flag to avoid the hazard described above when attempting to create a mapping "
7960 "at a fixed address that has not been reserved by a preexisting mapping."
7964 #: build/C/man2/mmap.2:803
7966 msgid "Timestamps changes for file-backed mappings"
7967 msgstr "ファイルと関連付けられたマッピングに対するタイムスタンプの更新"
7970 #: build/C/man2/mmap.2:810
7972 "For file-backed mappings, the I<st_atime> field for the mapped file may be "
7973 "updated at any time between the B<mmap>() and the corresponding unmapping; "
7974 "the first reference to a mapped page will update the field if it has not "
7977 "ファイルと関連付けられたマッピングの場合、マッピングされたファイルの "
7978 "I<st_atime> フィールドは、 B<mmap>() されてからアンマップ (unmap) されるまで"
7979 "の間に更新されることがある。 それまでに更新が行われていなければ、マップされた"
7980 "ページへの最初の参照があった 際に更新される。"
7983 #: build/C/man2/mmap.2:828
7985 "The I<st_ctime> and I<st_mtime> field for a file mapped with B<PROT_WRITE> "
7986 "and B<MAP_SHARED> will be updated after a write to the mapped region, and "
7987 "before a subsequent B<msync>(2) with the B<MS_SYNC> or B<MS_ASYNC> flag, if "
7990 "B<PROT_WRITE> と B<MAP_SHARED> の両方を指定してマップされたファイルの場合、書"
7991 "き込みがあると、 I<st_ctime> と I<st_mtime> の両フィールドは、マップされた領"
7992 "域への書き込みより後で、 B<MS_SYNC> または B<MS_ASYNC> フラグを指定して "
7993 "B<msync>(2) が呼ばれる前までに更新される。"
7996 #: build/C/man2/mmap.2:828
7998 msgid "Huge page (Huge TLB) mappings"
8002 #: build/C/man2/mmap.2:835
8004 "For mappings that employ huge pages, the requirements for the arguments of "
8005 "B<mmap>() and B<munmap>() differ somewhat from the requirements for "
8006 "mappings that use the native system page size."
8010 #: build/C/man2/mmap.2:843
8012 "For B<mmap>(), I<offset> must be a multiple of the underlying huge page "
8013 "size. The system automatically aligns I<length> to be a multiple of the "
8014 "underlying huge page size."
8018 #: build/C/man2/mmap.2:851
8020 "For B<munmap>(), I<addr>, and I<length> must both be a multiple of the "
8021 "underlying huge page size."
8025 #: build/C/man2/mmap.2:851 build/C/man2/posix_fadvise.2:189
8027 #| msgid "C library/kernel ABI differences"
8028 msgid "C library/kernel differences"
8029 msgstr "C ライブラリとカーネル ABI の違い"
8031 #. Since around glibc 2.1/2.2, depending on the platform.
8033 #: build/C/man2/mmap.2:866
8035 "This page describes the interface provided by the glibc B<mmap>() wrapper "
8036 "function. Originally, this function invoked a system call of the same "
8037 "name. Since kernel 2.4, that system call has been superseded by "
8038 "B<mmap2>(2), and nowadays the glibc B<mmap>() wrapper function invokes "
8039 "B<mmap2>(2) with a suitably adjusted value for I<offset>."
8041 "このページでは glibc の B<mmap>() のラッパー関数が提供するインターフェース"
8043 "ついて説明している。元々は、この関数は同じ名前のシステムコールを起動してい"
8045 "カーネル 2.4 以降、このシステムコールは B<mmap2>(2) に取って代わられ、現在\n"
8046 "では、 glibc の B<mmap>() のラッパー関数は I<offset> を適切に調整してから\n"
8047 "B<mmap2>(2) を起動する。"
8050 #: build/C/man2/mmap.2:871
8053 #| "On Linux there are no guarantees like those suggested above under "
8054 #| "B<MAP_NORESERVE>. By default, any process can be killed at any moment "
8055 #| "when the system runs out of memory."
8057 "On Linux, there are no guarantees like those suggested above under "
8058 "B<MAP_NORESERVE>. By default, any process can be killed at any moment when "
8059 "the system runs out of memory."
8061 "Linux においては、上記の B<MAP_NORESERVE> で述べられているような保証はない。 "
8062 "デフォルトでは、システムがメモリーを使い切った場合には、 どのプロセスがいつ強"
8063 "制終了されるか分からないからである。"
8066 #: build/C/man2/mmap.2:878
8068 "In kernels before 2.6.7, the B<MAP_POPULATE> flag has effect only if I<prot> "
8069 "is specified as B<PROT_NONE>."
8071 "2.6.7 より前のカーネルでは、 I<prot> に B<PROT_NONE> が指定された場合にの"
8072 "み、 B<MAP_POPULATE> フラグが効力を持つ。"
8075 #: build/C/man2/mmap.2:893
8077 "SUSv3 specifies that B<mmap>() should fail if I<length> is 0. However, in "
8078 "kernels before 2.6.12, B<mmap>() succeeded in this case: no mapping was "
8079 "created and the call returned I<addr>. Since kernel 2.6.12, B<mmap>() "
8080 "fails with the error B<EINVAL> for this case."
8082 "SUSv3 では、 I<length> が 0 の場合、 B<mmap>() は失敗すると規定されている。"
8083 "しかしながら、2.6.12 より前のカーネルでは、 この場合に B<mmap>() は成功して"
8084 "いた (マッピングは作成されず、 I<addr> が返されていた)。 カーネル 2.6.12 以降"
8085 "では、 B<mmap>() はエラー B<EINVAL> で失敗する。"
8088 #: build/C/man2/mmap.2:910
8091 #| "POSIX specifies that the system shall always zero fill any partial page "
8092 #| "at the end of the object and that system will never write any "
8093 #| "modification of the object beyond its end. On Linux, when you write data "
8094 #| "to such partial page after the end of the object, the data stays in the "
8095 #| "page cache even after the file is closed and unmapped and even though the "
8096 #| "data is never written to the file itself, subsequent mappings may see the "
8097 #| "modified content. In some cases, this could be fixed by calling "
8098 #| "B<msync>(2) before the unmap takes place; however, this doesn't work on "
8099 #| "tmpfs (for example, when using POSIX shared memory interface documented "
8100 #| "in B<shm_overview>(7))."
8102 "POSIX specifies that the system shall always zero fill any partial page at "
8103 "the end of the object and that system will never write any modification of "
8104 "the object beyond its end. On Linux, when you write data to such partial "
8105 "page after the end of the object, the data stays in the page cache even "
8106 "after the file is closed and unmapped and even though the data is never "
8107 "written to the file itself, subsequent mappings may see the modified "
8108 "content. In some cases, this could be fixed by calling B<msync>(2) before "
8109 "the unmap takes place; however, this doesn't work on B<tmpfs>(5) (for "
8110 "example, when using the POSIX shared memory interface documented in "
8111 "B<shm_overview>(7))."
8113 "POSIX では、 システムはオブジェクト末尾の部分ページを常に 0 で埋め、 末尾より"
8114 "後ろのオブジェクトを決して変更してはならない、と規定している。 Linux では、 "
8115 "オブジェクト末尾より後ろの部分ページにデータを書き込んだ場合、 そのファイルを"
8116 "クローズしてアンマップした後であってもページキャッシュにデータが残り続け、 "
8117 "データがファイル自体に書き込まれていなくても、 それ以降のマッピングで変更され"
8118 "た内容が見える可能性がある。 いくつかの場合では、 アンマップを行う前に "
8119 "B<msync>(2) を呼び出すことで、 この状況を修正することができる。 しかし、 これ"
8120 "は tmpfs では機能しない (例えば、 B<shm_overview>(7) で説明されている POSIX "
8121 "共有メモリーインターフェースを使った場合)。"
8123 #. FIXME . Add an example here that uses an anonymous shared region for
8124 #. IPC between parent and child.
8126 #: build/C/man2/mmap.2:921
8128 "The following program prints part of the file specified in its first command-"
8129 "line argument to standard output. The range of bytes to be printed is "
8130 "specified via offset and length values in the second and third command-line "
8131 "arguments. The program creates a memory mapping of the required pages of "
8132 "the file and then uses B<write>(2) to output the desired bytes."
8134 "以下のプログラムは、一番目のコマンドライン引き数で指定された ファイルの一部を"
8135 "標準出力に表示する。 表示する範囲は、二番目、三番目のコマンドライン引き数で渡"
8136 "される オフセットと長さで指定される。 このプログラムは、指定されたファイルの"
8137 "必要なページのメモリー マッピングを作成し、 B<write>(2) を使って所望のバイト"
8141 #: build/C/man2/mmap.2:929
8144 "#include E<lt>sys/mman.hE<gt>\n"
8145 "#include E<lt>sys/stat.hE<gt>\n"
8146 "#include E<lt>fcntl.hE<gt>\n"
8147 "#include E<lt>stdio.hE<gt>\n"
8148 "#include E<lt>stdlib.hE<gt>\n"
8149 "#include E<lt>unistd.hE<gt>\n"
8151 "#include E<lt>sys/mman.hE<gt>\n"
8152 "#include E<lt>sys/stat.hE<gt>\n"
8153 "#include E<lt>fcntl.hE<gt>\n"
8154 "#include E<lt>stdio.hE<gt>\n"
8155 "#include E<lt>stdlib.hE<gt>\n"
8156 "#include E<lt>unistd.hE<gt>\n"
8159 #: build/C/man2/mmap.2:932 build/C/man2/mprotect.2:317
8162 "#define handle_error(msg) \\e\n"
8163 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
8165 "#define handle_error(msg) \\e\n"
8166 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
8169 #: build/C/man2/mmap.2:942
8173 "main(int argc, char *argv[])\n"
8177 " struct stat sb;\n"
8178 " off_t offset, pa_offset;\n"
8183 "main(int argc, char *argv[])\n"
8187 " struct stat sb;\n"
8188 " off_t offset, pa_offset;\n"
8193 #: build/C/man2/mmap.2:947
8196 " if (argc E<lt> 3 || argc E<gt> 4) {\n"
8197 " fprintf(stderr, \"%s file offset [length]\\en\", argv[0]);\n"
8198 " exit(EXIT_FAILURE);\n"
8201 " if (argc E<lt> 3 || argc E<gt> 4) {\n"
8202 " fprintf(stderr, \"%s file offset [length]\\en\", argv[0]);\n"
8203 " exit(EXIT_FAILURE);\n"
8207 #: build/C/man2/mmap.2:951
8210 " fd = open(argv[1], O_RDONLY);\n"
8212 " handle_error(\"open\");\n"
8214 " fd = open(argv[1], O_RDONLY);\n"
8216 " handle_error(\"open\");\n"
8219 #: build/C/man2/mmap.2:954
8222 " if (fstat(fd, &sb) == -1) /* To obtain file size */\n"
8223 " handle_error(\"fstat\");\n"
8225 " if (fstat(fd, &sb) == -1) /* To obtain file size */\n"
8226 " handle_error(\"fstat\");\n"
8229 #: build/C/man2/mmap.2:958
8232 #| " offset = atoi(argv[2]);\n"
8233 #| " pa_offset = offset & ~(sysconf(_SC_PAGE_SIZE) - 1);\n"
8234 #| " /* offset for mmap() must be page aligned */\n"
8236 " offset = atoi(argv[2]);\n"
8237 " pa_offset = offset & \\(ti(sysconf(_SC_PAGE_SIZE) - 1);\n"
8238 " /* offset for mmap() must be page aligned */\n"
8240 " offset = atoi(argv[2]);\n"
8241 " pa_offset = offset & ~(sysconf(_SC_PAGE_SIZE) - 1);\n"
8242 " /* offset for mmap() must be page aligned */\n"
8245 #: build/C/man2/mmap.2:963
8248 " if (offset E<gt>= sb.st_size) {\n"
8249 " fprintf(stderr, \"offset is past end of file\\en\");\n"
8250 " exit(EXIT_FAILURE);\n"
8253 " if (offset E<gt>= sb.st_size) {\n"
8254 " fprintf(stderr, \"offset is past end of file\\en\");\n"
8255 " exit(EXIT_FAILURE);\n"
8259 #: build/C/man2/mmap.2:969
8262 " if (argc == 4) {\n"
8263 " length = atoi(argv[3]);\n"
8264 " if (offset + length E<gt> sb.st_size)\n"
8265 " length = sb.st_size - offset;\n"
8266 " /* Can\\(aqt display bytes past end of file */\n"
8268 " if (argc == 4) {\n"
8269 " length = atoi(argv[3]);\n"
8270 " if (offset + length E<gt> sb.st_size)\n"
8271 " length = sb.st_size - offset;\n"
8272 " /* Can\\(aqt display bytes past end of file */\n"
8275 #: build/C/man2/mmap.2:973
8278 " } else { /* No length arg ==E<gt> display to end of file */\n"
8279 " length = sb.st_size - offset;\n"
8282 " } else { /* No length arg ==E<gt> display to end of file */\n"
8283 " length = sb.st_size - offset;\n"
8287 #: build/C/man2/mmap.2:978
8290 " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
8291 " MAP_PRIVATE, fd, pa_offset);\n"
8292 " if (addr == MAP_FAILED)\n"
8293 " handle_error(\"mmap\");\n"
8295 " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
8296 " MAP_PRIVATE, fd, pa_offset);\n"
8297 " if (addr == MAP_FAILED)\n"
8298 " handle_error(\"mmap\");\n"
8301 #: build/C/man2/mmap.2:983
8304 " s = write(STDOUT_FILENO, addr + offset - pa_offset, length);\n"
8305 " if (s != length) {\n"
8307 " handle_error(\"write\");\n"
8309 " s = write(STDOUT_FILENO, addr + offset - pa_offset, length);\n"
8310 " if (s != length) {\n"
8312 " handle_error(\"write\");\n"
8315 #: build/C/man2/mmap.2:987
8318 " fprintf(stderr, \"partial write\");\n"
8319 " exit(EXIT_FAILURE);\n"
8322 " fprintf(stderr, \"partial write\");\n"
8323 " exit(EXIT_FAILURE);\n"
8327 #: build/C/man2/mmap.2:990
8330 " munmap(addr, length + offset - pa_offset);\n"
8335 #: build/C/man2/mmap.2:1010
8338 #| "B<getpagesize>(2), B<memfd_create>(2), B<mincore>(2), B<mlock>(2), "
8339 #| "B<mmap2>(2), B<mprotect>(2), B<mremap>(2), B<msync>(2), "
8340 #| "B<remap_file_pages>(2), B<setrlimit>(2), B<shmat>(2), B<shm_open>(3), "
8341 #| "B<shm_overview>(7)"
8343 "B<ftruncate>(2), B<getpagesize>(2), B<memfd_create>(2), B<mincore>(2), "
8344 "B<mlock>(2), B<mmap2>(2), B<mprotect>(2), B<mremap>(2), B<msync>(2), "
8345 "B<remap_file_pages>(2), B<setrlimit>(2), B<shmat>(2), B<userfaultfd>(2), "
8346 "B<shm_open>(3), B<shm_overview>(7)"
8348 "B<getpagesize>(2), B<memfd_create>(2), B<mincore>(2), B<mlock>(2), "
8349 "B<mmap2>(2), B<mprotect>(2), B<mremap>(2), B<msync>(2), "
8350 "B<remap_file_pages>(2), B<setrlimit>(2), B<shmat>(2), B<shm_open>(3), "
8351 "B<shm_overview>(7)"
8354 #: build/C/man2/mmap.2:1017
8356 "The descriptions of the following files in B<proc>(5): I</proc/[pid]/maps>, "
8357 "I</proc/[pid]/map_files>, and I</proc/[pid]/smaps>."
8359 "B<proc>(5) の I</proc/[pid]/maps>, I</proc/[pid]/map_files>, I</proc/[pid]/"
8363 #: build/C/man2/mmap.2:1022 build/C/man2/msync.2:154
8365 #| msgid "B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391."
8366 msgid "B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128\\(en129 and 389\\(en391."
8367 msgstr "B.O. Gallmeister, POSIX.4, O'Reilly, pp. 128-129 and 389-391."
8370 #: build/C/man2/mmap2.2:29
8376 #: build/C/man2/mmap2.2:32
8377 msgid "mmap2 - map files or devices into memory"
8378 msgstr "mmap2 - ファイルやデバイスをメモリーにマップする"
8381 #: build/C/man2/mmap2.2:38
8384 "B<void *mmap2(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<,>\n"
8385 "B< int >I<flags>B<, int >I<fd>B<, off_t >I<pgoffset>B<);>\n"
8387 "B<void *mmap2(void *>I<addr>B<, size_t >I<length>B<, int >I<prot>B<,>\n"
8388 "B< int >I<flags>B<, int >I<fd>B<, off_t >I<pgoffset>B<);>\n"
8391 #: build/C/man2/mmap2.2:43
8393 "This is probably not the system call that you are interested in; instead, "
8394 "see B<mmap>(2), which describes the glibc wrapper function that invokes this "
8397 "これはおそらくあなたが興味のあるシステムコールではないだろう。代わりに\n"
8398 "B<mmap>(2) を見るとよい。そのページにはこのシステムコールを起動する glibc "
8403 #: build/C/man2/mmap2.2:54
8405 "The B<mmap2>() system call provides the same interface as B<mmap>(2), "
8406 "except that the final argument specifies the offset into the file in 4096-"
8407 "byte units (instead of bytes, as is done by B<mmap>(2)). This enables "
8408 "applications that use a 32-bit I<off_t> to map large files (up to 2^44 "
8411 "B<mmap2>() システムコールは B<mmap>(2) と同じインターフェースを提供する。た"
8413 "し、最後の引き数には、ファイルのオフセットを (B<mmap>(2) が行っている、バイ"
8415 "単位ではなく) 4096 バイトを単位として指定する。 これにより、32 ビットの\n"
8416 "I<off_t> を使うアプリケーションで (2^44 バイトまでの) 大きなファイルをマッ"
8421 #: build/C/man2/mmap2.2:61
8423 "On success, B<mmap2>() returns a pointer to the mapped area. On error, -1 "
8424 "is returned and I<errno> is set appropriately."
8426 "成功した場合、 B<mmap2>() はマップされた領域へのポインターを返す。 エラーの"
8427 "場合は -1 が返されて、 I<errno> が適切に設定される。"
8430 #: build/C/man2/mmap2.2:65
8431 msgid "Problem with getting the data from user space."
8432 msgstr "ユーザー空間からデータを取得するときに問題があった。"
8435 #: build/C/man2/mmap2.2:70
8437 "(Various platforms where the page size is not 4096 bytes.) I<offset\\ *\\ "
8438 "4096> is not a multiple of the system page size."
8440 "(ページサイズが 4096 バイトでないプラットフォームにおいて) I<offset\\ *\\ "
8441 "4096> がシステムのページサイズの倍数ではない。"
8444 #: build/C/man2/mmap2.2:74
8445 msgid "B<mmap2>() can also return any of the errors described in B<mmap>(2)."
8446 msgstr "B<mmap2>() は B<mmap>(2) に載っているエラーを返すこともある。"
8449 #: build/C/man2/mmap2.2:77
8450 msgid "B<mmap2>() is available since Linux 2.3.31."
8451 msgstr "B<mmap2>() は、Linux 2.3.31 以降で使用可能である。"
8454 #: build/C/man2/mmap2.2:79 build/C/man2/subpage_prot.2:98
8455 msgid "This system call is Linux-specific."
8456 msgstr "このシステムコールは Linux 独自である。"
8459 #: build/C/man2/mmap2.2:86
8461 "On architectures where this system call is present, the glibc B<mmap>() "
8462 "wrapper function invokes this system call rather than the B<mmap>(2) system "
8465 "このシステムコールが存在するアーキテクチャーでは、glibc の B<mmap>() のラッ"
8466 "パー関数は、 B<mmap>(2) システムコールではなく、このシステムコール "
8467 "(B<mmap2>(2)) を起動する。"
8470 #: build/C/man2/mmap2.2:88
8471 msgid "This system call does not exist on x86-64."
8472 msgstr "このシステムコールは x86-64 には存在しない。"
8474 #. ia64 can have page sizes ranging from 4 kB to 64 kB.
8475 #. On cris, it looks like the unit might also be the page size,
8476 #. which is 8192 bytes. -- mtk, June 2007
8478 #: build/C/man2/mmap2.2:95
8480 "On ia64, the unit for I<offset> is actually the system page size, rather "
8483 "ia64 では、 I<offset> の単位は、実際にはシステムのページサイズであり、 4096 "
8487 #: build/C/man2/mmap2.2:101
8489 "B<getpagesize>(2), B<mmap>(2), B<mremap>(2), B<msync>(2), B<shm_open>(3)"
8491 "B<getpagesize>(2), B<mmap>(2), B<mremap>(2), B<msync>(2), B<shm_open>(3)"
8494 #: build/C/man2/mprotect.2:33
8500 #: build/C/man2/mprotect.2:36
8502 #| msgid "mprotect - set protection on a region of memory"
8503 msgid "mprotect, pkey_mprotect - set protection on a region of memory"
8504 msgstr "mprotect - メモリー領域の保護を設定する"
8507 #: build/C/man2/mprotect.2:41
8509 msgid "B<int mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<);>\n"
8510 msgstr "B<int mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<);>\n"
8513 #: build/C/man2/mprotect.2:44 build/C/man2/pkey_alloc.2:32
8516 #| "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
8517 #| "B<#include E<lt>sys/mman.hE<gt>>\n"
8519 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
8520 "B<#include E<lt>sys/mman.hE<gt>>\n"
8522 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
8523 "B<#include E<lt>sys/mman.hE<gt>>\n"
8526 #: build/C/man2/mprotect.2:46
8528 #| msgid "B<int mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<);>\n"
8529 msgid "B<int pkey_mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<, int >I<pkey>B<);>\n"
8530 msgstr "B<int mprotect(void *>I<addr>B<, size_t >I<len>B<, int >I<prot>B<);>\n"
8533 #: build/C/man2/mprotect.2:54
8536 #| "B<mprotect>() changes protection for the calling process's memory "
8537 #| "page(s) containing any part of the address range in the interval "
8538 #| "[I<addr>,\\ I<addr>+I<len>-1]. I<addr> must be aligned to a page "
8541 "B<mprotect>() changes the access protections for the calling process's "
8542 "memory pages containing any part of the address range in the interval "
8543 "[I<addr>,\\ I<addr>+I<len>-1]. I<addr> must be aligned to a page boundary."
8545 "B<mprotect>() は、区間 [I<addr>,\\ I<addr>+I<len>-1] のアドレス範囲を含む 呼"
8546 "び出し元のプロセスのメモリーページのアクセス保護を変更する。 I<addr> はページ"
8550 #: build/C/man2/mprotect.2:59
8553 #| "If the calling process tries to access memory in a manner that violates "
8554 #| "the protection, then the kernel generates a B<SIGSEGV> signal for the "
8557 "If the calling process tries to access memory in a manner that violates the "
8558 "protections, then the kernel generates a B<SIGSEGV> signal for the process."
8560 "呼び出し元のプロセスがアクセス保護に違反するようなメモリーアクセスを 行おうと"
8561 "すると、カーネルはシグナル B<SIGSEGV> をそのプロセスに対して生成する。"
8564 #: build/C/man2/mprotect.2:64
8567 #| "I<prot> is either B<PROT_NONE> or a bitwise-or of the other values in the "
8568 #| "following list:"
8570 "I<prot> is a combination of the following access flags: B<PROT_NONE> or a "
8571 "bitwise-or of the other values in the following list:"
8573 "I<prot> には、 B<PROT_NONE> か、以下のリストの B<PROT_NONE> 以外の値をビット"
8574 "毎の論理和 (bitwize-or) で指定する:"
8577 #: build/C/man2/mprotect.2:67
8578 msgid "The memory cannot be accessed at all."
8579 msgstr "そのメモリーには全くアクセスできない。"
8582 #: build/C/man2/mprotect.2:70
8583 msgid "The memory can be read."
8584 msgstr "そのメモリーを読み取ることができる。"
8587 #: build/C/man2/mprotect.2:73
8588 msgid "The memory can be modified."
8589 msgstr "そのメモリーを変更できる。"
8592 #: build/C/man2/mprotect.2:76
8593 msgid "The memory can be executed."
8594 msgstr "そのメモリーは実行可能である。"
8597 #: build/C/man2/mprotect.2:76
8599 #| msgid "B<MAP_LOCKED> (since Linux 2.5.37)"
8600 msgid "B<PROT_SEM> (since Linux 2.5.7)"
8601 msgstr "B<MAP_LOCKED> (Linux 2.5.37 以降)"
8604 #: build/C/man2/mprotect.2:85
8606 "The memory can be used for atomic operations. This flag was introduced as "
8607 "part of the B<futex>(2) implementation (in order to guarantee the ability "
8608 "to perform atomic operations required by commands such as B<FUTEX_WAIT>), "
8609 "but is not currently used in on any architecture."
8613 #: build/C/man2/mprotect.2:85
8615 #| msgid "B<MAP_STACK> (since Linux 2.6.27)"
8616 msgid "B<PROT_SAO> (since Linux 2.6.26)"
8617 msgstr "B<MAP_STACK> (Linux 2.6.27 以降)"
8619 #. commit aba46c5027cb59d98052231b36efcbbde9c77a1d
8620 #. commit ef3d3246a0d06be622867d21af25f997aeeb105f
8622 #: build/C/man2/mprotect.2:94
8624 "The memory should have strong access ordering. This feature is specific to "
8625 "the PowerPC architecture (version 2.06 of the architecture specification "
8626 "adds the SAO CPU feature, and it is available on POWER 7 or PowerPC A2, for "
8631 #: build/C/man2/mprotect.2:98
8633 "Additionally (since Linux 2.6.0), I<prot> can have one of the following "
8638 #. vm_flags |= calc_vm_prot_bits(prot, pkey) | calc_vm_flag_bits(flags) |
8639 #. mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
8640 #. And calc_vm_flag_bits converts only GROWSDOWN/DENYWRITE/LOCKED.
8642 #: build/C/man2/mprotect.2:98
8644 #| msgid "B<PROT_READ>"
8645 msgid "B<PROT_GROWSUP>"
8646 msgstr "B<PROT_READ>"
8648 #. The VMA is one that was marked with VM_GROWSUP by the kernel
8649 #. when the stack was created. Note that (unlike VM_GROWSDOWN),
8650 #. there is no mmap() flag (analogous to MAP_GROWSDOWN) for
8651 #. creating a VMA that is marked VM_GROWSUP.
8653 #: build/C/man2/mprotect.2:113
8655 "Apply the protection mode up to the end of a mapping that grows upwards. "
8656 "(Such mappings are created for the stack area on architectures\\(emfor "
8657 "example, HP-PARISC\\(emthat have an upwardly growing stack.)"
8661 #: build/C/man2/mprotect.2:113
8663 #| msgid "B<MAP_GROWSDOWN>"
8664 msgid "B<PROT_GROWSDOWN>"
8665 msgstr "B<MAP_GROWSDOWN>"
8668 #: build/C/man2/mprotect.2:120
8670 "Apply the protection mode down to the beginning of a mapping that grows "
8671 "downward (which should be a stack segment or a segment mapped with the "
8672 "B<MAP_GROWSDOWN> flag set)."
8676 #: build/C/man2/mprotect.2:139
8678 "Like B<mprotect>(), B<pkey_mprotect>() changes the protection on the pages "
8679 "specified by I<addr> and I<len>. The I<pkey> argument specifies the "
8680 "protection key (see B<pkeys>(7)) to assign to the memory. The protection "
8681 "key must be allocated with B<pkey_alloc>(2) before it is passed to "
8682 "B<pkey_mprotect>(). For an example of the use of this system call, see "
8687 #: build/C/man2/mprotect.2:148
8690 #| "On success, B<mprotect>() returns zero. On error, -1 is returned, and "
8691 #| "I<errno> is set appropriately."
8693 "On success, B<mprotect>() and B<pkey_mprotect>() return zero. On error, "
8694 "these system calls return -1, and I<errno> is set appropriately."
8696 "成功した場合、 B<mprotect>() は 0 を返す。エラーの場合は -1 が返り、 "
8697 "I<errno> が適切に設定される。"
8700 #: build/C/man2/mprotect.2:158
8702 "The memory cannot be given the specified access. This can happen, for "
8703 "example, if you B<mmap>(2) a file to which you have read-only access, then "
8704 "ask B<mprotect>() to mark it B<PROT_WRITE>."
8706 "指定されたアクセスをメモリーに設定することができない。 これは、例えば ファイ"
8707 "ルを読み取り専用で B<mmap>(2) しており、その領域に対して B<mprotect>() を呼"
8708 "び出して B<PROT_WRITE> に設定しようとした場合に発生する。"
8711 #: build/C/man2/mprotect.2:162
8713 "I<addr> is not a valid pointer, or not a multiple of the system page size."
8715 "I<addr> が有効なポインターでないか、 システムのページサイズの倍数でない。"
8718 #: build/C/man2/mprotect.2:167
8720 "(B<pkey_mprotect>()) I<pkey> has not been allocated with B<pkey_alloc>(2)"
8724 #: build/C/man2/mprotect.2:175
8725 msgid "Both B<PROT_GROWSUP> and B<PROT_GROWSDOWN> were specified in I<prot>."
8729 #: build/C/man2/mprotect.2:179
8731 #| msgid "An invalid value was specified for I<advice>."
8732 msgid "Invalid flags specified in I<prot>."
8733 msgstr "無効な値が I<advice> に指定された。"
8736 #: build/C/man2/mprotect.2:186
8738 "(PowerPC architecture) B<PROT_SAO> was specified in I<prot>, but SAO "
8739 "hardware feature is not available."
8743 #: build/C/man2/mprotect.2:189
8744 msgid "Internal kernel structures could not be allocated."
8745 msgstr "カーネル内部の構造体を割り当てることができなかった。"
8748 #: build/C/man2/mprotect.2:199
8750 "Addresses in the range [I<addr>, I<addr>+I<len>-1] are invalid for the "
8751 "address space of the process, or specify one or more pages that are not "
8752 "mapped. (Before kernel 2.4.19, the error B<EFAULT> was incorrectly produced "
8755 "[I<addr>, I<addr>+I<len>-1] という範囲のアドレスがプロセスのアドレス空間とし"
8756 "て不正であるか、 その範囲のアドレスがマップされていない 1 つ以上のページを指"
8757 "している (カーネル 2.4.19 より前では、この状況でエラー B<EFAULT> が間違って生"
8760 #. I.e., the number of VMAs would exceed the 64 kB maximum
8762 #: build/C/man2/mprotect.2:211
8764 "Changing the protection of a memory region would result in the total number "
8765 "of mappings with distinct attributes (e.g., read versus read/write "
8766 "protection) exceeding the allowed maximum. (For example, making the "
8767 "protection of a range B<PROT_READ> in the middle of a region currently "
8768 "protected as B<PROT_READ|PROT_WRITE> would result in three mappings: two "
8769 "read/write mappings at each end and a read-only mapping in the middle.)"
8773 #: build/C/man2/mprotect.2:215
8776 #| "The B<remap_file_pages>() system call appeared in Linux 2.5.46; glibc "
8777 #| "support was added in version 2.3.3."
8779 "B<pkey_mprotect>() first appeared in Linux 4.9; library support was added "
8782 "B<remap_file_pages>() システムコールは Linux 2.5.46 で登場した。 glibc での"
8783 "サポートは glibc バージョン 2.3.3 で追加された。"
8785 #. SVr4 defines an additional error
8786 #. code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
8788 #: build/C/man2/mprotect.2:225
8791 #| "SVr4, POSIX.1-2001. POSIX says that the behavior of B<mprotect>() is "
8792 #| "unspecified if it is applied to a region of memory that was not obtained "
8793 #| "via B<mmap>(2)."
8795 "B<mprotect>(): POSIX.1-2001, POSIX.1-2008, SVr4. POSIX says that the "
8796 "behavior of B<mprotect>() is unspecified if it is applied to a region of "
8797 "memory that was not obtained via B<mmap>(2)."
8799 "SVr4, POSIX.1-2001. POSIX では、 B<mmap>(2) 経由で獲得していないメモリー領"
8800 "域に対して B<mprotect>() を行った場合の B<mprotect>() の動作は未定義である"
8804 #: build/C/man2/mprotect.2:228
8805 msgid "B<pkey_mprotect>() is a nonportable Linux extension."
8809 #: build/C/man2/mprotect.2:235
8812 #| "On Linux it is always permissible to call B<mprotect>() on any address "
8813 #| "in a process's address space (except for the kernel vsyscall area). In "
8814 #| "particular it can be used to change existing code mappings to be writable."
8816 "On Linux, it is always permissible to call B<mprotect>() on any address in "
8817 "a process's address space (except for the kernel vsyscall area). In "
8818 "particular, it can be used to change existing code mappings to be writable."
8820 "Linux では、(カーネル vsyscall 領域以外の) 任意のプロセスアドレス空間に対し"
8821 "て B<mprotect>() を呼び出すことが、常に許されている。 これは特に既存のコード"
8822 "マッピングを書き込み可能にするために使われる。"
8825 #: build/C/man2/mprotect.2:249
8828 #| "Whether B<PROT_EXEC> has any effect different from B<PROT_READ> is "
8829 #| "architecture- and kernel version-dependent. On some hardware "
8830 #| "architectures (e.g., i386), B<PROT_WRITE> implies B<PROT_READ>."
8832 "Whether B<PROT_EXEC> has any effect different from B<PROT_READ> depends on "
8833 "processor architecture, kernel version, and process state. If "
8834 "B<READ_IMPLIES_EXEC> is set in the process's personality flags (see "
8835 "B<personality>(2)), specifying B<PROT_READ> will implicitly add B<PROT_EXEC>."
8837 "B<PROT_EXEC> が B<PROT_READ> と異なる影響を持つか否かは、アーキテクチャーと"
8838 "カーネルのバージョンに依存する。 (i386 などの) いくつかのアーキテクチャーで"
8839 "は、 B<PROT_WRITE> をセットすると、暗黙のうちに B<PROT_READ> がセットされる。"
8842 #: build/C/man2/mprotect.2:254
8844 "On some hardware architectures (e.g., i386), B<PROT_WRITE> implies "
8849 #: build/C/man2/mprotect.2:263
8852 #| "POSIX.1-2001 says that an implementation may permit access other than "
8853 #| "that specified in I<prot>, but at a minimum can allow write access only "
8854 #| "if B<PROT_WRITE> has been set, and must not allow any access if "
8855 #| "B<PROT_NONE> has been set."
8857 "POSIX.1 says that an implementation may permit access other than that "
8858 "specified in I<prot>, but at a minimum can allow write access only if "
8859 "B<PROT_WRITE> has been set, and must not allow any access if B<PROT_NONE> "
8862 "POSIX.1-2001 では、 I<prot> で指定されていないアクセスを許可する実装を認めて"
8863 "いる。 ただし、最低限、 B<PROT_WRITE> がセットされている場合にのみ書き込みア"
8864 "クセスが許可され、 B<PROT_NONE> がセットされている場合にはアクセスは許可され"
8868 #: build/C/man2/mprotect.2:276
8870 "Applications should be careful when mixing use of B<mprotect>() and "
8871 "B<pkey_mprotect>(). On x86, when B<mprotect>() is used with I<prot> set to "
8872 "B<PROT_EXEC> a pkey may be allocated and set on the memory implicitly by the "
8873 "kernel, but only when the pkey was 0 previously."
8877 #: build/C/man2/mprotect.2:286
8879 "On systems that do not support protection keys in hardware, "
8880 "B<pkey_mprotect>() may still be used, but I<pkey> must be set to -1. When "
8881 "called this way, the operation of B<pkey_mprotect>() is equivalent to "
8885 #. sigaction.2 refers to this example
8887 #: build/C/man2/mprotect.2:293
8890 #| "The program below allocates four pages of memory, makes the third of "
8891 #| "these pages read-only, and then executes a loop that walks upward through "
8892 #| "the allocated region modifying bytes."
8894 "The program below demonstrates the use of B<mprotect>(). The program "
8895 "allocates four pages of memory, makes the third of these pages read-only, "
8896 "and then executes a loop that walks upward through the allocated region "
8899 "以下のプログラムは、メモリーページを 4つ確保し、そのうち 3番目のページを 読み"
8900 "込み専用に設定する。その後で、確保した領域のアドレスの小さい方から 大きな方に"
8901 "向かって順番にバイト値を変更するループを実行する。"
8904 #: build/C/man2/mprotect.2:296
8906 "An example of what we might see when running the program is the following:"
8907 msgstr "プログラムを実行した場合の一例を以下に示す。"
8910 #: build/C/man2/mprotect.2:302
8914 "Start of region: 0x804c000\n"
8915 "Got SIGSEGV at address: 0x804e000\n"
8918 "Start of region: 0x804c000\n"
8919 "Got SIGSEGV at address: 0x804e000\n"
8922 #: build/C/man2/mprotect.2:314
8925 "#include E<lt>unistd.hE<gt>\n"
8926 "#include E<lt>signal.hE<gt>\n"
8927 "#include E<lt>stdio.hE<gt>\n"
8928 "#include E<lt>malloc.hE<gt>\n"
8929 "#include E<lt>stdlib.hE<gt>\n"
8930 "#include E<lt>errno.hE<gt>\n"
8931 "#include E<lt>sys/mman.hE<gt>\n"
8933 "#include E<lt>unistd.hE<gt>\n"
8934 "#include E<lt>signal.hE<gt>\n"
8935 "#include E<lt>stdio.hE<gt>\n"
8936 "#include E<lt>malloc.hE<gt>\n"
8937 "#include E<lt>stdlib.hE<gt>\n"
8938 "#include E<lt>errno.hE<gt>\n"
8939 "#include E<lt>sys/mman.hE<gt>\n"
8942 #: build/C/man2/mprotect.2:319
8944 msgid "static char *buffer;\n"
8945 msgstr "static char *buffer;\n"
8948 #: build/C/man2/mprotect.2:328
8952 "handler(int sig, siginfo_t *si, void *unused)\n"
8954 " /* Note: calling printf() from a signal handler is not safe\n"
8955 " (and should not be done in production programs), since\n"
8956 " printf() is not async-signal-safe; see signal-safety(7).\n"
8957 " Nevertheless, we use printf() here as a simple way of\n"
8958 " showing that the handler was called. */\n"
8962 #: build/C/man2/mprotect.2:332
8966 #| "handler(int sig, siginfo_t *si, void *unused)\n"
8968 #| " printf(\"Got SIGSEGV at address: 0x%lx\\en\",\n"
8969 #| " (long) si-E<gt>si_addr);\n"
8970 #| " exit(EXIT_FAILURE);\n"
8973 " printf(\"Got SIGSEGV at address: %p\\en\", si-E<gt>si_addr);\n"
8974 " exit(EXIT_FAILURE);\n"
8978 "handler(int sig, siginfo_t *si, void *unused)\n"
8980 " printf(\"Got SIGSEGV at address: 0x%lx\\en\",\n"
8981 " (long) si-E<gt>si_addr);\n"
8982 " exit(EXIT_FAILURE);\n"
8986 #: build/C/man2/mprotect.2:338
8990 #| "main(int argc, char *argv[])\n"
8993 #| " int pagesize;\n"
8994 #| " struct sigaction sa;\n"
8997 "main(int argc, char *argv[])\n"
9000 " struct sigaction sa;\n"
9007 " struct sigaction sa;\n"
9010 #: build/C/man2/mprotect.2:344
9013 " sa.sa_flags = SA_SIGINFO;\n"
9014 " sigemptyset(&sa.sa_mask);\n"
9015 " sa.sa_sigaction = handler;\n"
9016 " if (sigaction(SIGSEGV, &sa, NULL) == -1)\n"
9017 " handle_error(\"sigaction\");\n"
9019 " sa.sa_flags = SA_SIGINFO;\n"
9020 " sigemptyset(&sa.sa_mask);\n"
9021 " sa.sa_sigaction = handler;\n"
9022 " if (sigaction(SIGSEGV, &sa, NULL) == -1)\n"
9023 " handle_error(\"sigaction\");\n"
9026 #: build/C/man2/mprotect.2:348
9029 " pagesize = sysconf(_SC_PAGE_SIZE);\n"
9030 " if (pagesize == -1)\n"
9031 " handle_error(\"sysconf\");\n"
9033 " pagesize = sysconf(_SC_PAGE_SIZE);\n"
9034 " if (pagesize == -1)\n"
9035 " handle_error(\"sysconf\");\n"
9038 #: build/C/man2/mprotect.2:351
9041 " /* Allocate a buffer aligned on a page boundary;\n"
9042 " initial protection is PROT_READ | PROT_WRITE */\n"
9044 " /* Allocate a buffer aligned on a page boundary;\n"
9045 " initial protection is PROT_READ | PROT_WRITE */\n"
9048 #: build/C/man2/mprotect.2:355
9051 " buffer = memalign(pagesize, 4 * pagesize);\n"
9052 " if (buffer == NULL)\n"
9053 " handle_error(\"memalign\");\n"
9055 " buffer = memalign(pagesize, 4 * pagesize);\n"
9056 " if (buffer == NULL)\n"
9057 " handle_error(\"memalign\");\n"
9060 #: build/C/man2/mprotect.2:357
9062 #| msgid " printf(\"Start of region: 0x%lx\\en\", (long) buffer);\n"
9063 msgid " printf(\"Start of region: %p\\en\", buffer);\n"
9064 msgstr " printf(\"Start of region: 0x%lx\\en\", (long) buffer);\n"
9067 #: build/C/man2/mprotect.2:361
9070 " if (mprotect(buffer + pagesize * 2, pagesize,\n"
9071 " PROT_READ) == -1)\n"
9072 " handle_error(\"mprotect\");\n"
9074 " if (mprotect(buffer + pagesize * 2, pagesize,\n"
9075 " PROT_READ) == -1)\n"
9076 " handle_error(\"mprotect\");\n"
9079 #: build/C/man2/mprotect.2:364
9082 #| " for (p = buffer ; ; )\n"
9083 #| " *(p++) = \\(aqa\\(aq;\n"
9085 " for (char *p = buffer ; ; )\n"
9086 " *(p++) = \\(aqa\\(aq;\n"
9088 " for (p = buffer ; ; )\n"
9089 " *(p++) = \\(aqa\\(aq;\n"
9092 #: build/C/man2/mprotect.2:368
9095 " printf(\"Loop completed\\en\"); /* Should never happen */\n"
9096 " exit(EXIT_SUCCESS);\n"
9099 " printf(\"Loop completed\\en\"); /* Should never happen */\n"
9100 " exit(EXIT_SUCCESS);\n"
9104 #: build/C/man2/mprotect.2:373
9106 #| msgid "B<mmap>(2), B<sysconf>(3)"
9107 msgid "B<mmap>(2), B<sysconf>(3), B<pkeys>(7)"
9108 msgstr "B<mmap>(2), B<sysconf>(3)"
9111 #: build/C/man2/mremap.2:30
9117 #: build/C/man2/mremap.2:33
9118 msgid "mremap - remap a virtual memory address"
9119 msgstr "mremap - 仮想メモリーアドレスを再マッピングする"
9122 #: build/C/man2/mremap.2:37 build/C/man2/remap_file_pages.2:35
9123 #: build/C/man2/memfd_create.2:28
9126 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
9127 "B<#include E<lt>sys/mman.hE<gt>>\n"
9129 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
9130 "B<#include E<lt>sys/mman.hE<gt>>\n"
9133 #: build/C/man2/mremap.2:40
9136 "B<void *mremap(void *>I<old_address>B<, size_t >I<old_size>B<,>\n"
9137 "B< size_t >I<new_size>B<, int >I<flags>B<, ... /* void *>I<new_address>B< */);>\n"
9139 "B<void *mremap(void *>I<old_address>B<, size_t >I<old_size>B<,>\n"
9140 "B< size_t >I<new_size>B<, int >I<flags>B<, ... /* void *>I<new_address>B< */);>\n"
9143 #: build/C/man2/mremap.2:46
9145 "B<mremap>() expands (or shrinks) an existing memory mapping, potentially "
9146 "moving it at the same time (controlled by the I<flags> argument and the "
9147 "available virtual address space)."
9149 "B<mremap>() は既存のメモリーマッピングの拡張 (または縮小) を行う。 同時に移"
9150 "動されることもある (I<flags> 引き数と利用可能な仮想アドレス空間によって決ま"
9154 #: build/C/man2/mremap.2:60
9156 "I<old_address> is the old address of the virtual memory block that you want "
9157 "to expand (or shrink). Note that I<old_address> has to be page aligned. "
9158 "I<old_size> is the old size of the virtual memory block. I<new_size> is the "
9159 "requested size of the virtual memory block after the resize. An optional "
9160 "fifth argument, I<new_address>, may be provided; see the description of "
9161 "B<MREMAP_FIXED> below."
9163 "I<old_address> は拡張 (または縮小) しようとする仮想メモリーブロック の元のア"
9164 "ドレスである。I<old_address> はページ境界に合っていなければ ならない点に注意"
9165 "すること。I<old_size> は元の仮想メモリーブロックの サイズである。 "
9166 "I<new_size> は要求する変更後の仮想メモリーブロックのサイズである。 5 番目の引"
9167 "き数として I<new_address> を指定することができる。下記の B<MREMAP_FIXED> の説"
9171 #: build/C/man2/mremap.2:76
9173 "If the value of I<old_size> is zero, and I<old_address> refers to a "
9174 "shareable mapping (see B<mmap>(2) B<MAP_SHARED>), then B<mremap>() will "
9175 "create a new mapping of the same pages. I<new_size> will be the size of the "
9176 "new mapping and the location of the new mapping may be specified with "
9177 "I<new_address>; see the description of B<MREMAP_FIXED> below. If a new "
9178 "mapping is requested via this method, then the B<MREMAP_MAYMOVE> flag must "
9179 "also be specified."
9183 #: build/C/man2/mremap.2:78
9186 #| "The I<flags> bit-mask argument may be 0, or include the following flag:"
9188 "The I<flags> bit-mask argument may be 0, or include the following flags:"
9189 msgstr "I<flags> ビットマスク引数は 0 または以下のフラグを含む:"
9192 #: build/C/man2/mremap.2:78
9194 msgid "B<MREMAP_MAYMOVE>"
9195 msgstr "B<MREMAP_MAYMOVE>"
9198 #: build/C/man2/mremap.2:90
9200 "By default, if there is not sufficient space to expand a mapping at its "
9201 "current location, then B<mremap>() fails. If this flag is specified, then "
9202 "the kernel is permitted to relocate the mapping to a new virtual address, if "
9203 "necessary. If the mapping is relocated, then absolute pointers into the old "
9204 "mapping location become invalid (offsets relative to the starting address of "
9205 "the mapping should be employed)."
9207 "デフォルトでは、現在の位置にマッピングを拡張するための 十分な空きがなければ "
9208 "B<mremap>() は失敗する。 このフラグが指定されると、カーネルは必要があれば"
9209 "マッピングを 新しい仮想アドレスに再配置することができる マッピングが再配置さ"
9210 "れると、古いマッピング位置への絶対ポインターは 無効になる (マッピングの開始ア"
9211 "ドレスからの相対オフセットは有効のままである)。"
9214 #: build/C/man2/mremap.2:90
9216 msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
9217 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
9220 #: build/C/man2/mremap.2:107
9223 #| "This flag serves a similar purpose to the B<MAP_FIXED> flag of "
9224 #| "B<mmap>(2). If this flag is specified, then B<mremap>() accepts a fifth "
9225 #| "argument, I<void\\ *new_address>, which specifies a page-aligned address "
9226 #| "to which the mapping must be moved. Any previous mapping at the address "
9227 #| "range specified by I<new_address> and I<new_size> is unmapped. If "
9228 #| "B<MREMAP_FIXED> is specified, then B<MREMAP_MAYMOVE> must also be "
9231 "This flag serves a similar purpose to the B<MAP_FIXED> flag of B<mmap>(2). "
9232 "If this flag is specified, then B<mremap>() accepts a fifth argument, I<void"
9233 "\\ *new_address>, which specifies a page-aligned address to which the "
9234 "mapping must be moved. Any previous mapping at the address range specified "
9235 "by I<new_address> and I<new_size> is unmapped."
9237 "このフラグは B<mmap>(2) の B<MAP_FIXED> フラグと似たような目的で用いられ"
9238 "る。 このフラグが指定されると、 B<mremap>() は 5 番目の引き数 I<void\\ "
9239 "*new_address> を受け取り、この引数はマッピングが移動されるべきアドレスを指定"
9240 "する。 このアドレスはページ境界に合っていなければならない。 I<new_address> "
9241 "と I<new_size> で指定されるアドレス範囲に過去のマッピングがあった場合、 その"
9242 "マッピングはアンマップされる (unmapped)。 B<MREMAP_FIXED> を指定した場合は、 "
9243 "B<MREMAP_MAYMOVE> も指定しなければならない。"
9246 #: build/C/man2/mremap.2:113
9248 "If B<MREMAP_FIXED> is specified, then B<MREMAP_MAYMOVE> must also be "
9253 #: build/C/man2/mremap.2:113
9255 #| msgid "B<MADV_DONTDUMP> (since Linux 3.4)"
9256 msgid "B<MREMAP_DONTUNMAP> (since Linux 5.7)"
9257 msgstr "B<MADV_DONTDUMP> (Linux 3.4 以降)"
9259 #. commit e346b3813067d4b17383f975f197a9aa28a3b077
9261 #: build/C/man2/mremap.2:120
9263 "This flag, which must be used in conjunction with B<MREMAP_MAYMOVE>, remaps "
9264 "a mapping to a new address but does not unmap the mapping at I<old_address>."
9268 #: build/C/man2/mremap.2:130
9270 "The B<MREMAP_DONTUNMAP> flag can be used only with private anonymous "
9271 "mappings (see the description of B<MAP_PRIVATE> and B<MAP_ANONYMOUS> in "
9276 #: build/C/man2/mremap.2:143
9278 "After completion, any access to the range specified by I<old_address> and "
9279 "I<old_size> will result in a page fault. The page fault will be handled by "
9280 "a B<userfaultfd>(2) handler if the address is in a range previously "
9281 "registered with B<userfaultfd>(2). Otherwise, the kernel allocates a zero-"
9282 "filled page to handle the fault."
9286 #: build/C/man2/mremap.2:150
9288 "The B<MREMAP_DONTUNMAP> flag may be used to atomically move a mapping while "
9289 "leaving the source mapped. See NOTES for some possible applications of "
9290 "B<MREMAP_DONTUNMAP>."
9294 #: build/C/man2/mremap.2:160
9296 "If the memory segment specified by I<old_address> and I<old_size> is locked "
9297 "(using B<mlock>(2) or similar), then this lock is maintained when the "
9298 "segment is resized and/or relocated. As a consequence, the amount of memory "
9299 "locked by the process may change."
9301 "I<old_address> と I<old_size> で指定されるメモリーセグメントが (B<mlock>(2) "
9302 "や同様のもので) ロックされている場合、セグメントのサイズが変わったり 再配置さ"
9303 "れたりした時にロックも維持される。 その結果、プロセスによってロックされるメモ"
9307 #: build/C/man2/mremap.2:168
9309 "On success B<mremap>() returns a pointer to the new virtual memory area. "
9310 "On error, the value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is returned, "
9311 "and I<errno> is set appropriately."
9313 "成功した場合は B<mremap>() は新しい仮想メモリー領域へのポインターを返す。 エ"
9314 "ラーの場合は B<MAP_FAILED> (すなわち I<(void\\ *)\\ -1>) が返され、 I<errno> "
9318 #: build/C/man2/mremap.2:175
9320 "The caller tried to expand a memory segment that is locked, but this was not "
9321 "possible without exceeding the B<RLIMIT_MEMLOCK> resource limit."
9323 "呼び出し元がロックされているメモリーセグメントを拡張しようとしたが、 "
9324 "B<RLIMIT_MEMLOCK> リソース制限を越えずにこれを行うことができない。"
9327 #: build/C/man2/mremap.2:184
9330 #| "\"Segmentation fault.\" Some address in the range I<old_address> to "
9331 #| "I<old_address>+I<old_size> is an invalid virtual memory address for this "
9332 #| "process. You can also get B<EFAULT> even if there exist mappings that "
9333 #| "cover the whole address space requested, but those mappings are of "
9334 #| "different types."
9336 "Some address in the range I<old_address> to I<old_address>+I<old_size> is an "
9337 "invalid virtual memory address for this process. You can also get B<EFAULT> "
9338 "even if there exist mappings that cover the whole address space requested, "
9339 "but those mappings are of different types."
9341 "「セグメンテーション違反(segmentation fault)」 I<old_address> から "
9342 "I<old_address>+I<old_size> の 範囲のアドレスのどれかがこのプロセスにおいて不"
9343 "正な仮想メモリーアドレスである。 たとえ要求したアドレス空間全体を含むような"
9344 "マッピングがあったとしても、 それらのマッピングが異なった型ならば B<EFAULT> "
9348 #: build/C/man2/mremap.2:188
9349 msgid "An invalid argument was given. Possible causes are:"
9353 #: build/C/man2/mremap.2:192
9355 #| msgid "I<addr> is not page-aligned."
9356 msgid "I<old_address> was not page aligned;"
9357 msgstr "I<addr> がページ境界ではない。"
9360 #: build/C/man2/mremap.2:201
9362 "a value other than B<MREMAP_MAYMOVE> or B<MREMAP_FIXED> or "
9363 "B<MREMAP_DONTUNMAP> was specified in I<flags>;"
9367 #: build/C/man2/mremap.2:204
9369 #| msgid "I<options> was nonzero."
9370 msgid "I<new_size> was zero;"
9371 msgstr "I<options> が 0 でなかった。"
9374 #: build/C/man2/mremap.2:209
9375 msgid "I<new_size> or I<new_address> was invalid;"
9379 #: build/C/man2/mremap.2:218
9381 "the new address range specified by I<new_address> and I<new_size> overlapped "
9382 "the old address range specified by I<old_address> and I<old_size>;"
9386 #: build/C/man2/mremap.2:224
9388 "B<MREMAP_FIXED> or B<MREMAP_DONTUNMAP> was specified without also specifying "
9389 "B<MREMAP_MAYMOVE>;"
9393 #: build/C/man2/mremap.2:231
9395 "B<MREMAP_DONTUNMAP> was specified, but one or more pages in the range "
9396 "specified by I<old_address> and I<old_size> were not private anonymous;"
9400 #: build/C/man2/mremap.2:237
9402 "B<MREMAP_DONTUNMAP> was specified and I<old_size> was not equal to "
9407 #: build/C/man2/mremap.2:240
9409 "I<old_size> was zero and I<old_address> does not refer to a shareable "
9410 "mapping (but see BUGS);"
9414 #: build/C/man2/mremap.2:244
9415 msgid "I<old_size> was zero and the B<MREMAP_MAYMOVE> flag was not specified."
9419 #: build/C/man2/mremap.2:249
9421 "Not enough memory was available to complete the operation. Possible causes "
9426 #: build/C/man2/mremap.2:255
9428 "The memory area cannot be expanded at the current virtual address, and the "
9429 "B<MREMAP_MAYMOVE> flag is not set in I<flags>. Or, there is not enough "
9430 "(virtual) memory available."
9432 "現在の仮想アドレスではメモリー領域が拡張できず、 B<MREMAP_MAYMOVE> フラグが "
9433 "I<flags> に設定されていない。 または十分な (仮想) メモリーが存在しない。"
9436 #: build/C/man2/mremap.2:260
9438 "B<MREMAP_DONTUNMAP> was used causing a new mapping to be created that would "
9439 "exceed the (virtual) memory available. Or, it would exceed the maximum "
9440 "number of allowed mappings."
9443 #. 4.2BSD had a (never actually implemented)
9445 #. call with completely different semantics.
9447 #: build/C/man2/mremap.2:267
9449 "This call is Linux-specific, and should not be used in programs intended to "
9452 "このコールは Linux 特有であり、移植を意図したプログラムで 使用すべきではな"
9456 #: build/C/man2/mremap.2:273
9459 #| "B<mremap>() uses the Linux page table scheme. B<mremap>() changes the "
9460 #| "mapping between virtual addresses and memory pages. This can be used to "
9461 #| "implement a very efficient B<realloc>(3)."
9463 "B<mremap>() changes the mapping between virtual addresses and memory "
9464 "pages. This can be used to implement a very efficient B<realloc>(3)."
9466 "B<mremap>() は Linux のページテーブル方式を使用する。 B<mremap>() は仮想ア"
9467 "ドレスとメモリーページのマッピングを変更する。これは非常に効率的な "
9468 "B<realloc>(3) を実装するのに使用されている。"
9471 #: build/C/man2/mremap.2:287
9474 #| "In Linux the memory is divided into pages. A user process has (one or) "
9475 #| "several linear virtual memory segments. Each virtual memory segment has "
9476 #| "one or more mappings to real memory pages (in the page table). Each "
9477 #| "virtual memory segment has its own protection (access rights), which may "
9478 #| "cause a segmentation violation if the memory is accessed incorrectly (e."
9479 #| "g., writing to a read-only segment). Accessing virtual memory outside of "
9480 #| "the segments will also cause a segmentation violation."
9482 "In Linux, memory is divided into pages. A process has (one or) several "
9483 "linear virtual memory segments. Each virtual memory segment has one or more "
9484 "mappings to real memory pages (in the page table). Each virtual memory "
9485 "segment has its own protection (access rights), which may cause a "
9486 "segmentation violation (B<SIGSEGV>) if the memory is accessed incorrectly "
9487 "(e.g., writing to a read-only segment). Accessing virtual memory outside of "
9488 "the segments will also cause a segmentation violation."
9490 "Linux ではメモリーはページに分割される。ユーザープロセスは (一つまたは) 複数"
9491 "のリニアな仮想メモリーセグメントを持つ。 それぞれの仮想メモリーセグメントは一"
9492 "つ以上の実メモリーページ にマッピングされている (マッピング情報はページテーブ"
9493 "ルで管理される)。 仮想メモリーセグメントにはセグメント毎の保護 (アクセス権) "
9494 "が設定されており、 メモリーが不正にアクセスされた場合 (例えば読み込み専用のセ"
9495 "グメントに 書き込んだ場合)、セグメンテーション侵害 (segmentation violation) "
9496 "を 引き起こす。また、セグメント外の仮想メモリーにアクセスした場合にも セグメ"
9500 #: build/C/man2/mremap.2:298
9502 "If B<mremap>() is used to move or expand an area locked with B<mlock>(2) "
9503 "or equivalent, the B<mremap>() call will make a best effort to populate the "
9504 "new area but will not fail with B<ENOMEM> if the area cannot be populated."
9508 #: build/C/man2/mremap.2:307
9510 "Prior to version 2.4, glibc did not expose the definition of "
9511 "B<MREMAP_FIXED>, and the prototype for B<mremap>() did not allow for the "
9512 "I<new_address> argument."
9514 "バージョン 2.4 より前の glibc では、 B<MREMAP_FIXED> の定義は公開されておら"
9515 "ず、 B<mremap>() のプロトタイプは I<new_address> 引き数を取らなかった。"
9518 #: build/C/man2/mremap.2:307
9520 msgid "MREMAP_DONTUNMAP use cases"
9524 #: build/C/man2/mremap.2:311
9525 msgid "Possible applications for B<MREMAP_DONTUNMAP> include:"
9529 #: build/C/man2/mremap.2:320
9531 "Non-cooperative B<userfaultfd>(2): an application can yank out a virtual "
9532 "address range using B<MREMAP_DONTUNMAP> and then employ a B<userfaultfd>(2) "
9533 "handler to handle the page faults that subsequently occur as other threads "
9534 "in the process touch pages in the yanked range."
9538 #: build/C/man2/mremap.2:333
9540 "Garbage collection: B<MREMAP_DONTUNMAP> can be used in conjunction with "
9541 "B<userfaultfd>(2) to implement garbage collection algorithms (e.g., in a "
9542 "Java virtual machine). Such an implementation can be cheaper (and simpler) "
9543 "than conventional garbage collection techniques that involve marking pages "
9544 "with protection B<PROT_NONE> in conjunction with the of a B<SIGSEGV> handler "
9545 "to catch accesses to those pages."
9548 #. commit dba58d3b8c5045ad89c1c95d33d01451e3964db7
9550 #: build/C/man2/mremap.2:354
9552 "Before Linux 4.14, if I<old_size> was zero and the mapping referred to by "
9553 "I<old_address> was a private mapping (B<mmap>(2) B<MAP_PRIVATE>), "
9554 "B<mremap>() created a new private mapping unrelated to the original "
9555 "mapping. This behavior was unintended and probably unexpected in user-space "
9556 "applications (since the intention of B<mremap>() is to create a new mapping "
9557 "based on the original mapping). Since Linux 4.14, B<mremap>() fails with "
9558 "the error B<EINVAL> in this scenario."
9562 #: build/C/man2/mremap.2:363
9564 "B<brk>(2), B<getpagesize>(2), B<getrlimit>(2), B<mlock>(2), B<mmap>(2), "
9565 "B<sbrk>(2), B<malloc>(3), B<realloc>(3)"
9567 "B<brk>(2), B<getpagesize>(2), B<getrlimit>(2), B<mlock>(2), B<mmap>(2), "
9568 "B<sbrk>(2), B<realloc>(3), B<malloc>(3)"
9571 #: build/C/man2/mremap.2:369
9574 #| "Your favorite text book on operating systems for more information on "
9575 #| "paged memory (e.g., I<Modern Operating Systems> by Andrew S. Tanenbaum, "
9576 #| "I<Inside Linux> by Randolf Bentson, I<The Design of the UNIX Operating "
9577 #| "System> by Maurice J. Bach)"
9579 "Your favorite text book on operating systems for more information on paged "
9580 "memory (e.g., I<Modern Operating Systems> by Andrew S.\\& Tanenbaum, "
9581 "I<Inside Linux> by Randolph Bentson, I<The Design of the UNIX Operating "
9582 "System> by Maurice J.\\& Bach)"
9584 "ページ分割されたメモリーについてもっと詳しく知りたいならば、あなたのお気に入"
9585 "りのオペレーティングシステムの教科書を参照してほしい (例えば、 I<Modern "
9586 "Operating Systems> by Andrew S. Tanenbaum, I<Inside Linux> by Randolf "
9587 "Bentson, I<The Design of the UNIX Operating System> by Maurice J. Bach.)"
9590 #: build/C/man2/msync.2:25
9596 #: build/C/man2/msync.2:28
9597 msgid "msync - synchronize a file with a memory map"
9598 msgstr "msync - ファイルをマップしたメモリーと同期させる"
9601 #: build/C/man2/msync.2:32
9602 msgid "B<int msync(void *>I<addr>B<, size_t >I<length>B<, int >I<flags>B<);>"
9603 msgstr "B<int msync(void *>I<addr>B<, size_t >I<length>B<, int >I<flags>B<);>"
9606 #: build/C/man2/msync.2:48
9609 #| "B<msync>() flushes changes made to the in-core copy of a file that was "
9610 #| "mapped into memory using B<mmap>(2) back to the filesystem. Without use "
9611 #| "of this call there is no guarantee that changes are written back before "
9612 #| "B<munmap>(2) is called. To be more precise, the part of the file that "
9613 #| "corresponds to the memory area starting at I<addr> and having length "
9614 #| "I<length> is updated."
9616 "B<msync>() flushes changes made to the in-core copy of a file that was "
9617 "mapped into memory using B<mmap>(2) back to the filesystem. Without use of "
9618 "this call, there is no guarantee that changes are written back before "
9619 "B<munmap>(2) is called. To be more precise, the part of the file that "
9620 "corresponds to the memory area starting at I<addr> and having length "
9621 "I<length> is updated."
9623 "B<msync>() は B<mmap>(2) を使ってメモリーにマップされたファイルの、 メモ"
9624 "リー上のコピーになされた変更をファイルシステムに反映させる。 この関数を使用し"
9625 "ないと、 B<munmap>(2) が呼び出されるまで変更が書き戻される保証はない。 より"
9626 "正確には、ファイルのうち I<addr> から始まり長さ I<length> のメモリー領域に対"
9630 #: build/C/man2/msync.2:59
9632 "The I<flags> argument should specify exactly one of B<MS_ASYNC> and "
9633 "B<MS_SYNC>, and may additionally include the B<MS_INVALIDATE> bit. These "
9634 "bits have the following meanings:"
9638 #: build/C/man2/msync.2:59
9645 #: build/C/man2/msync.2:62
9647 "Specifies that an update be scheduled, but the call returns immediately."
9651 #: build/C/man2/msync.2:62
9658 #: build/C/man2/msync.2:65
9659 msgid "Requests an update and waits for it to complete."
9663 #: build/C/man2/msync.2:65
9665 #| msgid "B<MAP_PRIVATE>"
9666 msgid "B<MS_INVALIDATE>"
9667 msgstr "B<MAP_PRIVATE>"
9669 #. Since Linux 2.4, this seems to be a no-op (other than the
9670 #. EBUSY check for VM_LOCKED).
9672 #: build/C/man2/msync.2:71
9674 "Asks to invalidate other mappings of the same file (so that they can be "
9675 "updated with the fresh values just written)."
9679 #: build/C/man2/msync.2:76
9681 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
9684 "成功した場合、 0 が返る。エラーの場合、 -1 が返り、 I<errno> が適切に設定され"
9688 #: build/C/man2/msync.2:77
9694 #: build/C/man2/msync.2:83
9696 "B<MS_INVALIDATE> was specified in I<flags>, and a memory lock exists for the "
9697 "specified address range."
9699 "I flags に B<MS_INVALIDATE> が指定されたが、指定されたアドレス範囲にロックが"
9703 #: build/C/man2/msync.2:96
9705 "I<addr> is not a multiple of PAGESIZE; or any bit other than B<MS_ASYNC> | "
9706 "B<MS_INVALIDATE> | B<MS_SYNC> is set in I<flags>; or both B<MS_SYNC> and "
9707 "B<MS_ASYNC> are set in I<flags>."
9709 "I<addr> が PAGESIZE の倍数でない。または、 I<flags> に B<MS_ASYNC>、"
9710 "B<MS_INVALIDATE>、B<MS_SYNC> 以外のビットが設定された。 または、 I<flags> に "
9711 "B<MS_SYNC> と B<MS_ASYNC> の両方が設定された。"
9714 #: build/C/man2/msync.2:99
9715 msgid "The indicated memory (or part of it) was not mapped."
9716 msgstr "指定されたメモリー (またはその一部) がマップされていない。"
9719 #: build/C/man2/msync.2:101 build/C/man3/shm_open.3:265
9721 #| msgid "POSIX.1-2001, SVr4."
9722 msgid "POSIX.1-2001, POSIX.1-2008."
9723 msgstr "POSIX.1-2001, SVr4."
9726 #: build/C/man2/msync.2:108
9728 "This call was introduced in Linux 1.3.21, and then used B<EFAULT> instead of "
9729 "B<ENOMEM>. In Linux 2.4.19, this was changed to the POSIX value B<ENOMEM>."
9731 "この関数は Linux 1.3.21 で導入されたが、 B<ENOMEM> ではなく B<EFAULT> が使わ"
9732 "れていた。 これは Linux 2.4.19 で POSIX における値 B<ENOMEM> に変更された。"
9734 #. POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
9735 #. -1: unavailable, 0: ask using sysconf().
9736 #. glibc defines them to 1.
9738 #: build/C/man2/msync.2:123
9740 "On POSIX systems on which B<msync>() is available, both "
9741 "B<_POSIX_MAPPED_FILES> and B<_POSIX_SYNCHRONIZED_IO> are defined in "
9742 "I<E<lt>unistd.hE<gt>> to a value greater than 0. (See also B<sysconf>(3).)"
9744 "B<msync>() が使用可能な POSIX システムでは B<_POSIX_MAPPED_FILES> と "
9745 "B<_POSIX_SYNCHRONIZED_IO> の両方が I<E<lt>unistd.hE<gt>> で 0 より大きい値に"
9746 "定義される。 (B<sysconf>(3) を参照すること。 )"
9748 #. commit 204ec841fbea3e5138168edbc3a76d46747cc987
9750 #: build/C/man2/msync.2:150
9752 "According to POSIX, either B<MS_SYNC> or B<MS_ASYNC> must be specified in "
9753 "I<flags>, and indeed failure to include one of these flags will cause "
9754 "B<msync>() to fail on some systems. However, Linux permits a call to "
9755 "B<msync>() that specifies neither of these flags, with semantics that are "
9756 "(currently) equivalent to specifying B<MS_ASYNC>. (Since Linux 2.6.19, "
9757 "B<MS_ASYNC> is in fact a no-op, since the kernel properly tracks dirty pages "
9758 "and flushes them to storage as necessary.) Notwithstanding the Linux "
9759 "behavior, portable, future-proof applications should ensure that they "
9760 "specify either B<MS_SYNC> or B<MS_ASYNC> in I<flags>."
9762 "POSIX では B<MS_SYNC> と B<MS_ASYNC> のいずれかは必ず I<flags> に指定しなけれ"
9763 "ばならないとされており、 実際にこれらのフラグのいずれかを指定しなかった場合 "
9764 "B<msync>() が失敗するシステムもある。 しかし、 Linux ではこれらのフラグのいず"
9765 "れも指定せずに B<msync>() を呼び出すことができ、 その場合の動作は (現在のとこ"
9766 "ろ) B<MS_ASYNC> を指定した場合と等価である。 (Linux 2.6.19 以降では "
9767 "B<MS_ASYNC> は実際には no-op (何もしない命令) である。 これはカーネルが正し"
9768 "く dirty ページを追跡し、必要に応じてストレージにそれらをフラッシュするからで"
9769 "ある。) Linux の動作に関係なく、アプリケーションの移植性を考慮し、将来も確実"
9770 "に動くようにするには、 B<MS_SYNC> か B<MS_ASYNC> のいずれかを必ず I<flags> に"
9774 #: build/C/man2/msync.2:152 build/C/man7/shm_overview.7:45
9780 #: build/C/man3/mtrace.3:25
9786 #: build/C/man3/mtrace.3:28
9787 msgid "mtrace, muntrace - malloc tracing"
9788 msgstr "mtrace, muntrace - malloc のトレース"
9791 #: build/C/man3/mtrace.3:30
9792 msgid "B<#include E<lt>mcheck.hE<gt>>"
9793 msgstr "B<#include E<lt>mcheck.hE<gt>>"
9796 #: build/C/man3/mtrace.3:32
9797 msgid "B<void mtrace(void);>"
9798 msgstr "B<void mtrace(void);>"
9801 #: build/C/man3/mtrace.3:34
9802 msgid "B<void muntrace(void);>"
9803 msgstr "B<void muntrace(void);>"
9806 #: build/C/man3/mtrace.3:46
9808 "The B<mtrace>() function installs hook functions for the memory-allocation "
9809 "functions (B<malloc>(3), B<realloc>(3) B<memalign>(3), B<free>(3)). These "
9810 "hook functions record tracing information about memory allocation and "
9811 "deallocation. The tracing information can be used to discover memory leaks "
9812 "and attempts to free nonallocated memory in a program."
9816 #: build/C/man3/mtrace.3:57
9818 "The B<muntrace>() function disables the hook functions installed by "
9819 "B<mtrace>(), so that tracing information is no longer recorded for the "
9820 "memory-allocation functions. If no hook functions were successfully "
9821 "installed by B<mtrace>(), B<muntrace>() does nothing."
9825 #: build/C/man3/mtrace.3:65
9827 "When B<mtrace>() is called, it checks the value of the environment variable "
9828 "B<MALLOC_TRACE>, which should contain the pathname of a file in which the "
9829 "tracing information is to be recorded. If the pathname is successfully "
9830 "opened, it is truncated to zero length."
9834 #: build/C/man3/mtrace.3:78
9836 "If B<MALLOC_TRACE> is not set, or the pathname it specifies is invalid or "
9837 "not writable, then no hook functions are installed, and B<mtrace>() has no "
9838 "effect. In set-user-ID and set-group-ID programs, B<MALLOC_TRACE> is "
9839 "ignored, and B<mtrace>() has no effect."
9843 #: build/C/man3/mtrace.3:89
9851 #: build/C/man3/mtrace.3:89
9857 #: build/C/man3/mtrace.3:108
9859 "In normal usage, B<mtrace>() is called once at the start of execution of a "
9860 "program, and B<muntrace>() is never called."
9864 #: build/C/man3/mtrace.3:118
9866 "The tracing output produced after a call to B<mtrace>() is textual, but not "
9867 "designed to be human readable. The GNU C library provides a Perl script, "
9868 "B<mtrace>(1), that interprets the trace log and produces human-readable "
9869 "output. For best results, the traced program should be compiled with "
9870 "debugging enabled, so that line-number information is recorded in the "
9875 #: build/C/man3/mtrace.3:124
9877 "The tracing performed by B<mtrace>() incurs a performance penalty (if "
9878 "B<MALLOC_TRACE> points to a valid, writable pathname)."
9882 #: build/C/man3/mtrace.3:130
9884 "The line-number information produced by B<mtrace>(1) is not always precise: "
9885 "the line number references may refer to the previous or following "
9886 "(nonblank) line of the source code."
9890 #: build/C/man3/mtrace.3:137
9892 "The shell session below demonstrates the use of the B<mtrace>() function "
9893 "and the B<mtrace>(1) command in a program that has memory leaks at two "
9894 "different locations. The demonstration uses the following program:"
9898 #: build/C/man3/mtrace.3:144
9901 "$ B<cat t_mtrace.c>\n"
9902 "#include E<lt>mcheck.hE<gt>\n"
9903 "#include E<lt>stdlib.hE<gt>\n"
9904 "#include E<lt>stdio.hE<gt>\n"
9906 "$ B<cat t_mtrace.c>\n"
9907 "#include E<lt>mcheck.hE<gt>\n"
9908 "#include E<lt>stdlib.hE<gt>\n"
9909 "#include E<lt>stdio.hE<gt>\n"
9912 #: build/C/man3/mtrace.3:149
9916 #| "main(int argc, char *argv[])\n"
9921 "main(int argc, char *argv[])\n"
9926 "main(int argc, char *argv[])\n"
9931 #: build/C/man3/mtrace.3:152
9934 #| " for (j = 0; j E<lt> 2; j++)\n"
9935 #| " malloc(100); /* Never freed--a memory leak */\n"
9937 " for (int j = 0; j E<lt> 2; j++)\n"
9938 " malloc(100); /* Never freed--a memory leak */\n"
9940 " for (j = 0; j E<lt> 2; j++)\n"
9941 " malloc(100); /* Never freed--a memory leak */\n"
9944 #: build/C/man3/mtrace.3:156
9947 " calloc(16, 16); /* Never freed--a memory leak */\n"
9948 " exit(EXIT_SUCCESS);\n"
9951 " calloc(16, 16); /* Never freed--a memory leak */\n"
9952 " exit(EXIT_SUCCESS);\n"
9956 #: build/C/man3/mtrace.3:162
9958 "When we run the program as follows, we see that B<mtrace>() diagnosed "
9959 "memory leaks at two different locations in the program:"
9963 #: build/C/man3/mtrace.3:175
9966 "$ B<cc -g t_mtrace.c -o t_mtrace>\n"
9967 "$ B<export MALLOC_TRACE=/tmp/t>\n"
9969 "$ B<mtrace ./t_mtrace $MALLOC_TRACE>\n"
9970 "Memory not freed:\n"
9971 "-----------------\n"
9972 " Address Size Caller\n"
9973 "0x084c9378 0x64 at /home/cecilia/t_mtrace.c:12\n"
9974 "0x084c93e0 0x64 at /home/cecilia/t_mtrace.c:12\n"
9975 "0x084c9448 0x100 at /home/cecilia/t_mtrace.c:16\n"
9977 "$ B<cc -g t_mtrace.c -o t_mtrace>\n"
9978 "$ B<export MALLOC_TRACE=/tmp/t>\n"
9980 "$ B<mtrace ./t_mtrace $MALLOC_TRACE>\n"
9981 "Memory not freed:\n"
9982 "-----------------\n"
9983 " Address Size Caller\n"
9984 "0x084c9378 0x64 at /home/cecilia/t_mtrace.c:12\n"
9985 "0x084c93e0 0x64 at /home/cecilia/t_mtrace.c:12\n"
9986 "0x084c9448 0x100 at /home/cecilia/t_mtrace.c:16\n"
9989 #: build/C/man3/mtrace.3:187
9991 "The first two messages about unfreed memory correspond to the two "
9992 "B<malloc>(3) calls inside the I<for> loop. The final message corresponds "
9993 "to the call to B<calloc>(3) (which in turn calls B<malloc>(3))."
9997 #: build/C/man3/mtrace.3:192
9998 msgid "B<mtrace>(1), B<malloc>(3), B<malloc_hook>(3), B<mcheck>(3)"
9999 msgstr "B<mtrace>(1), B<malloc>(3), B<malloc_hook>(3), B<mcheck>(3)"
10002 #: build/C/man2/posix_fadvise.2:29
10004 msgid "POSIX_FADVISE"
10005 msgstr "POSIX_FADVISE"
10007 #. type: Plain text
10008 #: build/C/man2/posix_fadvise.2:32
10009 msgid "posix_fadvise - predeclare an access pattern for file data"
10010 msgstr "posix_fadvise - ファイルデータのアクセスパターンをあらかじめ宣言する"
10012 #. type: Plain text
10013 #: build/C/man2/posix_fadvise.2:35 build/C/man3/posix_fallocate.3:31
10015 msgid "B<#include E<lt>fcntl.hE<gt>>\n"
10016 msgstr "B<#include E<lt>fcntl.hE<gt>>\n"
10018 #. type: Plain text
10019 #: build/C/man2/posix_fadvise.2:38
10021 msgid "B<int posix_fadvise(int >I<fd>B<, off_t >I<offset>B<, off_t >I<len>B<, int >I<advice>B<);>\n"
10022 msgstr "B<int posix_fadvise(int >I<fd>B<, off_t >I<offset>B<, off_t >I<len>B<, int >I<advice>B<);>\n"
10024 #. type: Plain text
10025 #: build/C/man2/posix_fadvise.2:47
10026 msgid "B<posix_fadvise>():"
10027 msgstr "B<posix_fadvise>():"
10029 #. type: Plain text
10030 #: build/C/man2/posix_fadvise.2:49 build/C/man3/posix_fallocate.3:44
10032 #| msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10033 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10034 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10036 #. type: Plain text
10037 #: build/C/man2/posix_fadvise.2:57
10039 "Programs can use B<posix_fadvise>() to announce an intention to access file "
10040 "data in a specific pattern in the future, thus allowing the kernel to "
10041 "perform appropriate optimizations."
10043 "プログラムは、将来特定のパターンでファイルデータに アクセスする意思を伝えるた"
10044 "めに B<posix_fadvise>() を使うことができる。 これにより、カーネルが適切な最"
10047 #. type: Plain text
10048 #: build/C/man2/posix_fadvise.2:64
10050 "The I<advice> applies to a (not necessarily existent) region starting at "
10051 "I<offset> and extending for I<len> bytes (or until the end of the file if "
10052 "I<len> is 0) within the file referred to by I<fd>. The I<advice> is not "
10053 "binding; it merely constitutes an expectation on behalf of the application."
10055 "I<advice> は I<fd> が参照しているファイルの I<offset> から始まる I<len> バ"
10057 "トの範囲内 (I<len> が 0 の場合はファイルの終りまで) の (必ずしも存在しない)\n"
10058 "領域に適用される。 I<advice> は義務づけではない。 I<advice> は単にアプリ"
10060 "ションのために可能性を構成するだけである。"
10062 #. type: Plain text
10063 #: build/C/man2/posix_fadvise.2:66
10064 msgid "Permissible values for I<advice> include:"
10065 msgstr "I<advice> に許される値には、以下のものが含まれる:"
10068 #: build/C/man2/posix_fadvise.2:66
10070 msgid "B<POSIX_FADV_NORMAL>"
10071 msgstr "B<POSIX_FADV_NORMAL>"
10073 #. type: Plain text
10074 #: build/C/man2/posix_fadvise.2:72
10076 "Indicates that the application has no advice to give about its access "
10077 "pattern for the specified data. If no advice is given for an open file, "
10078 "this is the default assumption."
10080 "指定されたデータのアクセスパターンを指示するアドバイスを アプリケーションが何"
10081 "も持っていないことを示す。 オープンされたファイルにアドバイスが指定されない場"
10082 "合、 これがデフォルトで仮定される。"
10085 #: build/C/man2/posix_fadvise.2:72
10087 msgid "B<POSIX_FADV_SEQUENTIAL>"
10088 msgstr "B<POSIX_FADV_SEQUENTIAL>"
10090 #. type: Plain text
10091 #: build/C/man2/posix_fadvise.2:76
10093 "The application expects to access the specified data sequentially (with "
10094 "lower offsets read before higher ones)."
10096 "アプリケーションは指定されたデータがシーケンシャルに (大きなオフセットの前に"
10097 "小さなオフセットのデータを読むように) アクセスされることを期待する。"
10100 #: build/C/man2/posix_fadvise.2:76
10102 msgid "B<POSIX_FADV_RANDOM>"
10103 msgstr "B<POSIX_FADV_RANDOM>"
10105 #. type: Plain text
10106 #: build/C/man2/posix_fadvise.2:79
10107 msgid "The specified data will be accessed in random order."
10108 msgstr "指定されたデータがランダムな順番でアクセスされる。"
10111 #: build/C/man2/posix_fadvise.2:79
10113 msgid "B<POSIX_FADV_NOREUSE>"
10114 msgstr "B<POSIX_FADV_NOREUSE>"
10116 #. type: Plain text
10117 #: build/C/man2/posix_fadvise.2:82
10118 msgid "The specified data will be accessed only once."
10119 msgstr "指定されたデータは 1 度しかアクセスされない。"
10121 #. type: Plain text
10122 #: build/C/man2/posix_fadvise.2:86
10124 "In kernels before 2.6.18, B<POSIX_FADV_NOREUSE> had the same semantics as "
10125 "B<POSIX_FADV_WILLNEED>. This was probably a bug; since kernel 2.6.18, this "
10128 "2.6.18 より前のカーネルでは、B<POSIX_FADV_NOREUSE> は B<POSIX_FADV_WILLNEED> "
10129 "と同じ意味であった。 これは多分バグであった。 カーネル 2.6.18 以降では、この"
10133 #: build/C/man2/posix_fadvise.2:86
10135 msgid "B<POSIX_FADV_WILLNEED>"
10136 msgstr "B<POSIX_FADV_WILLNEED>"
10138 #. type: Plain text
10139 #: build/C/man2/posix_fadvise.2:89
10140 msgid "The specified data will be accessed in the near future."
10141 msgstr "指定されたデータは近い将来アクセスされる。"
10143 #. type: Plain text
10144 #: build/C/man2/posix_fadvise.2:96
10146 "B<POSIX_FADV_WILLNEED> initiates a nonblocking read of the specified region "
10147 "into the page cache. The amount of data read may be decreased by the kernel "
10148 "depending on virtual memory load. (A few megabytes will usually be fully "
10149 "satisfied, and more is rarely useful.)"
10151 "B<POSIX_FADV_WILLNEED> は、 ページキャッシュに指定領域のブロックされない読み"
10152 "込みを開始する。 読み込まれるデータの総量は、 仮想メモリーの負荷に依ってカー"
10153 "ネルが減らすかもしれない (数メガバイトであれば通常は全く十分であり、 それより"
10157 #: build/C/man2/posix_fadvise.2:96
10159 msgid "B<POSIX_FADV_DONTNEED>"
10160 msgstr "B<POSIX_FADV_DONTNEED>"
10162 #. type: Plain text
10163 #: build/C/man2/posix_fadvise.2:99
10164 msgid "The specified data will not be accessed in the near future."
10165 msgstr "指定されたデータは近い将来アクセスされない。"
10167 #. type: Plain text
10168 #: build/C/man2/posix_fadvise.2:107
10170 "B<POSIX_FADV_DONTNEED> attempts to free cached pages associated with the "
10171 "specified region. This is useful, for example, while streaming large "
10172 "files. A program may periodically request the kernel to free cached data "
10173 "that has already been used, so that more useful cached pages are not "
10174 "discarded instead."
10176 "B<POSIX_FADV_DONTNEED> は指定された領域に関連付けられた キャッシュページを解"
10177 "放しようとする。 例えば、これは大きなファイルをストリーミングするときに役立"
10178 "つ。 プログラムは、使用済みのキャッシュされたデータを解放するように、 定期的"
10179 "にカーネルに要求するかもしれない。 そうすることにより、さらに有効なキャッシュ"
10180 "されたページが、 代わりに破棄されることはない。"
10182 #. type: Plain text
10183 #: build/C/man2/posix_fadvise.2:115
10186 #| "Requests to discard partial pages are ignored. It is preferable to "
10187 #| "preserve needed data than discard unneeded data. If the application "
10188 #| "requires that data be considered for discarding then I<offset> and I<len> "
10189 #| "must be page-aligned."
10191 "Requests to discard partial pages are ignored. It is preferable to preserve "
10192 "needed data than discard unneeded data. If the application requires that "
10193 "data be considered for discarding, then I<offset> and I<len> must be page-"
10196 "ページの一部分の破棄要求は無視される。 不要なデータを破棄するよりも必要なデー"
10197 "タを保持する方がよい。 アプリケーションがデータを破棄した方がよいと思う場合"
10198 "は、 I<offset> と I<len> がページ境界に合っていなければならない。"
10200 #. type: Plain text
10201 #: build/C/man2/posix_fadvise.2:127
10204 #| "Pages that have not yet been written out will be unaffected, so if the "
10205 #| "application wishes to guarantee that pages will be released, it should "
10206 #| "call B<fsync>(2) or B<fdatasync>(2) first."
10208 "The implementation I<may> attempt to write back dirty pages in the specified "
10209 "region, but this is not guaranteed. Any unwritten dirty pages will not be "
10210 "freed. If the application wishes to ensure that dirty pages will be "
10211 "released, it should call B<fsync>(2) or B<fdatasync>(2) first."
10213 "まだ書き出されていないページは影響を受けないので、 そのページの解放が保証され"
10214 "ることをアプリケーションが望んでいるなら、 最初に B<fsync>(2) または "
10215 "B<fdatasync>(2) を呼ぶべきである。"
10217 #. type: Plain text
10218 #: build/C/man2/posix_fadvise.2:130
10219 msgid "On success, zero is returned. On error, an error number is returned."
10220 msgstr "成功した場合は 0 が返される。 失敗した場合はエラー番号が返される。"
10222 #. type: Plain text
10223 #: build/C/man2/posix_fadvise.2:134
10224 msgid "The I<fd> argument was not a valid file descriptor."
10225 msgstr "I<fd> 引き数が有効なファイルディスクリプターでない。"
10227 #. type: Plain text
10228 #: build/C/man2/posix_fadvise.2:137
10229 msgid "An invalid value was specified for I<advice>."
10230 msgstr "無効な値が I<advice> に指定された。"
10232 #. commit 87ba81dba431232548ce29d5d224115d0c2355ac
10233 #. type: Plain text
10234 #: build/C/man2/posix_fadvise.2:147
10237 #| "The specified file descriptor refers to a pipe or FIFO. (B<ESPIPE> is "
10238 #| "the error specified by POSIX, but before kernel version 2.16, Linux "
10239 #| "returned B<EINVAL> in this case.)"
10241 "The specified file descriptor refers to a pipe or FIFO. (B<ESPIPE> is the "
10242 "error specified by POSIX, but before kernel version 2.6.16, Linux returned "
10243 "B<EINVAL> in this case.)"
10245 "指定されたファイルディスクリプターがパイプまたは FIFO を参照している "
10246 "(B<ESPIPE> は POSIX で規定されているエラーだが、 バージョン 2.16 より前のカー"
10247 "ネルでは、 この場合に B<EINVAL> を返していた。)"
10249 #. of fadvise64_64()
10250 #. type: Plain text
10251 #: build/C/man2/posix_fadvise.2:155
10253 "Kernel support first appeared in Linux 2.5.60; the underlying system call is "
10254 "called B<fadvise64>(). Library support has been provided since glibc "
10255 "version 2.2, via the wrapper function B<posix_fadvise>()."
10257 "カーネルによるサポートは Linux 2.5.60 で最初に登場し、\n"
10258 "対応するシステムコールは B<fadvise64>() という名前である。\n"
10259 "ライブラリによるサポートは glibc バージョン 2.2 以降で提供されており、\n"
10260 "ラッパー関数は B<posix_fadvise>() という名前である。"
10262 #. commit d3ac21cacc24790eb45d735769f35753f5b56ceb
10263 #. type: Plain text
10264 #: build/C/man2/posix_fadvise.2:162
10266 "Since Linux 3.18, support for the underlying system call is optional, "
10267 "depending on the setting of the B<CONFIG_ADVISE_SYSCALLS> configuration "
10270 "Linux 3.18 以降では、対応するシステムコールのサポートは任意となり、利用できる"
10271 "かはカーネルが B<CONFIG_ADVISE_SYSCALLS> オプションを有効にしてコンパイルされ"
10274 #. type: Plain text
10275 #: build/C/man2/posix_fadvise.2:171
10278 #| "POSIX.1-2001. Note that the type of the I<len> argument was changed from "
10279 #| "I<size_t> to I<off_t> in POSIX.1-2003 TC1."
10281 "POSIX.1-2001, POSIX.1-2008. Note that the type of the I<len> argument was "
10282 "changed from I<size_t> to I<off_t> in POSIX.1-2001 TC1."
10284 "POSIX.1-2001. I<len> 引き数の型が POSIX.1-2003 TC1 において I<size_t> から "
10285 "I<off_t> に変更された点に注意すること。"
10287 #. type: Plain text
10288 #: build/C/man2/posix_fadvise.2:177
10290 "Under Linux, B<POSIX_FADV_NORMAL> sets the readahead window to the default "
10291 "size for the backing device; B<POSIX_FADV_SEQUENTIAL> doubles this size, and "
10292 "B<POSIX_FADV_RANDOM> disables file readahead entirely. These changes affect "
10293 "the entire file, not just the specified region (but other open file handles "
10294 "to the same file are unaffected)."
10296 "Linux では、B<POSIX_FADV_NORMAL> はバッキングデバイスの デフォルトサイズに先"
10297 "読み (readahead) ウインドウを設定する。 B<POSIX_FADV_SEQUENTIAL> はこのサイズ"
10298 "を 2 倍し、 B<POSIX_FADV_RANDOM> は先読みを全く無効にする。 これらの変更は"
10299 "ファイル全体に影響し、指定された領域のみに影響するわけではない (しかし同じ"
10300 "ファイルに対する他のオープンファイルハンドルは影響を受けない)。"
10302 #. type: Plain text
10303 #: build/C/man2/posix_fadvise.2:182
10305 "The contents of the kernel buffer cache can be cleared via the I</proc/sys/"
10306 "vm/drop_caches> interface described in B<proc>(5)."
10309 #. type: Plain text
10310 #: build/C/man2/posix_fadvise.2:189
10312 "One can obtain a snapshot of which pages of a file are resident in the "
10313 "buffer cache by opening a file, mapping it with B<mmap>(2), and then "
10314 "applying B<mincore>(2) to the mapping."
10317 #. type: Plain text
10318 #: build/C/man2/posix_fadvise.2:199
10320 "The name of the wrapper function in the C library is B<posix_fadvise>(). "
10321 "The underlying system call is called B<fadvise64>() (or, on some "
10322 "architectures, B<fadvise64_64>()); the difference between the two is that "
10323 "the former system call assumes that the type of the I<len> argument is "
10324 "I<size_t>, while the latter expects I<loff_t> there."
10327 #. type: Plain text
10328 #: build/C/man2/posix_fadvise.2:216
10331 #| "Some architectures require 64-bit arguments to be aligned in a suitable "
10332 #| "pair of registers (see B<syscall>(2) for further detail). On such "
10333 #| "architectures, the call signature of B<posix_fadvise>() shown in the "
10334 #| "SYNOPSIS would force a register to be wasted as padding between the I<fd> "
10335 #| "and I<offset> arguments. Therefore, these architectures define a version "
10336 #| "of the system call that orders the arguments suitably, but otherwise is "
10337 #| "otherwise exactly the same as B<posix_fadvise>()."
10339 "Some architectures require 64-bit arguments to be aligned in a suitable pair "
10340 "of registers (see B<syscall>(2) for further detail). On such "
10341 "architectures, the call signature of B<posix_fadvise>() shown in the "
10342 "SYNOPSIS would force a register to be wasted as padding between the I<fd> "
10343 "and I<offset> arguments. Therefore, these architectures define a version of "
10344 "the system call that orders the arguments suitably, but is otherwise exactly "
10345 "the same as B<posix_fadvise>()."
10347 "いくつかのアーキテクチャーでは、 64 ビットの引き数は適切なレジスターの組に割"
10348 "り当てる必要がある (B<syscall>(2) 参照)。 このようなアーキテクチャーでは、 "
10349 "「書式」に書かれている B<posix_fadvise>() の呼び出しシグネチャーで、 引き数 "
10350 "I<fd> と I<offset> の間のパディング (詰めもの) でレジスターが一つ消費されてし"
10351 "まう。 そのため、 これらのアーキテクチャーでは引き数が適切な順序になった別の"
10352 "システムコールが定義されているが、 それ以外は B<posix_fadvise>() と全く同じで"
10355 #. type: Plain text
10356 #: build/C/man2/posix_fadvise.2:218
10357 msgid "For example, since Linux 2.6.14, ARM has the following system call:"
10359 "例えば、 Linux 2.6.14 以降では、 ARM には以下のシステムコールが存在する。"
10361 #. type: Plain text
10362 #: build/C/man2/posix_fadvise.2:223
10365 "B<long arm_fadvise64_64(int >I<fd>B<, int >I<advice>B<,>\n"
10366 "B< loff_t >I<offset>B<, loff_t >I<len>B<);>\n"
10368 "B<long arm_fadvise64_64(int >I<fd>B<, int >I<advice>B<,>\n"
10369 "B< loff_t >I<offset>B<, loff_t >I<len>B<);>\n"
10371 #. type: Plain text
10372 #: build/C/man2/posix_fadvise.2:231
10374 "These architecture-specific details are generally hidden from applications "
10375 "by the glibc B<posix_fadvise>() wrapper function, which invokes the "
10376 "appropriate architecture-specific system call."
10378 "通常、 glibc の B<posix_fadvise>() ラッパー関数により、 これらのアーキテク"
10379 "チャー固有の詳細はアプリケーションには見えない。 glibc のラッパー関数では、適"
10380 "切なアーキテクチャー固有のシステムコールが呼び出される。"
10382 #. type: Plain text
10383 #: build/C/man2/posix_fadvise.2:236
10385 "In kernels before 2.6.6, if I<len> was specified as 0, then this was "
10386 "interpreted literally as \"zero bytes\", rather than as meaning \"all bytes "
10387 "through to the end of the file\"."
10389 "2.6.6 より前のカーネルでは、 I<len> に 0 が指定された場合、 「ファイルの終り"
10390 "までの全てのバイト」という意味ではなく、 文字通り「0 バイト」として解釈されて"
10393 #. type: Plain text
10394 #: build/C/man2/posix_fadvise.2:243
10397 #| "B<readahead>(2), B<sync_file_range>(2), B<posix_fallocate>(3), "
10398 #| "B<posix_madvise>(3)"
10400 "B<fincore>(1), B<mincore>(2), B<readahead>(2), B<sync_file_range>(2), "
10401 "B<posix_fallocate>(3), B<posix_madvise>(3)"
10403 "B<readahead>(2), B<sync_file_range>(2), B<posix_fallocate>(3),\n"
10404 "B<posix_madvise>(3)"
10407 #: build/C/man3/posix_fallocate.3:25
10409 msgid "POSIX_FALLOCATE"
10410 msgstr "POSIX_FALLOCATE"
10412 #. type: Plain text
10413 #: build/C/man3/posix_fallocate.3:28
10414 msgid "posix_fallocate - allocate file space"
10415 msgstr "posix_fallocate - ファイルのスペースを確保する"
10417 #. type: Plain text
10418 #: build/C/man3/posix_fallocate.3:33
10420 msgid "B<int posix_fallocate(int >I<fd>B<, off_t >I<offset>B<, off_t >I<len>B<);>\n"
10421 msgstr "B<int posix_fallocate(int >I<fd>B<, off_t >I<offset>B<, off_t >I<len>B<);>\n"
10423 #. type: Plain text
10424 #: build/C/man3/posix_fallocate.3:42
10425 msgid "B<posix_fallocate>():"
10426 msgstr "B<posix_fallocate>():"
10428 #. type: Plain text
10429 #: build/C/man3/posix_fallocate.3:61
10432 #| "The function B<posix_fallocate>() ensures that disk space is allocated "
10433 #| "for the file referred to by the descriptor I<fd> for the bytes in the "
10434 #| "range starting at I<offset> and continuing for I<len> bytes. After a "
10435 #| "successful call to B<posix_fallocate>(), subsequent writes to bytes in "
10436 #| "the specified range are guaranteed not to fail because of lack of disk "
10439 "The function B<posix_fallocate>() ensures that disk space is allocated for "
10440 "the file referred to by the file descriptor I<fd> for the bytes in the range "
10441 "starting at I<offset> and continuing for I<len> bytes. After a successful "
10442 "call to B<posix_fallocate>(), subsequent writes to bytes in the specified "
10443 "range are guaranteed not to fail because of lack of disk space."
10445 "関数 B<posix_fallocate>() は、ディスクリプター I<fd> で参照されるファイルに"
10446 "対して、ディスクスペースを確実に確保する。 ディスクスペースは I<offset> から"
10447 "始まる I<len> バイトの範囲のバイトである。 B<posix_fallocate>() の呼び出しが"
10448 "成功した後、指定された範囲のバイトに対する書き込みは、 ディスクスペースの不足"
10451 #. type: Plain text
10452 #: build/C/man3/posix_fallocate.3:66
10454 "If the size of the file is less than I<offset>+I<len>, then the file is "
10455 "increased to this size; otherwise the file size is left unchanged."
10457 "ファイルのサイズが I<offset>+I<len> より小さい場合、ファイルはこのサイズにな"
10458 "るように拡大される。 それ以外の場合、ファイルサイズは変わらない。"
10460 #. type: Plain text
10461 #: build/C/man3/posix_fallocate.3:72
10463 "B<posix_fallocate>() returns zero on success, or an error number on "
10464 "failure. Note that I<errno> is not set."
10466 "B<posix_fallocate>() は成功した場合、0 を返す。 失敗した場合、エラー番号を返"
10467 "す。 I<errno> が設定されない点に注意すること。"
10469 #. type: Plain text
10470 #: build/C/man3/posix_fallocate.3:81
10471 msgid "I<offset+len> exceeds the maximum file size."
10472 msgstr "I<offset+len> が最大ファイルサイズを超えている。"
10474 #. type: Plain text
10475 #: build/C/man3/posix_fallocate.3:84
10476 msgid "A signal was caught during execution."
10477 msgstr "実行中にシグナルが捕捉された。"
10479 #. type: Plain text
10480 #: build/C/man3/posix_fallocate.3:91
10482 #| msgid "I<offset> was less than 0, or I<len> was less than or equal to 0."
10484 "I<offset> was less than 0, or I<len> was less than or equal to 0, or the "
10485 "underlying filesystem does not support the operation."
10486 msgstr "I<offset> が 0 未満だったか、 I<len> が 0 以下だった。"
10488 #. type: Plain text
10489 #: build/C/man3/posix_fallocate.3:95
10490 msgid "I<fd> does not refer to a regular file."
10491 msgstr "I<fd> が通常のファイルとして参照されていない。"
10493 #. type: Plain text
10494 #: build/C/man3/posix_fallocate.3:107
10497 #| "The filesystem containing the file referred to by I<fd> does not support "
10498 #| "this operation; or the I<mode> is not supported by the filesystem "
10499 #| "containing the file referred to by I<fd>."
10501 "The filesystem containing the file referred to by I<fd> does not support "
10502 "this operation. This error code can be returned by C libraries that don't "
10503 "perform the emulation shown in NOTES, such as musl libc."
10505 "I<fd> が参照するファイルを含むファイルシステムが 指定された操作を\n"
10506 "サポートしていない。 I<fd> が参照するファイルを含むファイルシステムが\n"
10507 "I<mode> をサポートしていない。"
10509 #. type: Plain text
10510 #: build/C/man3/posix_fallocate.3:111
10511 msgid "I<fd> refers to a pipe."
10512 msgstr "I<fd> がパイプを参照している。"
10514 #. type: Plain text
10515 #: build/C/man3/posix_fallocate.3:114
10516 msgid "B<posix_fallocate>() is available since glibc 2.1.94."
10517 msgstr "B<posix_fallocate>() は glibc 2.1.94 以降で利用可能である。"
10520 #: build/C/man3/posix_fallocate.3:124
10522 msgid "B<posix_fallocate>()"
10523 msgstr "B<posix_fallocate>()"
10526 #: build/C/man3/posix_fallocate.3:124
10528 msgid "MT-Safe (but see NOTES)"
10529 msgstr "MT-Safe (ただし「注意」を参照)"
10531 #. type: Plain text
10532 #: build/C/man3/posix_fallocate.3:128 build/C/man3/posix_madvise.3:109
10533 msgid "POSIX.1-2001."
10534 msgstr "POSIX.1-2001."
10536 #. type: Plain text
10537 #: build/C/man3/posix_fallocate.3:151
10539 "POSIX.1-2008 says that an implementation I<shall> give the B<EINVAL> error "
10540 "if I<len> was 0, or I<offset> was less than 0. POSIX.1-2001 says that an "
10541 "implementation I<shall> give the B<EINVAL> error if I<len> is less than 0, "
10542 "or I<offset> was less than 0, and I<may> give the error if I<len> equals "
10545 "POSIX.1-2008 では、 I<len> が 0 の場合、もしくは I<offset> が 0 未満の場合、 "
10546 "B<EINVAL> エラーを返すものとされている。 POSIX.1-2001 では、 I<len> が 0 未満"
10547 "の場合、もしくは I<offset> が 0 未満の場合、 B<EINVAL> エラーを返すものとされ"
10548 "ている。また、 I<len> が 0 の場合、 B<EINVAL> エラーを返してもよいとされてい"
10551 #. type: Plain text
10552 #: build/C/man3/posix_fallocate.3:160
10554 "In the glibc implementation, B<posix_fallocate>() is implemented using the "
10555 "B<fallocate>(2) system call, which is MT-safe. If the underlying "
10556 "filesystem does not support B<fallocate>(2), then the operation is emulated "
10557 "with the following caveats:"
10560 #. type: Plain text
10561 #: build/C/man3/posix_fallocate.3:162
10562 msgid "The emulation is inefficient."
10565 #. type: Plain text
10566 #: build/C/man3/posix_fallocate.3:165
10568 "There is a race condition where concurrent writes from another thread or "
10569 "process could be overwritten with null bytes."
10572 #. type: Plain text
10573 #: build/C/man3/posix_fallocate.3:169
10575 "There is a race condition where concurrent file size increases by another "
10576 "thread or process could result in a file whose size is smaller than expected."
10579 #. type: Plain text
10580 #: build/C/man3/posix_fallocate.3:178
10582 "If I<fd> has been opened with the B<O_APPEND> or B<O_WRONLY> flags, the "
10583 "function fails with the error B<EBADF>."
10586 #. type: Plain text
10587 #: build/C/man3/posix_fallocate.3:188
10589 "In general, the emulation is not MT-safe. On Linux, applications may use "
10590 "B<fallocate>(2) if they cannot tolerate the emulation caveats. In general, "
10591 "this is only recommended if the application plans to terminate the operation "
10592 "if B<EOPNOTSUPP> is returned, otherwise the application itself will need to "
10593 "implement a fallback with all the same problems as the emulation provided by "
10597 #. type: Plain text
10598 #: build/C/man3/posix_fallocate.3:193
10599 msgid "B<fallocate>(1), B<fallocate>(2), B<lseek>(2), B<posix_fadvise>(2)"
10600 msgstr "B<fallocate>(1), B<fallocate>(2), B<lseek>(2), B<posix_fadvise>(2)"
10603 #: build/C/man3/posix_madvise.3:20
10605 #| msgid "POSIX_FADVISE"
10606 msgid "POSIX_MADVISE"
10607 msgstr "POSIX_FADVISE"
10609 #. type: Plain text
10610 #: build/C/man3/posix_madvise.3:23
10612 #| msgid "madvise - give advice about use of memory"
10613 msgid "posix_madvise - give advice about patterns of memory usage"
10614 msgstr "madvise - メモリー利用に関するアドバイスを与える"
10616 #. type: Plain text
10617 #: build/C/man3/posix_madvise.3:28
10619 #| msgid "B<int madvise(void *>I<addr>B<, size_t >I<length>B<, int >I<advice>B<);>"
10620 msgid "B<int posix_madvise(void *>I<addr>B<, size_t >I<len>B<, int >I<advice>B<);>\n"
10621 msgstr "B<int madvise(void *>I<addr>B<, size_t >I<length>B<, int >I<advice>B<);>"
10623 #. type: Plain text
10624 #: build/C/man3/posix_madvise.3:36
10626 #| msgid "B<posix_fadvise>():"
10627 msgid "B<posix_madvise>():"
10628 msgstr "B<posix_fadvise>():"
10630 #. type: Plain text
10631 #: build/C/man3/posix_madvise.3:40
10633 #| msgid "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10634 msgid "_POSIX_C_SOURCE E<gt>= 200112L"
10635 msgstr "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10637 #. type: Plain text
10638 #: build/C/man3/posix_madvise.3:55
10640 "The B<posix_madvise>() function allows an application to advise the system "
10641 "about its expected patterns of usage of memory in the address range starting "
10642 "at I<addr> and continuing for I<len> bytes. The system is free to use this "
10643 "advice in order to improve the performance of memory accesses (or to ignore "
10644 "the advice altogether), but calling B<posix_madvise>() shall not affect the "
10645 "semantics of access to memory in the specified range."
10648 #. type: Plain text
10649 #: build/C/man3/posix_madvise.3:59
10652 #| "The I<flags> bit-mask argument can include any of the following values:"
10653 msgid "The I<advice> argument is one of the following:"
10654 msgstr "ビットマスク引き数 I<flags> には以下の値を指定することができる:"
10657 #: build/C/man3/posix_madvise.3:59
10659 #| msgid "B<POSIX_FADV_NORMAL>"
10660 msgid "B<POSIX_MADV_NORMAL>"
10661 msgstr "B<POSIX_FADV_NORMAL>"
10663 #. type: Plain text
10664 #: build/C/man3/posix_madvise.3:64
10667 #| "Indicates that the application has no advice to give about its access "
10668 #| "pattern for the specified data. If no advice is given for an open file, "
10669 #| "this is the default assumption."
10671 "The application has no special advice regarding its memory usage patterns "
10672 "for the specified address range. This is the default behavior."
10674 "指定されたデータのアクセスパターンを指示するアドバイスを アプリケーションが何"
10675 "も持っていないことを示す。 オープンされたファイルにアドバイスが指定されない場"
10676 "合、 これがデフォルトで仮定される。"
10679 #: build/C/man3/posix_madvise.3:64
10681 #| msgid "B<POSIX_FADV_SEQUENTIAL>"
10682 msgid "B<POSIX_MADV_SEQUENTIAL>"
10683 msgstr "B<POSIX_FADV_SEQUENTIAL>"
10685 #. type: Plain text
10686 #: build/C/man3/posix_madvise.3:70
10689 #| "Expect page references in sequential order. (Hence, pages in the given "
10690 #| "range can be aggressively read ahead, and may be freed soon after they "
10691 #| "are accessed.)"
10693 "The application expects to access the specified address range sequentially, "
10694 "running from lower addresses to higher addresses. Hence, pages in this "
10695 "region can be aggressively read ahead, and may be freed soon after they are "
10698 "ページ参照はシーケンシャルな順序で行われそうだ。 (したがって与えた範囲のペー"
10699 "ジは積極的に先読みしておくと良いだろう。 またアクセスが終わったら速やかに解放"
10703 #: build/C/man3/posix_madvise.3:70
10705 #| msgid "B<POSIX_FADV_RANDOM>"
10706 msgid "B<POSIX_MADV_RANDOM>"
10707 msgstr "B<POSIX_FADV_RANDOM>"
10709 #. type: Plain text
10710 #: build/C/man3/posix_madvise.3:74
10713 #| "Expect page references in random order. (Hence, read ahead may be less "
10714 #| "useful than normally.)"
10716 "The application expects to access the specified address range randomly. "
10717 "Thus, read ahead may be less useful than normally."
10719 "ページ参照はランダムな順序で行われそうだ。 (したがって、先読みはあまり効果が"
10723 #: build/C/man3/posix_madvise.3:74
10725 #| msgid "B<POSIX_FADV_WILLNEED>"
10726 msgid "B<POSIX_MADV_WILLNEED>"
10727 msgstr "B<POSIX_FADV_WILLNEED>"
10729 #. type: Plain text
10730 #: build/C/man3/posix_madvise.3:79
10733 #| "The application expects to access the specified data sequentially (with "
10734 #| "lower offsets read before higher ones)."
10736 "The application expects to access the specified address range in the near "
10737 "future. Thus, read ahead may be beneficial."
10739 "アプリケーションは指定されたデータがシーケンシャルに (大きなオフセットの前に"
10740 "小さなオフセットのデータを読むように) アクセスされることを期待する。"
10743 #: build/C/man3/posix_madvise.3:79
10745 #| msgid "B<POSIX_FADV_DONTNEED>"
10746 msgid "B<POSIX_MADV_DONTNEED>"
10747 msgstr "B<POSIX_FADV_DONTNEED>"
10749 #. type: Plain text
10750 #: build/C/man3/posix_madvise.3:83
10752 #| msgid "The specified data will not be accessed in the near future."
10754 "The application expects that it will not access the specified address range "
10755 "in the near future."
10756 msgstr "指定されたデータは近い将来アクセスされない。"
10758 #. type: Plain text
10759 #: build/C/man3/posix_madvise.3:88
10762 #| "On success B<madvise>() returns zero. On error, it returns -1 and "
10763 #| "I<errno> is set appropriately."
10765 "On success, B<posix_madvise>() returns 0. On failure, it returns a "
10766 "positive error number."
10768 "B<madvise>() は成功すると 0 を返す。 エラーが起こると -1 を返し、 I<errno> "
10771 #. type: Plain text
10772 #: build/C/man3/posix_madvise.3:95
10775 #| "I<addr> is not a valid pointer, or not a multiple of the system page size."
10777 "I<addr> is not a multiple of the system page size or I<len> is negative."
10779 "I<addr> が有効なポインターでないか、 システムのページサイズの倍数でない。"
10781 #. type: Plain text
10782 #: build/C/man3/posix_madvise.3:99
10784 #| msgid "I<advice> is not a valid value"
10785 msgid "I<advice> is invalid."
10786 msgstr "I<advice> が有効な値でない。"
10788 #. type: Plain text
10789 #: build/C/man3/posix_madvise.3:103
10792 #| "Addresses in the specified range are not currently mapped, or are outside "
10793 #| "the address space of the process."
10795 "Addresses in the specified range are partially or completely outside the "
10796 "caller's address space."
10798 "指定した範囲のアドレスが、現在マップされていない。 あるいはプロセスのアドレス"
10801 #. type: Plain text
10802 #: build/C/man3/posix_madvise.3:107
10803 msgid "Support for B<posix_madvise>() first appeared in glibc version 2.2."
10806 #. type: Plain text
10807 #: build/C/man3/posix_madvise.3:116
10809 "POSIX.1 permits an implementation to generate an error if I<len> is 0. On "
10810 "Linux, specifying I<len> as 0 is permitted (as a successful no-op)."
10813 #. type: Plain text
10814 #: build/C/man3/posix_madvise.3:126
10816 "In glibc, this function is implemented using B<madvise>(2). However, since "
10817 "glibc 2.6, B<POSIX_MADV_DONTNEED> is treated as a no-op, because the "
10818 "corresponding B<madvise>(2) value, B<MADV_DONTNEED>, has destructive "
10822 #. type: Plain text
10823 #: build/C/man3/posix_madvise.3:129
10825 #| msgid "B<posix_fadvise>():"
10826 msgid "B<madvise>(2), B<posix_fadvise>(2)"
10827 msgstr "B<posix_fadvise>():"
10830 #: build/C/man3/posix_memalign.3:29
10832 msgid "POSIX_MEMALIGN"
10833 msgstr "POSIX_MEMALIGN"
10835 #. type: Plain text
10836 #: build/C/man3/posix_memalign.3:32
10838 "posix_memalign, aligned_alloc, memalign, valloc, pvalloc - allocate aligned "
10841 "posix_memalign, aligned_alloc, memalign, valloc, pvalloc - アラインメント\n"
10844 #. type: Plain text
10845 #: build/C/man3/posix_memalign.3:35
10847 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
10848 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
10850 #. type: Plain text
10851 #: build/C/man3/posix_memalign.3:39
10854 "B<int posix_memalign(void **>I<memptr>B<, size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10855 "B<void *aligned_alloc(size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10856 "B<void *valloc(size_t >I<size>B<);>\n"
10858 "B<int posix_memalign(void **>I<memptr>B<, size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10859 "B<void *aligned_alloc(size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10860 "B<void *valloc(size_t >I<size>B<);>\n"
10862 #. type: Plain text
10863 #: build/C/man3/posix_memalign.3:44
10866 "B<void *memalign(size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10867 "B<void *pvalloc(size_t >I<size>B<);>\n"
10869 "B<void *memalign(size_t >I<alignment>B<, size_t >I<size>B<);>\n"
10870 "B<void *pvalloc(size_t >I<size>B<);>\n"
10872 #. type: Plain text
10873 #: build/C/man3/posix_memalign.3:54
10876 #| "B<posix_memalign>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE"
10877 #| "\\ E<gt>=\\ 600"
10878 msgid "B<posix_memalign>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
10880 "B<posix_memalign>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
10883 #. type: Plain text
10884 #: build/C/man3/posix_memalign.3:57
10885 msgid "B<aligned_alloc>(): _ISOC11_SOURCE"
10886 msgstr "B<aligned_alloc>(): _ISOC11_SOURCE"
10888 #. type: Plain text
10889 #: build/C/man3/posix_memalign.3:59
10890 msgid "B<valloc>():"
10891 msgstr "B<valloc>():"
10894 #: build/C/man3/posix_memalign.3:62
10896 msgid "Since glibc 2.12:"
10897 msgstr "glibc 2.12 以降:"
10899 #. type: Plain text
10900 #: build/C/man3/posix_memalign.3:68
10903 "(_XOPEN_SOURCE\\ E<gt>=\\ 500) && !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L)\n"
10904 " || /* Glibc since 2.19: */ _DEFAULT_SOURCE\n"
10905 " || /* Glibc versions E<lt>= 2.19: */ _SVID_SOURCE || _BSD_SOURCE\n"
10909 #: build/C/man3/posix_memalign.3:70
10911 msgid "Before glibc 2.12:"
10912 msgstr "glibc 2.12 より前:"
10914 #. || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
10915 #. type: Plain text
10916 #: build/C/man3/posix_memalign.3:74
10919 #| "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
10920 #| "_XOPEN_SOURCE_EXTENDED"
10921 msgid "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500"
10923 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
10924 "_XOPEN_SOURCE_EXTENDED"
10926 #. type: Plain text
10927 #: build/C/man3/posix_memalign.3:81
10929 "(The (nonstandard) header file I<E<lt>malloc.hE<gt>> also exposes the "
10930 "declaration of B<valloc>(); no feature test macros are required.)"
10932 "((非標準の) ヘッダーファイル I<E<lt>malloc.hE<gt>> も\n"
10933 "B<valloc>() の宣言も公開する。機能検査マクロは不要である。"
10935 #. glibc does this:
10936 #. type: Plain text
10937 #: build/C/man3/posix_memalign.3:104
10940 #| "The function B<posix_memalign>() allocates I<size> bytes and places the "
10941 #| "address of the allocated memory in I<*memptr>. The address of the "
10942 #| "allocated memory will be a multiple of I<alignment>, which must be a "
10943 #| "power of two and a multiple of I<sizeof(void\\ *)>. If I<size> is 0, "
10944 #| "then the value placed in I<*memptr> is either NULL, or a unique pointer "
10945 #| "value that can later be successfully passed to B<free>(3)."
10947 "The function B<posix_memalign>() allocates I<size> bytes and places the "
10948 "address of the allocated memory in I<*memptr>. The address of the allocated "
10949 "memory will be a multiple of I<alignment>, which must be a power of two and "
10950 "a multiple of I<sizeof(void\\ *)>. This address can later be successfully "
10951 "passed to B<free>(3). If I<size> is 0, then the value placed in I<*memptr> "
10952 "is either NULL or a unique pointer value."
10954 "関数 B<posix_memalign>() は、 I<size> バイトのメモリーを割り当て、割り当てら"
10955 "れたメモリーのアドレスを I<*memptr> に設定する。 割り当てられたメモリーのアド"
10956 "レスは I<alignment> の倍数になっているはずである。 I<alignment> は 2 のべき乗"
10957 "で、かつ I<sizeof(void\\ *)> の倍数でなければならない。 I<size> が 0 の場"
10958 "合、 I<*memptr> には NULL か一意なポインター値が書かれる。 このポインター値"
10959 "は、後で B<free>(3) に問題なく渡すことができる。"
10961 #. The behavior of memalign() for size==0 is as for posix_memalign()
10962 #. but no standards govern this.
10963 #. type: Plain text
10964 #: build/C/man3/posix_memalign.3:115
10966 "The obsolete function B<memalign>() allocates I<size> bytes and returns a "
10967 "pointer to the allocated memory. The memory address will be a multiple of "
10968 "I<alignment>, which must be a power of two."
10970 "廃止された関数である B<memalign>() は、 I<size> バイトのメモリーを割り当"
10972 "割り当てられたメモリーへのポインターを返す。 メモリーのアドレスは "
10974 "の倍数になっているはずである。 I<alignment> は 2 のべき乗でなければならない。"
10976 #. type: Plain text
10977 #: build/C/man3/posix_memalign.3:124
10979 "The function B<aligned_alloc>() is the same as B<memalign>(), except for "
10980 "the added restriction that I<size> should be a multiple of I<alignment>."
10982 "関数 B<aligned_alloc>() は B<memalign>() と同じだが、I<size> が "
10984 "の倍数でなければならないという追加の制限がある点が異なる。"
10986 #. type: Plain text
10987 #: build/C/man3/posix_memalign.3:133
10989 "The obsolete function B<valloc>() allocates I<size> bytes and returns a "
10990 "pointer to the allocated memory. The memory address will be a multiple of "
10991 "the page size. It is equivalent to I<memalign(sysconf(_SC_PAGESIZE),size)>."
10993 "廃止された関数である B<valloc>() は I<size> バイトのメモリーを割り当て、割り"
10994 "当てられたメモリーへのポインターを返す。 メモリーのアドレスはページサイズの倍"
10995 "数になっているはずである。 これは I<memalign(sysconf(_SC_PAGESIZE),size)> と"
10998 #. type: Plain text
10999 #: build/C/man3/posix_memalign.3:140
11001 "The obsolete function B<pvalloc>() is similar to B<valloc>(), but rounds "
11002 "the size of the allocation up to the next multiple of the system page size."
11004 "廃止された関数 B<pvalloc>() は B<valloc>() と同様だが、\n"
11005 "割り当てられるサイズがシステムのページサイズの倍数に切り上げられる。"
11007 #. type: Plain text
11008 #: build/C/man3/posix_memalign.3:142
11009 msgid "For all of these functions, the memory is not zeroed."
11010 msgstr "これらの関数はいずれもメモリーのゼロクリアを行わない。"
11012 #. type: Plain text
11013 #: build/C/man3/posix_memalign.3:151
11016 #| "B<aligned_alloc>(), B<memalign>(), B<valloc>(), and B<pvalloc>() return "
11017 #| "a pointer to the allocated memory, or NULL if the request fails."
11019 "B<aligned_alloc>(), B<memalign>(), B<valloc>(), and B<pvalloc>() return a "
11020 "pointer to the allocated memory on success. On error, NULL is returned, and "
11021 "I<errno> is set to indicate the cause of the error."
11023 "B<aligned_alloc>(), B<memalign>(), B<valloc>(), B<pvalloc>() は割り当てられ"
11025 "メモリーへのポインターを返す。 割り当てに失敗した場合は NULL を返す。"
11027 #. http://austingroupbugs.net/view.php?id=520
11028 #. type: Plain text
11029 #: build/C/man3/posix_memalign.3:165
11032 #| "B<posix_memalign>() returns zero on success, or one of the error values "
11033 #| "listed in the next section on failure. The value of I<errno> is "
11034 #| "indeterminate after a call to B<posix_memalign>()."
11036 "B<posix_memalign>() returns zero on success, or one of the error values "
11037 "listed in the next section on failure. The value of I<errno> is not set. "
11038 "On Linux (and other systems), B<posix_memalign>() does not modify I<memptr> "
11039 "on failure. A requirement standardizing this behavior was added in "
11040 "POSIX.1-2008 TC2."
11042 "B<posix_memalign>() は成功した場合は 0 を返し、 失敗した場合は次のセクション"
11043 "に記載されたエラー値のいずれかを返す。 B<posix_memalign>() の呼び出し後は "
11044 "I<errno> の値は不定である。"
11046 #. type: Plain text
11047 #: build/C/man3/posix_memalign.3:172
11049 "The I<alignment> argument was not a power of two, or was not a multiple of "
11050 "I<sizeof(void\\ *)>."
11052 "I<alignment> 引き数が 2 のべき乗でなかったか、 I<sizeof(void\\ *)> の倍数でな"
11055 #. type: Plain text
11056 #: build/C/man3/posix_memalign.3:175
11057 msgid "There was insufficient memory to fulfill the allocation request."
11058 msgstr "割り当て要求を満たすのに十分なメモリーがなかった。"
11060 #. type: Plain text
11061 #: build/C/man3/posix_memalign.3:182
11064 #| "The functions B<memalign>(), B<valloc>(), and B<pvalloc>() have been "
11065 #| "available in all Linux libc libraries."
11067 "The functions B<memalign>(), B<valloc>(), and B<pvalloc>() have been "
11068 "available since at least glibc 2.0."
11070 "関数 B<memalign>(), B<valloc>(), B<pvalloc>() は\n"
11071 "すべての Linux libc ライブラリで使用可能である。"
11073 #. type: Plain text
11074 #: build/C/man3/posix_memalign.3:186
11075 msgid "The function B<aligned_alloc>() was added to glibc in version 2.16."
11076 msgstr "関数 B<aligned_alloc>() は glibc バージョン 2.16 で追加された。"
11078 #. type: Plain text
11079 #: build/C/man3/posix_memalign.3:190
11080 msgid "The function B<posix_memalign>() is available since glibc 2.1.91."
11081 msgstr "関数 B<posix_fallocate>() は glibc 2.1.91 以降で利用可能である。"
11084 #: build/C/man3/posix_memalign.3:200
11086 msgid "B<aligned_alloc>(),\n"
11087 msgstr "B<aligned_alloc>(),\n"
11090 #: build/C/man3/posix_memalign.3:202
11092 msgid "B<memalign>(),\n"
11093 msgstr "B<memalign>(),\n"
11096 #: build/C/man3/posix_memalign.3:204
11098 msgid "B<posix_memalign>()"
11099 msgstr "B<posix_memalign>()"
11102 #: build/C/man3/posix_memalign.3:207
11104 msgid "B<valloc>(),\n"
11105 msgstr "B<valloc>(),\n"
11108 #: build/C/man3/posix_memalign.3:209
11110 msgid "B<pvalloc>()"
11111 msgstr "B<pvalloc>()"
11114 #: build/C/man3/posix_memalign.3:209
11116 msgid "MT-Unsafe init"
11117 msgstr "MT-Unsafe init"
11119 #. type: Plain text
11120 #: build/C/man3/posix_memalign.3:219
11123 #| "The function B<valloc>() appeared in 3.0BSD. It is documented as being "
11124 #| "obsolete in 4.3BSD, and as legacy in SUSv2. It does not appear in "
11127 "The function B<valloc>() appeared in 3.0BSD. It is documented as being "
11128 "obsolete in 4.3BSD, and as legacy in SUSv2. It does not appear in POSIX.1."
11130 "関数 B<valloc>() は 3.0BSD で登場した。4.3BSD では廃止されたと記載されてお"
11132 "SUSv2 では過去の名残だと記載されている。 POSIX.1-2001 には存在しない。"
11134 #. type: Plain text
11135 #: build/C/man3/posix_memalign.3:223
11136 msgid "The function B<pvalloc>() is a GNU extension."
11137 msgstr "関数 B<pvalloc>() は GNU による拡張である。"
11139 #. type: Plain text
11140 #: build/C/man3/posix_memalign.3:227
11141 msgid "The function B<memalign>() appears in SunOS 4.1.3 but not in 4.4BSD."
11142 msgstr "関数 B<memalign>() は SunOS 4.1.3 で登場したが、4.4BSD にはない。"
11144 #. type: Plain text
11145 #: build/C/man3/posix_memalign.3:231
11147 #| msgid "The function B<posix_memalign>() comes from POSIX.1d."
11149 "The function B<posix_memalign>() comes from POSIX.1d and is specified in "
11150 "POSIX.1-2001 and POSIX.1-2008."
11151 msgstr "関数 B<posix_memalign>() は POSIX.1d に由来する。"
11153 #. type: Plain text
11154 #: build/C/man3/posix_memalign.3:236
11155 msgid "The function B<aligned_alloc>() is specified in the C11 standard."
11156 msgstr "関数 I<aligned_alloc>() は C11 標準で規定されている。"
11159 #: build/C/man3/posix_memalign.3:236
11164 #. type: Plain text
11165 #: build/C/man3/posix_memalign.3:240
11167 "Everybody agrees that B<posix_memalign>() is declared in I<E<lt>stdlib."
11170 "B<posix_memalign>() の宣言を I<E<lt>stdlib.hE<gt>> で行うことに関しては、 皆"
11173 #. type: Plain text
11174 #: build/C/man3/posix_memalign.3:244
11176 "On some systems B<memalign>() is declared in I<E<lt>stdlib.hE<gt>> instead "
11177 "of I<E<lt>malloc.hE<gt>>."
11179 "いくつかのシステムでは、 B<memalign>() は I<E<lt>malloc.hE<gt>> ではなく "
11180 "I<E<lt>stdlib.hE<gt>> で宣言されている。"
11183 #. type: Plain text
11184 #: build/C/man3/posix_memalign.3:252
11187 #| "According to SUSv2, B<valloc>() is declared in I<E<lt>stdlib.hE<gt>>. "
11188 #| "Libc4,5 and glibc declare it in I<E<lt>malloc.hE<gt>>, and also in "
11189 #| "I<E<lt>stdlib.hE<gt>> if suitable feature test macros are defined (see "
11192 "According to SUSv2, B<valloc>() is declared in I<E<lt>stdlib.hE<gt>>. "
11193 "Glibc declares it in I<E<lt>malloc.hE<gt>>, and also in I<E<lt>stdlib."
11194 "hE<gt>> if suitable feature test macros are defined (see above)."
11196 "SUSv2 によると、 B<valloc>() は I<E<lt>stdlib.hE<gt>> で宣言される。 "
11198 "や glibc では I<E<lt>malloc.hE<gt>> で宣言されており、 さらに適切な機能検査\n"
11199 "マクロが定義された場合には I<E<lt>stdlib.hE<gt>> でも宣言される(上記を参照)。"
11201 #. type: Plain text
11202 #: build/C/man3/posix_memalign.3:261
11204 "On many systems there are alignment restrictions, for example, on buffers "
11205 "used for direct block device I/O. POSIX specifies the I<pathconf(path,"
11206 "_PC_REC_XFER_ALIGN)> call that tells what alignment is needed. Now one can "
11207 "use B<posix_memalign>() to satisfy this requirement."
11209 "多くのシステムでは、アラインメントに関して制限がある。例えば、 ブロックデバイ"
11210 "スに対するダイレクト I/O に使用するバッファーには アラインメントに関する制限"
11211 "がある。 POSIX では、どんなアラインメントが必要かを知るために "
11212 "I<pathconf(path,_PC_REC_XFER_ALIGN)> コールを規定している。ここで "
11213 "B<posix_memalign>() を使うと、この必要条件を満たすことができる。"
11215 #. type: Plain text
11216 #: build/C/man3/posix_memalign.3:270
11218 "B<posix_memalign>() verifies that I<alignment> matches the requirements "
11219 "detailed above. B<memalign>() may not check that the I<alignment> argument "
11222 "B<posix_memalign>() は I<alignment> が上で詳細に述べた必要条件を満たすか\n"
11223 "どうかを確かめる。 B<memalign>() は I<alignment> 引き数が正しいかどうかの\n"
11226 #. Other systems allow passing the result of
11231 #. .IR realloc (3).
11232 #. type: Plain text
11233 #: build/C/man3/posix_memalign.3:298
11235 "POSIX requires that memory obtained from B<posix_memalign>() can be freed "
11236 "using B<free>(3). Some systems provide no way to reclaim memory allocated "
11237 "with B<memalign>() or B<valloc>() (because one can pass to B<free>(3) "
11238 "only a pointer obtained from B<malloc>(3), while, for example, "
11239 "B<memalign>() would call B<malloc>(3) and then align the obtained value). "
11240 "The glibc implementation allows memory obtained from any of these functions "
11241 "to be reclaimed with B<free>(3)."
11243 "POSIX では B<posix_memalign>() によって獲得したメモリーは B<free>(3) を\n"
11244 "使って解放することができる必要がある。 いくつかのシステムでは\n"
11245 "B<memalign>() やB<valloc>() で割り当てられたメモリーを再利用する手段が\n"
11246 "提供されていない(なぜなら B<free>(3) に渡すことができるのは\n"
11247 "B<malloc>(3) から受け取ったポインターだけだが、例えば B<memalign>() は\n"
11248 "B<malloc>(3) を呼び出し、得た値をアラインメントしてしまうからである)。\n"
11249 "glibc の実装では、 ここに述べた関数のいずれで獲得したメモリーも\n"
11250 "B<free>(3) で再利用することができる。"
11252 #. type: Plain text
11253 #: build/C/man3/posix_memalign.3:303
11255 "The glibc B<malloc>(3) always returns 8-byte aligned memory addresses, so "
11256 "these functions are needed only if you require larger alignment values."
11258 "glibc の B<malloc>(3) は常に 8 バイトにアラインメントされたメモリーアドレス"
11260 "返すので、ここで述べた関数が必要になるのは 8 バイトよりも大きなアラインメン"
11264 #. type: Plain text
11265 #: build/C/man3/posix_memalign.3:308
11266 msgid "B<brk>(2), B<getpagesize>(2), B<free>(3), B<malloc>(3)"
11267 msgstr "B<brk>(2), B<getpagesize>(2), B<free>(3), B<malloc>(3)"
11270 #: build/C/man2/readahead.2:28
11275 #. type: Plain text
11276 #: build/C/man2/readahead.2:31
11277 msgid "readahead - initiate file readahead into page cache"
11278 msgstr "readahead - 前もってファイルをページキャッシュに読み込む"
11280 #. type: Plain text
11281 #: build/C/man2/readahead.2:37
11283 msgid "B<ssize_t readahead(int >I<fd>B<, off64_t >I<offset>B<, size_t >I<count>B<);>\n"
11284 msgstr "B<ssize_t readahead(int >I<fd>B<, off64_t >I<offset>B<, size_t >I<count>B<);>\n"
11286 #. type: Plain text
11287 #: build/C/man2/readahead.2:44
11289 "B<readahead>() initiates readahead on a file so that subsequent reads from "
11290 "that file will be satisfied from the cache, and not block on disk I/O "
11291 "(assuming the readahead was initiated early enough and that other activity "
11292 "on the system did not in the meantime flush pages from the cache)."
11294 "B<readahead>() はファイルの先読みを行い、そのファイルに対する後の読み込みが"
11295 "キャッシュから行われ、ディスク I/O で停止しないようにする (この条件を満たせる"
11296 "のは、先読みは十分早く行われ、システムの他の動作によりその後にキャッシュから"
11297 "ページがフラッシュされない場合である)。"
11299 #. type: Plain text
11300 #: build/C/man2/readahead.2:66
11303 #| "The I<fd> argument is a file descriptor identifying the file which is to "
11304 #| "be read. The I<offset> argument specifies the starting point from which "
11305 #| "data is to be read and I<count> specifies the number of bytes to be "
11306 #| "read. I/O is performed in whole pages, so that I<offset> is effectively "
11307 #| "rounded down to a page boundary and bytes are read up to the next page "
11308 #| "boundary greater than or equal to I<(offset+count)>. B<readahead>() "
11309 #| "does not read beyond the end of the file. The current file offset of the "
11310 #| "open file referred to by I<fd> is left unchanged."
11312 "The I<fd> argument is a file descriptor identifying the file which is to be "
11313 "read. The I<offset> argument specifies the starting point from which data "
11314 "is to be read and I<count> specifies the number of bytes to be read. I/O is "
11315 "performed in whole pages, so that I<offset> is effectively rounded down to a "
11316 "page boundary and bytes are read up to the next page boundary greater than "
11317 "or equal to I<(offset+count)>. B<readahead>() does not read beyond the end "
11318 "of the file. The file offset of the open file description referred to by "
11319 "the file descriptor I<fd> is left unchanged."
11321 "I<fd> 引き数は読み込みを行うファイルを識別するファイルディスクリプターであ"
11322 "る。 I<offset> 引き数はデータの読み込み開始位置を指定し、 I<count> は読み込む"
11323 "データのバイト数を指定する。 ディスク I/O はページ単位で実行されるので、 実際"
11324 "には I<offset> はページ境界に切り下げられ、読み込みバイト数は I<(offset"
11325 "+count)> より小さくない次のページ境界まで切り上げられる。 B<readahead>() は"
11326 "ファイルの末尾を越えた範囲まで読み出しを行うことはない。 I<fd> で参照された"
11327 "オープン済のファイルのファイルオフセットの現在値は 変更されない。"
11329 #. type: Plain text
11330 #: build/C/man2/readahead.2:72
11332 "On success, B<readahead>() returns 0; on failure, -1 is returned, with "
11333 "I<errno> set to indicate the cause of the error."
11335 "B<readahead>() は成功すると 0 を返す。失敗した場合 -1 を返し、 I<errno> にエ"
11338 #. type: Plain text
11339 #: build/C/man2/readahead.2:77
11340 msgid "I<fd> is not a valid file descriptor or is not open for reading."
11342 "I<fd> が有効なファイルディスクリプターでない、または 読み込み用にオープンされ"
11345 #. type: Plain text
11346 #: build/C/man2/readahead.2:83
11348 "I<fd> does not refer to a file type to which B<readahead>() can be applied."
11350 "I<fd> が参照しているファイルが、 B<readahead>() を行うことができないタイプの"
11353 #. type: Plain text
11354 #: build/C/man2/readahead.2:88
11356 "The B<readahead>() system call appeared in Linux 2.4.13; glibc support has "
11357 "been provided since version 2.3."
11359 "B<readahead>() システムコールは Linux 2.4.13 で登場した。 glibc でのサポート"
11360 "は glibc バージョン 2.3 以降で行われている。"
11362 #. type: Plain text
11363 #: build/C/man2/readahead.2:93
11365 "The B<readahead>() system call is Linux-specific, and its use should be "
11366 "avoided in portable applications."
11368 "B<readahead>() システムコールは Linux 固有であり、移植を考慮したプログラムで"
11371 #. type: Plain text
11372 #: build/C/man2/readahead.2:98
11374 "On some 32-bit architectures, the calling signature for this system call "
11375 "differs, for the reasons described in B<syscall>(2)."
11377 "いくつかの 32 ビットアーキテクチャーでは、このシステムコールの呼び出しシグネ"
11378 "チャーが違っている。 理由は B<syscall>(2) で説明されている。"
11380 #. type: Plain text
11381 #: build/C/man2/readahead.2:107
11383 "B<readahead>() attempts to schedule the reads in the background and return "
11384 "immediately. However, it may block while it reads the filesystem metadata "
11385 "needed to locate the requested blocks. This occurs frequently with ext[234] "
11386 "on large files using indirect blocks instead of extents, giving the "
11387 "appearance that the call blocks until the requested data has been read."
11389 "B<readahead>() は読み込みをバックグラウンドで行うようにスケジューリングを行"
11390 "い、すぐに返る。 しかしながら、要求されたブロックの位置を知るために必要なファ"
11391 "イルシステムのメタデータを読み込む間は B<readahead>() は停止することがある。 "
11392 "これは ext[234] で大きなファイルをエクステントではなく間接ブロックを使う場合"
11393 "にしばしば発生し、 要求したデータが読み込まれるまで呼び出しが停止しているよう"
11396 #. type: Plain text
11397 #: build/C/man2/readahead.2:113
11398 msgid "B<lseek>(2), B<madvise>(2), B<mmap>(2), B<posix_fadvise>(2), B<read>(2)"
11400 "B<lseek>(2), B<madvise>(2), B<mmap>(2), B<posix_fadvise>(2), B<read>(2)"
11403 #: build/C/man2/remap_file_pages.2:28
11405 msgid "REMAP_FILE_PAGES"
11406 msgstr "REMAP_FILE_PAGES"
11408 #. type: Plain text
11409 #: build/C/man2/remap_file_pages.2:31
11410 msgid "remap_file_pages - create a nonlinear file mapping"
11411 msgstr "remap_file_pages - 非線形ファイルマッピングを作成する。"
11413 #. type: Plain text
11414 #: build/C/man2/remap_file_pages.2:38
11417 "B<int remap_file_pages(void *>I<addr>B<, size_t >I<size>B<, int >I<prot>B<,>\n"
11418 "B< size_t >I<pgoff>B<, int >I<flags>B<);>\n"
11420 "B<int remap_file_pages(void *>I<addr>B<, size_t >I<size>B<, int >I<prot>B<,>\n"
11421 "B< size_t >I<pgoff>B<, int >I<flags>B<);>\n"
11423 #. commit 33041a0d76d3c3e0aff28ac95a2ffdedf1282dbc
11424 #. http://lwn.net/Articles/597632/
11425 #. commit c8d78c1823f46519473949d33f0d1d33fe21ea16
11426 #. type: Plain text
11427 #: build/C/man2/remap_file_pages.2:53
11429 "B<Note>: this system call was marked as deprecated starting with Linux "
11430 "3.16. In Linux 4.0, the implementation was replaced by a slower in-kernel "
11431 "emulation. Those few applications that use this system call should consider "
11432 "migrating to alternatives. This change was made because the kernel code for "
11433 "this system call was complex, and it is believed to be little used or "
11434 "perhaps even completely unused. While it had some use cases in database "
11435 "applications on 32-bit systems, those use cases don't exist on 64-bit "
11439 #. type: Plain text
11440 #: build/C/man2/remap_file_pages.2:65
11442 "The B<remap_file_pages>() system call is used to create a nonlinear "
11443 "mapping, that is, a mapping in which the pages of the file are mapped into a "
11444 "nonsequential order in memory. The advantage of using "
11445 "B<remap_file_pages>() over using repeated calls to B<mmap>(2) is that the "
11446 "former approach does not require the kernel to create additional VMA "
11447 "(Virtual Memory Area) data structures."
11449 "B<remap_file_pages>() システムコールは非線形なマッピング、 つまりファイルの"
11450 "ページがメモリー上で連続しない順番でマップされる マッピングを作成するために使"
11451 "われる。 B<remap_file_pages>() を使う方が B<mmap>(2) を繰り返して使うより優"
11452 "れている点は、 前者の方法ではカーネルが VMA (Virtual Memory Area, 仮想メモ"
11453 "リー領域) データ構造体を追加で作成する必要がないことである。"
11455 #. type: Plain text
11456 #: build/C/man2/remap_file_pages.2:67
11457 msgid "To create a nonlinear mapping we perform the following steps:"
11458 msgstr "非線形マッピングを作成するためには、 以下のようなステップを実行する:"
11461 #: build/C/man2/remap_file_pages.2:67 build/C/man2/memfd_create.2:261
11466 #. type: Plain text
11467 #: build/C/man2/remap_file_pages.2:75
11469 "Use B<mmap>(2) to create a mapping (which is initially linear). This "
11470 "mapping must be created with the B<MAP_SHARED> flag."
11472 "B<mmap>(2) を使い、マッピングを作成する (このマッピングは最初は線形であ"
11473 "る)。 このマッピングは B<MAP_SHARED> フラグを指定して作成されなければならな"
11477 #: build/C/man2/remap_file_pages.2:75 build/C/man2/memfd_create.2:267
11482 #. type: Plain text
11483 #: build/C/man2/remap_file_pages.2:83
11485 "Use one or more calls to B<remap_file_pages>() to rearrange the "
11486 "correspondence between the pages of the mapping and the pages of the file. "
11487 "It is possible to map the same page of a file into multiple locations within "
11488 "the mapped region."
11490 "B<remap_file_pages>() を 1 回以上呼び出して、 マッピングのページとファイルの"
11491 "ページの対応関係を再構成する。 ファイルの同じページをマッピング領域の複数の場"
11492 "所に マップすることが可能である。"
11494 #. type: Plain text
11495 #: build/C/man2/remap_file_pages.2:94
11497 "The I<pgoff> and I<size> arguments specify the region of the file that is to "
11498 "be relocated within the mapping: I<pgoff> is a file offset in units of the "
11499 "system page size; I<size> is the length of the region in bytes."
11501 "I<pgoff> と I<size> 引き数は、マッピング内で再配置されるファイルの領域を指定"
11502 "する。 I<pgoff> はファイルオフセットであり、単位はシステムのページサイズであ"
11503 "る。 I<size> は領域の長さであり、単位はバイトである。"
11505 #. type: Plain text
11506 #: build/C/man2/remap_file_pages.2:112
11508 "The I<addr> argument serves two purposes. First, it identifies the mapping "
11509 "whose pages we want to rearrange. Thus, I<addr> must be an address that "
11510 "falls within a region previously mapped by a call to B<mmap>(2). Second, "
11511 "I<addr> specifies the address at which the file pages identified by I<pgoff> "
11512 "and I<size> will be placed."
11514 "I<addr> 引き数は 2 つの目的で使われる。 第 1 の目的は、この引き数によって再編"
11515 "成したいページの マッピングを識別することである。 よって I<addr> は "
11516 "B<mmap>(2) の呼び出しで過去にマップされた領域内のアドレスでなければならな"
11517 "い。 第 2 の目的は、 I<pgoff> と I<size> で識別されるファイルページが置かれる"
11518 "予定のアドレスを、 I<addr> によって指定することである。"
11520 #. This rounding is weird, and not consistent with the treatment of
11521 #. the analogous arguments for munmap()/mprotect() and for mlock().
11522 #. MTK, 14 Sep 2005
11523 #. type: Plain text
11524 #: build/C/man2/remap_file_pages.2:126
11526 "The values specified in I<addr> and I<size> should be multiples of the "
11527 "system page size. If they are not, then the kernel rounds I<both> values "
11528 "I<down> to the nearest multiple of the page size."
11530 "I<addr> と I<size> に指定する値は、システムのページサイズの倍数とすべきであ"
11531 "る。 それ以外の場合、カーネルは「両方」の値を 最も近いページサイズの倍数へ"
11534 #. type: Plain text
11535 #: build/C/man2/remap_file_pages.2:130
11536 msgid "The I<prot> argument must be specified as 0."
11537 msgstr "I<prot> 引き数は 0 に指定されなければならない。"
11539 #. type: Plain text
11540 #: build/C/man2/remap_file_pages.2:138
11542 "The I<flags> argument has the same meaning as for B<mmap>(2), but all flags "
11543 "other than B<MAP_NONBLOCK> are ignored."
11545 "I<flags> 引き数は B<mmap>(2) のものと同じ意味であるが、 B<MAP_NONBLOCK> 以外"
11548 #. type: Plain text
11549 #: build/C/man2/remap_file_pages.2:145
11551 "On success, B<remap_file_pages>() returns 0. On error, -1 is returned, and "
11552 "I<errno> is set appropriately."
11554 "成功した場合、 B<remap_file_pages>() は 0 を返す。 エラーの場合、-1 が返さ"
11555 "れ、 I<errno> が適切に設定される。"
11557 #. type: Plain text
11558 #: build/C/man2/remap_file_pages.2:153
11560 "I<addr> does not refer to a valid mapping created with the B<MAP_SHARED> "
11563 "I<addr> が B<MAP_SHARED> フラグを指定して作成された有効なマッピングを参照して"
11566 #. And possibly others from vma->vm_ops->populate()
11567 #. type: Plain text
11568 #: build/C/man2/remap_file_pages.2:162
11569 msgid "I<addr>, I<size>, I<prot>, or I<pgoff> is invalid."
11570 msgstr "I<addr>, I<size>, I<prot>, I<pgoff> のいずれかが不正である。"
11572 #. type: Plain text
11573 #: build/C/man2/remap_file_pages.2:167
11575 "The B<remap_file_pages>() system call appeared in Linux 2.5.46; glibc "
11576 "support was added in version 2.3.3."
11578 "B<remap_file_pages>() システムコールは Linux 2.5.46 で登場した。 glibc での"
11579 "サポートは glibc バージョン 2.3.3 で追加された。"
11581 #. type: Plain text
11582 #: build/C/man2/remap_file_pages.2:171
11583 msgid "The B<remap_file_pages>() system call is Linux-specific."
11584 msgstr "B<remap_file_pages>() システムコールは Linux 固有のものである。"
11586 #. commit 3ee6dafc677a68e461a7ddafc94a580ebab80735
11587 #. type: Plain text
11588 #: build/C/man2/remap_file_pages.2:184
11591 #| "Since Linux 2.6.23, B<remap_file_pages>() creates non-linear mappings "
11592 #| "only on in-memory file systems such as tmpfs, hugetlbfs or ramfs. On "
11593 #| "filesystems with a backing store, B<remap_file_pages>() is not much more "
11594 #| "efficient than using B<mmap>(2) to adjust which parts of the file are "
11595 #| "mapped to which addresses."
11597 "Since Linux 2.6.23, B<remap_file_pages>() creates non-linear mappings only "
11598 "on in-memory filesystems such as B<tmpfs>(5), hugetlbfs or ramfs. On "
11599 "filesystems with a backing store, B<remap_file_pages>() is not much more "
11600 "efficient than using B<mmap>(2) to adjust which parts of the file are "
11601 "mapped to which addresses."
11603 "Linux 2.6.23 以降、 B<remap_file_pages>() は tmpfs, hugetlbfs, ramfs などのイ"
11604 "ンメモリーファイルシステム上にのみ非線形マッピングを作成する。 裏にデータスト"
11605 "アを持つファイルシステム上では、 B<remap_file_pages>() は、 ファイルのどの部"
11606 "分がどのアドレスにマッピングされているかの調整が、 B<mmap>(2) を使った場合ほ"
11609 #. type: Plain text
11610 #: build/C/man2/remap_file_pages.2:191
11612 "B<getpagesize>(2), B<mmap>(2), B<mmap2>(2), B<mprotect>(2), B<mremap>(2), "
11615 "B<getpagesize>(2), B<mmap>(2), B<mmap2>(2), B<mprotect>(2), B<mremap>(2), "
11619 #: build/C/man3/shm_open.3:25
11624 #. type: Plain text
11625 #: build/C/man3/shm_open.3:28
11627 "shm_open, shm_unlink - create/open or unlink POSIX shared memory objects"
11629 "shm_open, shm_unlink - POSIX 共有メモリーオブジェクトの作成/オープン/削除を行"
11632 #. type: Plain text
11633 #: build/C/man3/shm_open.3:32
11634 msgid "B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */"
11635 msgstr "B<#include E<lt>sys/stat.hE<gt>> /* mode 定数用 */"
11637 #. type: Plain text
11638 #: build/C/man3/shm_open.3:34
11639 msgid "B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */"
11640 msgstr "B<#include E<lt>fcntl.hE<gt>> /* O_* 定数の定義用 */"
11642 #. type: Plain text
11643 #: build/C/man3/shm_open.3:36
11645 "B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>"
11647 "B<int shm_open(const char *>I<name>B<, int >I<oflag>B<, mode_t >I<mode>B<);>"
11649 #. type: Plain text
11650 #: build/C/man3/shm_open.3:38
11651 msgid "B<int shm_unlink(const char *>I<name>B<);>"
11652 msgstr "B<int shm_unlink(const char *>I<name>B<);>"
11654 #. type: Plain text
11655 #: build/C/man3/shm_open.3:40
11656 msgid "Link with I<-lrt>."
11657 msgstr "I<-lrt> でリンクする。"
11659 #. type: Plain text
11660 #: build/C/man3/shm_open.3:52
11662 "B<shm_open>() creates and opens a new, or opens an existing, POSIX shared "
11663 "memory object. A POSIX shared memory object is in effect a handle which can "
11664 "be used by unrelated processes to B<mmap>(2) the same region of shared "
11665 "memory. The B<shm_unlink>() function performs the converse operation, "
11666 "removing an object previously created by B<shm_open>()."
11668 "B<shm_open>() は、POSIX 共有メモリーオブジェクトを新規に作成/オープンした"
11669 "り、 すでに存在するオブジェクトをオープンしたりする。 POSIX 共有メモリーオブ"
11670 "ジェクトは、実際には、関係のないプロセスが 共有メモリーの同じ領域を "
11671 "B<mmap>(2) するために使用することができる手段である。 B<shm_unlink>() は、"
11672 "逆の操作、つまり以前に B<shm_open>() で作成されたオブジェクトの削除を行う。"
11674 #. glibc allows the initial slash to be omitted, and makes
11675 #. multiple initial slashes equivalent to a single slash.
11676 #. This differs from the implementation of POSIX message queues.
11677 #. glibc allows subdirectory components in the name, in which
11678 #. case the subdirectory must exist under /dev/shm, and allow the
11679 #. required permissions if a user wants to create a shared memory
11680 #. object in that subdirectory.
11681 #. type: Plain text
11682 #: build/C/man3/shm_open.3:73
11684 "The operation of B<shm_open>() is analogous to that of B<open>(2). I<name> "
11685 "specifies the shared memory object to be created or opened. For portable "
11686 "use, a shared memory object should be identified by a name of the form I</"
11687 "somename>; that is, a null-terminated string of up to B<NAME_MAX> (i.e., "
11688 "255) characters consisting of an initial slash, followed by one or more "
11689 "characters, none of which are slashes."
11691 "B<shm_open>() の動作は B<open>(2) とよく似ている。 I<name> で作成したりオー"
11692 "プンしたりする共有メモリーオブジェクトを指定する。 移植性を持たせるためには、"
11693 "共有メモリーオブジェクトは I</somename> という形式の名前で識別し、 その名前"
11694 "は、最大で B<NAME_MAX> (すなわち 255) 文字のヌル終端された文字列で、 スラッ"
11695 "シュで始まり、スラッシュ以外の文字が 1 文字以上続く形式 にすべきである。"
11697 #. type: Plain text
11698 #: build/C/man3/shm_open.3:80
11700 "I<oflag> is a bit mask created by ORing together exactly one of B<O_RDONLY> "
11701 "or B<O_RDWR> and any of the other flags listed here:"
11703 "I<oflag> はビットマスクで、 B<O_RDONLY> と B<O_RDWR> のいずれか一方と、以下に"
11704 "述べる他のフラグの論理和をとったもの を指定する。"
11707 #: build/C/man3/shm_open.3:80
11709 msgid "B<O_RDONLY>"
11710 msgstr "B<O_RDONLY>"
11712 #. type: Plain text
11713 #: build/C/man3/shm_open.3:88
11715 "Open the object for read access. A shared memory object opened in this way "
11716 "can be B<mmap>(2)ed only for read (B<PROT_READ>) access."
11718 "読み出しアクセス用にオブジェクトをオープンする。 このフラグを指定してオープン"
11719 "された共有メモリーオブジェクトは、 読み出し (B<PROT_READ>) アクセスでのみ "
11720 "B<mmap>(2) することができる。"
11723 #: build/C/man3/shm_open.3:88
11728 #. type: Plain text
11729 #: build/C/man3/shm_open.3:91
11730 msgid "Open the object for read-write access."
11731 msgstr "読み書きアクセス用にオブジェクトをオープンする。"
11734 #: build/C/man3/shm_open.3:91
11737 msgstr "B<O_CREAT>"
11739 #. In truth it is actually the filesystem IDs on Linux, but these
11740 #. are nearly always the same as the effective IDs. (MTK, Jul 05)
11741 #. type: Plain text
11742 #: build/C/man3/shm_open.3:111
11744 "Create the shared memory object if it does not exist. The user and group "
11745 "ownership of the object are taken from the corresponding effective IDs of "
11746 "the calling process, and the object's permission bits are set according to "
11747 "the low-order 9 bits of I<mode>, except that those bits set in the process "
11748 "file mode creation mask (see B<umask>(2)) are cleared for the new object. "
11749 "A set of macro constants which can be used to define I<mode> is listed in "
11750 "B<open>(2). (Symbolic definitions of these constants can be obtained by "
11751 "including I<E<lt>sys/stat.hE<gt>>.)"
11753 "存在しない場合、共有メモリーオブジェクトを作成する。 オブジェクトのユーザーと"
11754 "グループの所有権は、 呼び出し元プロセスの対応する実効 ID が使われ、 オブジェ"
11755 "クトの許可ビットは I<mode> の下位 9 ビットに基づいて設定される。ただし、 ファ"
11756 "イルモード作成マスク (B<umask>(2) 参照) に設定されている値は、新規オブジェク"
11757 "トに関してはクリアされる。 I<mode> を定義するために使用できるマクロ定数(群)"
11758 "は B<open>(2) に記載されている (これらの定数のシンボル定義は I<E<lt>sys/"
11759 "stat.hE<gt>> のインクルードにより得られる)。"
11761 #. type: Plain text
11762 #: build/C/man3/shm_open.3:117
11764 "A new shared memory object initially has zero length\\(emthe size of the "
11765 "object can be set using B<ftruncate>(2). The newly allocated bytes of a "
11766 "shared memory object are automatically initialized to 0."
11768 "新規に作成された共有メモリーオブジェクトは長さ 0 で初期化される。 オブジェク"
11769 "トの大きさは B<ftruncate>(2) を使って設定できる。 共有メモリーオブジェクトと"
11770 "して新規に確保されたバイトは自動的に 0 に初期化される。"
11773 #: build/C/man3/shm_open.3:117
11778 #. type: Plain text
11779 #: build/C/man3/shm_open.3:126
11781 "If B<O_CREAT> was also specified, and a shared memory object with the given "
11782 "I<name> already exists, return an error. The check for the existence of the "
11783 "object, and its creation if it does not exist, are performed atomically."
11785 "B<O_CREAT> が一緒に指定されており、 I<name> で指定された共有メモリーオブジェ"
11786 "クトが既に存在した場合、 エラーを返す。 オブジェクトの存在確認と、存在しな"
11787 "かった場合のオブジェクト作成は、 必ず一連の操作として実行される (performed "
11791 #: build/C/man3/shm_open.3:126
11794 msgstr "B<O_TRUNC>"
11796 #. type: Plain text
11797 #: build/C/man3/shm_open.3:129
11798 msgid "If the shared memory object already exists, truncate it to zero bytes."
11800 "共有メモリーオブジェクトがすでに存在した場合、 そのオブジェクトを 0 バイトに"
11803 #. type: Plain text
11804 #: build/C/man3/shm_open.3:132
11806 "Definitions of these flag values can be obtained by including I<E<lt>fcntl."
11809 "これらのフラグ値の定義は I<E<lt>fcntl.hE<gt>> のインクルードにより得られる。"
11811 #. type: Plain text
11812 #: build/C/man3/shm_open.3:143
11814 "On successful completion B<shm_open>() returns a new file descriptor "
11815 "referring to the shared memory object. This file descriptor is guaranteed "
11816 "to be the lowest-numbered file descriptor not previously opened within the "
11817 "process. The B<FD_CLOEXEC> flag (see B<fcntl>(2)) is set for the file "
11820 "成功して完了した場合、 B<shm_open>() は共有メモリーオブジェクトを参照する新"
11821 "しいファイルディスクリプターを返す。 このファイルディスクリプターは、そのプロ"
11822 "セス内で過去にオープンされていない ファイルディスクリプターの中で最も小さな数"
11823 "になることが保証される。 B<FD_CLOEXEC> フラグ (B<fcntl>(2) を参照) が、この"
11824 "ファイルディスクリプターに設定される。"
11826 #. type: Plain text
11827 #: build/C/man3/shm_open.3:152
11829 "The file descriptor is normally used in subsequent calls to B<ftruncate>(2) "
11830 "(for a newly created object) and B<mmap>(2). After a call to B<mmap>(2) "
11831 "the file descriptor may be closed without affecting the memory mapping."
11833 "通常、これらのファイルディスクリプターは、この後続けて実行される "
11834 "B<ftruncate>(2) (新規に作成されたオブジェクトの場合のみ) と B<mmap>(2) の呼"
11835 "び出しに使用される。 B<mmap>(2) を呼び出した後は、ファイルディスクリプターを"
11836 "クローズしてもよく、 クローズしてもメモリーマッピングに影響を与えることはな"
11839 #. type: Plain text
11840 #: build/C/man3/shm_open.3:170
11843 #| "The operation of B<shm_unlink>() is analogous to B<unlink>(2): it "
11844 #| "removes a shared memory object name, and, once all processes have "
11845 #| "unmapped the object, de-allocates and destroys the contents of the "
11846 #| "associated memory region. After a successful B<shm_unlink>(), attempts "
11847 #| "to B<shm_open>() an object with the same I<name> will fail (unless "
11848 #| "B<O_CREAT> was specified, in which case a new, distinct object is "
11851 "The operation of B<shm_unlink>() is analogous to B<unlink>(2): it removes a "
11852 "shared memory object name, and, once all processes have unmapped the object, "
11853 "de-allocates and destroys the contents of the associated memory region. "
11854 "After a successful B<shm_unlink>(), attempts to B<shm_open>() an object "
11855 "with the same I<name> fail (unless B<O_CREAT> was specified, in which case a "
11856 "new, distinct object is created)."
11858 "B<shm_unlink>() の動作は B<unlink>(2) とよく似ている: 共有メモリーオブジェ"
11859 "クト名を削除し、すべてのプロセスが処理対象の オブジェクトをアンマップした時点"
11860 "でオブジェクトの割り当てを解除し、 対応するメモリー領域の内容を破棄する。 "
11861 "B<shm_unlink>() が成功した後で、同じ I<name> を持つオブジェクトに対して "
11862 "B<shm_open>() を行うと、 (B<O_CREAT> が指定されていない場合) 失敗する。 "
11863 "(B<O_CREAT> が指定されている場合、新しく別のオブジェクトが作成される)。"
11865 #. type: Plain text
11866 #: build/C/man3/shm_open.3:179
11869 #| "On success, B<shm_open>() returns a nonnegative file descriptor. On "
11870 #| "failure, B<shm_open>() returns -1. B<shm_unlink>() returns 0 on "
11871 #| "success, or -1 on error."
11873 "On success, B<shm_open>() returns a file descriptor (a nonnegative "
11874 "integer). On failure, B<shm_open>() returns -1. B<shm_unlink>() returns "
11875 "0 on success, or -1 on error."
11877 "成功した場合、 B<shm_open>() は非負のファイルディスクリプターを返す。 失敗し"
11878 "た場合、 B<shm_open>() は -1 を返す。 B<shm_unlink>() は、成功した場合 0 "
11879 "を、エラーが起こった場合 -1 を返す。"
11881 #. type: Plain text
11882 #: build/C/man3/shm_open.3:186
11884 "On failure, I<errno> is set to indicate the cause of the error. Values "
11885 "which may appear in I<errno> include the following:"
11887 "失敗した場合、エラーの原因を示すため I<errno> が設定される。 I<errno> に設定"
11890 #. type: Plain text
11891 #: build/C/man3/shm_open.3:191
11892 msgid "Permission to B<shm_unlink>() the shared memory object was denied."
11893 msgstr "共有メモリーオブジェクトを B<shm_unlink>() する権限がなかった。"
11895 #. type: Plain text
11896 #: build/C/man3/shm_open.3:201
11898 "Permission was denied to B<shm_open>() I<name> in the specified I<mode>, or "
11899 "B<O_TRUNC> was specified and the caller does not have write permission on "
11902 "指定された I<mode> で I<name> を B<shm_open>() する権限がなかった。もしく"
11903 "は、 B<O_TRUNC> が指定されたが、呼び出し元にはそのオブジェクトに対する書き込"
11906 #. type: Plain text
11907 #: build/C/man3/shm_open.3:212
11909 "Both B<O_CREAT> and B<O_EXCL> were specified to B<shm_open>() and the "
11910 "shared memory object specified by I<name> already exists."
11912 "B<O_CREAT> と B<O_EXCL> の両方が B<shm_open>() に指定されたが、 I<name> で指"
11913 "定された共有メモリーオブジェクトが既に存在した。"
11915 #. type: Plain text
11916 #: build/C/man3/shm_open.3:219
11917 msgid "The I<name> argument to B<shm_open>() was invalid."
11918 msgstr "B<shm_open>() に与えられた I<name> 引き数が不正であった。"
11921 #: build/C/man3/shm_open.3:219 build/C/man2/memfd_create.2:190
11926 #. type: Plain text
11927 #: build/C/man3/shm_open.3:222 build/C/man2/memfd_create.2:193
11929 #| msgid "The per-process limit on open file descriptors has been reached."
11931 "The per-process limit on the number of open file descriptors has been "
11934 "オープンされているファイルディスクリプターのプロセス単位の上限に達した。"
11937 #: build/C/man3/shm_open.3:222
11939 msgid "B<ENAMETOOLONG>"
11940 msgstr "B<ENAMETOOLONG>"
11942 #. type: Plain text
11943 #: build/C/man3/shm_open.3:228
11944 msgid "The length of I<name> exceeds B<PATH_MAX>."
11945 msgstr "I<name> の長さが B<PATH_MAX> を越えている。"
11948 #: build/C/man3/shm_open.3:231 build/C/man3/shm_open.3:240
11949 #: build/C/man2/shmget.2:257
11954 #. type: Plain text
11955 #: build/C/man3/shm_open.3:240
11957 "An attempt was made to B<shm_open>() a I<name> that did not exist, and "
11958 "B<O_CREAT> was not specified."
11960 "存在していない I<name> のオブジェクトを B<shm_open>() しようとしたが、 "
11961 "B<O_CREAT> が指定されていなかった。"
11963 #. type: Plain text
11964 #: build/C/man3/shm_open.3:247
11966 "An attempt was to made to B<shm_unlink>() a I<name> that does not exist."
11967 msgstr "存在しない I<name> のオブジェクトを B<shm_unlink>() しようとした。"
11969 #. type: Plain text
11970 #: build/C/man3/shm_open.3:249
11971 msgid "These functions are provided in glibc 2.2 and later."
11972 msgstr "これらの関数は glibc 2.2 以降で提供されている。"
11975 #: build/C/man3/shm_open.3:260
11977 #| msgid "B<shm_unlink>(3)"
11981 msgstr "B<shm_unlink>(3)"
11984 #: build/C/man3/shm_open.3:260
11986 msgid "MT-Safe locale"
11987 msgstr "MT-Safe locale"
11989 #. type: Plain text
11990 #: build/C/man3/shm_open.3:273
11993 #| "POSIX.1-2001 says that the group ownership of a newly created shared "
11994 #| "memory object is set to either the calling process's effective group ID "
11995 #| "or \"a system default group ID\"."
11997 "POSIX.1-2001 says that the group ownership of a newly created shared memory "
11998 "object is set to either the calling process's effective group ID or \"a "
11999 "system default group ID\". POSIX.1-2008 says that the group ownership may "
12000 "be set to either the calling process's effective group ID or, if the object "
12001 "is visible in the filesystem, the group ID of the parent directory."
12003 "POSIX.1-2001 には、新規に作成される共有メモリーオブジェクトのグループ所有権"
12004 "は、 呼び出し元プロセスの実効グループ ID か 「システムのデフォルトのグループ "
12005 "ID」 のどちらかに設定される、と書かれている。"
12007 #. type: Plain text
12008 #: build/C/man3/shm_open.3:281
12010 "POSIX leaves the behavior of the combination of B<O_RDONLY> and B<O_TRUNC> "
12011 "unspecified. On Linux, this will successfully truncate an existing shared "
12012 "memory object\\(emthis may not be so on other UNIX systems."
12014 "POSIX は B<O_RDONLY> と B<O_TRUNC> が一緒に指定された場合の動作を未定義にして"
12015 "いる。Linux では、 既存の共有メモリーオブジェクトに対する切り詰め (truncate) "
12016 "は成功する。 しかし、他の UNIX システムでも同じであるとは限らない。"
12018 #. type: Plain text
12019 #: build/C/man3/shm_open.3:287
12022 #| "The POSIX shared memory object implementation on Linux 2.4 makes use of a "
12023 #| "dedicated filesystem, which is normally mounted under I</dev/shm>."
12025 "The POSIX shared memory object implementation on Linux makes use of a "
12026 "dedicated B<tmpfs>(5) filesystem that is normally mounted under I</dev/shm>."
12028 "Linux 2.4 における POSIX 共有メモリーオブジェクトの実装は 専用のファイルシス"
12029 "テムを使用する。そのファイルシステムは通常 I</dev/shm> にマウントされる。"
12031 #. type: Plain text
12032 #: build/C/man3/shm_open.3:295
12034 "The programs below employ POSIX shared memory and POSIX unnamed semaphores "
12035 "to exchange a piece of data. The \"bounce\" program (which must be run "
12036 "first) raises the case of a string that is placed into the shared memory by "
12037 "the \"send\" program. Once the data has been modified, the \"send\" program "
12038 "then prints the contents of the modified shared memory. An example "
12039 "execution of the two programs is the following:"
12042 #. type: Plain text
12043 #: build/C/man3/shm_open.3:302
12046 "$ B<./pshm_ucase_bounce /myshm &>\n"
12048 "$ B<./pshm_ucase_send /myshm hello>\n"
12052 #. type: Plain text
12053 #: build/C/man3/shm_open.3:307
12054 msgid "Further detail about these programs is provided below."
12058 #: build/C/man3/shm_open.3:307
12060 #| msgid "Program source: t_memfd_create.c"
12061 msgid "Program source: pshm_ucase.h"
12062 msgstr "プログラムのソース: t_memfd_create.c"
12064 #. type: Plain text
12065 #: build/C/man3/shm_open.3:311
12067 "The following header file is included by both programs below. Its primary "
12068 "purpose is to define a structure that will be imposed on the memory object "
12069 "that is shared between the two programs."
12072 #. type: Plain text
12073 #: build/C/man3/shm_open.3:321
12076 #| "#include E<lt>sys/mman.hE<gt>\n"
12077 #| "#include E<lt>sys/stat.hE<gt>\n"
12078 #| "#include E<lt>fcntl.hE<gt>\n"
12079 #| "#include E<lt>stdio.hE<gt>\n"
12080 #| "#include E<lt>stdlib.hE<gt>\n"
12081 #| "#include E<lt>unistd.hE<gt>\n"
12083 "#include E<lt>sys/mman.hE<gt>\n"
12084 "#include E<lt>fcntl.hE<gt>\n"
12085 "#include E<lt>semaphore.hE<gt>\n"
12086 "#include E<lt>sys/stat.hE<gt>\n"
12087 "#include E<lt>stdio.hE<gt>\n"
12088 "#include E<lt>stdlib.hE<gt>\n"
12089 "#include E<lt>unistd.hE<gt>\n"
12091 "#include E<lt>sys/mman.hE<gt>\n"
12092 "#include E<lt>sys/stat.hE<gt>\n"
12093 "#include E<lt>fcntl.hE<gt>\n"
12094 "#include E<lt>stdio.hE<gt>\n"
12095 "#include E<lt>stdlib.hE<gt>\n"
12096 "#include E<lt>unistd.hE<gt>\n"
12098 #. type: Plain text
12099 #: build/C/man3/shm_open.3:326
12101 msgid "#define BUF_SIZE 1024 /* Maximum size for exchanged string */\n"
12104 #. type: Plain text
12105 #: build/C/man3/shm_open.3:329
12108 "/* Define a structure that will be imposed on the shared\n"
12109 " memory object */\n"
12112 #. type: Plain text
12113 #: build/C/man3/shm_open.3:336
12116 "struct shmbuf {\n"
12117 " sem_t sem1; /* POSIX unnamed semaphore */\n"
12118 " sem_t sem2; /* POSIX unnamed semaphore */\n"
12119 " size_t cnt; /* Number of bytes used in \\(aqbuf\\(aq */\n"
12120 " char buf[BUF_SIZE]; /* Data being transferred */\n"
12125 #: build/C/man3/shm_open.3:339
12127 #| msgid "Program source: t_get_seals.c"
12128 msgid "Program source: pshm_ucase_bounce.c"
12129 msgstr "プログラムのソース: t_get_seals.c"
12131 #. type: Plain text
12132 #: build/C/man3/shm_open.3:347
12134 "The \"bounce\" program creates a new shared memory object with the name "
12135 "given in its command-line argument and sizes the object to match the size of "
12136 "the I<shmbuf> structure defined in the header file. It then maps the object "
12137 "into the process's address space, and initializes two POSIX semaphores "
12138 "inside the object to 0."
12141 #. type: Plain text
12142 #: build/C/man3/shm_open.3:352
12144 "After the \"send\" program has posted the first of the semaphores, the "
12145 "\"bounce\" program upper cases the data that has been placed in the memory "
12146 "by the \"send\" program and then posts the second semaphore to tell the "
12147 "\"send\" program that it may now access the shared memory."
12150 #. type: Plain text
12151 #: build/C/man3/shm_open.3:356
12153 msgid "/* pshm_ucase_bounce.c\n"
12156 #. type: Plain text
12157 #: build/C/man3/shm_open.3:361
12160 " Licensed under GNU General Public License v2 or later.\n"
12162 "#include E<lt>ctype.hE<gt>\n"
12163 "#include \"pshm_ucase.h\"\n"
12166 #. type: Plain text
12167 #: build/C/man3/shm_open.3:369
12170 #| " if (argc != 2) {\n"
12171 #| " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
12172 #| " exit(EXIT_FAILURE);\n"
12176 "main(int argc, char *argv[])\n"
12178 " if (argc != 2) {\n"
12179 " fprintf(stderr, \"Usage: %s /shm-path\\en\", argv[0]);\n"
12180 " exit(EXIT_FAILURE);\n"
12183 " if (argc != 2) {\n"
12184 " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
12185 " exit(EXIT_FAILURE);\n"
12188 #. type: Plain text
12189 #: build/C/man3/shm_open.3:371
12191 msgid " char *shmpath = argv[1];\n"
12194 #. type: Plain text
12195 #: build/C/man3/shm_open.3:374
12198 " /* Create shared memory object and set its size to the size\n"
12199 " of our structure */\n"
12202 #. type: Plain text
12203 #: build/C/man3/shm_open.3:379
12206 #| " fd = open(argv[1], O_RDWR);\n"
12207 #| " if (fd == -1)\n"
12208 #| " errExit(\"open\");\n"
12210 " int fd = shm_open(shmpath, O_CREAT | O_EXCL | O_RDWR,\n"
12211 " S_IRUSR | S_IWUSR);\n"
12213 " errExit(\"shm_open\");\n"
12215 " fd = open(argv[1], O_RDWR);\n"
12217 " errExit(\"open\");\n"
12219 #. type: Plain text
12220 #: build/C/man3/shm_open.3:382
12223 #| " if (ftruncate(fd, len) == -1)\n"
12224 #| " errExit(\"truncate\");\n"
12226 " if (ftruncate(fd, sizeof(struct shmbuf)) == -1)\n"
12227 " errExit(\"ftruncate\");\n"
12229 " if (ftruncate(fd, len) == -1)\n"
12230 " errExit(\"truncate\");\n"
12232 #. type: Plain text
12233 #: build/C/man3/shm_open.3:384
12235 msgid " /* Map the object into the caller\\(aqs address space */\n"
12238 #. type: Plain text
12239 #: build/C/man3/shm_open.3:390 build/C/man3/shm_open.3:479
12242 #| " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
12243 #| " MAP_PRIVATE, fd, pa_offset);\n"
12244 #| " if (addr == MAP_FAILED)\n"
12245 #| " handle_error(\"mmap\");\n"
12247 " struct shmbuf *shmp = mmap(NULL, sizeof(*shmp),\n"
12248 " PROT_READ | PROT_WRITE,\n"
12249 " MAP_SHARED, fd, 0);\n"
12250 " if (shmp == MAP_FAILED)\n"
12251 " errExit(\"mmap\");\n"
12253 " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
12254 " MAP_PRIVATE, fd, pa_offset);\n"
12255 " if (addr == MAP_FAILED)\n"
12256 " handle_error(\"mmap\");\n"
12258 #. type: Plain text
12259 #: build/C/man3/shm_open.3:392
12261 msgid " /* Initialize semaphores as process-shared, with value 0 */\n"
12264 #. type: Plain text
12265 #: build/C/man3/shm_open.3:397
12268 " if (sem_init(&shmp-E<gt>sem1, 1, 0) == -1)\n"
12269 " errExit(\"sem_init-sem1\");\n"
12270 " if (sem_init(&shmp-E<gt>sem2, 1, 0) == -1)\n"
12271 " errExit(\"sem_init-sem2\");\n"
12274 #. type: Plain text
12275 #: build/C/man3/shm_open.3:400
12278 " /* Wait for \\(aqsem1\\(aq to be posted by peer before touching\n"
12279 " shared memory */\n"
12282 #. type: Plain text
12283 #: build/C/man3/shm_open.3:403
12286 #| " if (ftruncate(fd, len) == -1)\n"
12287 #| " errExit(\"truncate\");\n"
12289 " if (sem_wait(&shmp-E<gt>sem1) == -1)\n"
12290 " errExit(\"sem_wait\");\n"
12292 " if (ftruncate(fd, len) == -1)\n"
12293 " errExit(\"truncate\");\n"
12295 #. type: Plain text
12296 #: build/C/man3/shm_open.3:405
12298 msgid " /* Convert data in shared memory into upper case */\n"
12301 #. type: Plain text
12302 #: build/C/man3/shm_open.3:408
12305 " for (int j = 0; j E<lt> shmp-E<gt>cnt; j++)\n"
12306 " shmp-E<gt>buf[j] = toupper((unsigned char) shmp-E<gt>buf[j]);\n"
12309 #. type: Plain text
12310 #: build/C/man3/shm_open.3:411
12313 " /* Post \\(aqsem2\\(aq to tell the to tell peer that it can now\n"
12314 " access the modified data in shared memory */\n"
12317 #. type: Plain text
12318 #: build/C/man3/shm_open.3:414
12321 #| " if (ftruncate(fd, len) == -1)\n"
12322 #| " errExit(\"truncate\");\n"
12324 " if (sem_post(&shmp-E<gt>sem2) == -1)\n"
12325 " errExit(\"sem_post\");\n"
12327 " if (ftruncate(fd, len) == -1)\n"
12328 " errExit(\"truncate\");\n"
12330 #. type: Plain text
12331 #: build/C/man3/shm_open.3:418
12334 " /* Unlink the shared memory object. Even if the peer process\n"
12335 " is still using the object, this is okay. The object will\n"
12336 " be removed only after all open references are closed. */\n"
12339 #. type: Plain text
12340 #: build/C/man3/shm_open.3:420
12342 msgid " shm_unlink(shmpath);\n"
12346 #: build/C/man3/shm_open.3:426
12348 #| msgid "Program source: t_get_seals.c"
12349 msgid "Program source: pshm_ucase_send.c"
12350 msgstr "プログラムのソース: t_get_seals.c"
12352 #. type: Plain text
12353 #: build/C/man3/shm_open.3:430
12355 "The \"send\" program takes two command-line arguments: the pathname of a "
12356 "shared memory object previously created by the \"bounce\" program and a "
12357 "string that is to be copied into that object."
12360 #. type: Plain text
12361 #: build/C/man3/shm_open.3:440
12363 "The program opens the shared memory object and maps the object into its "
12364 "address space. It then copies the data specified in its second argument "
12365 "into the shared memory, and posts the first semaphore, which tells the "
12366 "\"bounce\" program that it can now access that data. After the \"bounce\" "
12367 "program posts the second semaphore, the \"send\" program prints the contents "
12368 "of the shared memory on standard output."
12371 #. type: Plain text
12372 #: build/C/man3/shm_open.3:444
12374 msgid "/* pshm_ucase_send.c\n"
12377 #. type: Plain text
12378 #: build/C/man3/shm_open.3:449
12381 " Licensed under GNU General Public License v2 or later.\n"
12383 "#include E<lt>string.hE<gt>\n"
12384 "#include \"pshm_ucase.h\"\n"
12387 #. type: Plain text
12388 #: build/C/man3/shm_open.3:457
12391 #| " if (argc != 2) {\n"
12392 #| " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
12393 #| " exit(EXIT_FAILURE);\n"
12397 "main(int argc, char *argv[])\n"
12399 " if (argc != 3) {\n"
12400 " fprintf(stderr, \"Usage: %s /shm-path string\\en\", argv[0]);\n"
12401 " exit(EXIT_FAILURE);\n"
12404 " if (argc != 2) {\n"
12405 " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
12406 " exit(EXIT_FAILURE);\n"
12409 #. type: Plain text
12410 #: build/C/man3/shm_open.3:461
12413 #| " name = argv[1];\n"
12414 #| " len = atoi(argv[2]);\n"
12415 #| " seals_arg = argv[3];\n"
12417 " char *shmpath = argv[1];\n"
12418 " char *string = argv[2];\n"
12419 " size_t len = strlen(string);\n"
12421 " name = argv[1];\n"
12422 " len = atoi(argv[2]);\n"
12423 " seals_arg = argv[3];\n"
12425 #. type: Plain text
12426 #: build/C/man3/shm_open.3:466
12429 #| " if (offset E<gt>= sb.st_size) {\n"
12430 #| " fprintf(stderr, \"offset is past end of file\\en\");\n"
12431 #| " exit(EXIT_FAILURE);\n"
12434 " if (len E<gt> BUF_SIZE) {\n"
12435 " fprintf(stderr, \"String is too long\\en\");\n"
12436 " exit(EXIT_FAILURE);\n"
12439 " if (offset E<gt>= sb.st_size) {\n"
12440 " fprintf(stderr, \"offset is past end of file\\en\");\n"
12441 " exit(EXIT_FAILURE);\n"
12444 #. type: Plain text
12445 #: build/C/man3/shm_open.3:469
12448 " /* Open the existing shared memory object and map it\n"
12449 " into the caller\\(aqs address space */\n"
12452 #. type: Plain text
12453 #: build/C/man3/shm_open.3:473
12456 #| " fd = open(argv[1], O_RDWR);\n"
12457 #| " if (fd == -1)\n"
12458 #| " errExit(\"open\");\n"
12460 " int fd = shm_open(shmpath, O_RDWR, 0);\n"
12462 " errExit(\"shm_open\");\n"
12464 " fd = open(argv[1], O_RDWR);\n"
12466 " errExit(\"open\");\n"
12468 #. type: Plain text
12469 #: build/C/man3/shm_open.3:481
12471 msgid " /* Copy data into the shared memory object */\n"
12474 #. type: Plain text
12475 #: build/C/man3/shm_open.3:484
12478 " shmp-E<gt>cnt = len;\n"
12479 " memcpy(&shmp-E<gt>buf, string, len);\n"
12482 #. type: Plain text
12483 #: build/C/man3/shm_open.3:486
12485 #| msgid " /* The main thread also allocates some memory */\n"
12486 msgid " /* Tell peer that it can now access shared memory */\n"
12487 msgstr " /* The main thread also allocates some memory */\n"
12489 #. type: Plain text
12490 #: build/C/man3/shm_open.3:489
12493 #| " if (ftruncate(fd, len) == -1)\n"
12494 #| " errExit(\"truncate\");\n"
12496 " if (sem_post(&shmp-E<gt>sem1) == -1)\n"
12497 " errExit(\"sem_post\");\n"
12499 " if (ftruncate(fd, len) == -1)\n"
12500 " errExit(\"truncate\");\n"
12502 #. type: Plain text
12503 #: build/C/man3/shm_open.3:492
12506 " /* Wait until peer says that it has finished accessing\n"
12507 " the shared memory */\n"
12510 #. type: Plain text
12511 #: build/C/man3/shm_open.3:495
12514 #| " if (ftruncate(fd, len) == -1)\n"
12515 #| " errExit(\"truncate\");\n"
12517 " if (sem_wait(&shmp-E<gt>sem2) == -1)\n"
12518 " errExit(\"sem_wait\");\n"
12520 " if (ftruncate(fd, len) == -1)\n"
12521 " errExit(\"truncate\");\n"
12523 #. type: Plain text
12524 #: build/C/man3/shm_open.3:497
12526 msgid " /* Write modified data in shared memory to standard output */\n"
12529 #. type: Plain text
12530 #: build/C/man3/shm_open.3:500
12533 " write(STDOUT_FILENO, &shmp-E<gt>buf, len);\n"
12534 " write(STDOUT_FILENO, \"\\en\", 1);\n"
12537 #. type: Plain text
12538 #: build/C/man3/shm_open.3:517
12540 "B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), "
12541 "B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), "
12542 "B<shm_overview>(7)"
12544 "B<close>(2), B<fchmod>(2), B<fchown>(2), B<fcntl>(2), B<fstat>(2), "
12545 "B<ftruncate>(2), B<memfd_create>(2), B<mmap>(2), B<open>(2), B<umask>(2), "
12546 "B<shm_overview>(7)"
12549 #: build/C/man7/shm_overview.7:26
12551 msgid "SHM_OVERVIEW"
12552 msgstr "SHM_OVERVIEW"
12554 #. type: Plain text
12555 #: build/C/man7/shm_overview.7:29
12556 msgid "shm_overview - overview of POSIX shared memory"
12557 msgstr "shm_overview - POSIX 共有メモリーの概要"
12559 #. type: Plain text
12560 #: build/C/man7/shm_overview.7:32
12562 "The POSIX shared memory API allows processes to communicate information by "
12563 "sharing a region of memory."
12565 "POSIX 共有メモリー API を使用すると、メモリーのある領域を共有して、 プロセス"
12566 "間で情報をやり取りすることができる。"
12568 #. type: Plain text
12569 #: build/C/man7/shm_overview.7:34
12570 msgid "The interfaces employed in the API are:"
12571 msgstr "この API では以下のインターフェースが採用されている。"
12574 #: build/C/man7/shm_overview.7:34
12576 msgid "B<shm_open>(3)"
12577 msgstr "B<shm_open>(3)"
12579 #. type: Plain text
12580 #: build/C/man7/shm_overview.7:41
12582 "Create and open a new object, or open an existing object. This is analogous "
12583 "to B<open>(2). The call returns a file descriptor for use by the other "
12584 "interfaces listed below."
12586 "新しいオブジェクトを生成しオープンする、もしくは 既存のオブジェクトをオープン"
12587 "する。これは B<open>(2) と同じである。下記にある他のインターフェースで使用す"
12588 "る ファイルディスクリプターを返す。"
12591 #: build/C/man7/shm_overview.7:41
12593 msgid "B<ftruncate>(2)"
12594 msgstr "B<ftruncate>(2)"
12596 #. type: Plain text
12597 #: build/C/man7/shm_overview.7:45
12599 "Set the size of the shared memory object. (A newly created shared memory "
12600 "object has a length of zero.)"
12601 msgstr "共有メモリーオブジェクトの大きさを設定する。"
12603 #. type: Plain text
12604 #: build/C/man7/shm_overview.7:49
12606 "Map the shared memory object into the virtual address space of the calling "
12609 "呼び出したプロセスの仮想アドレス空間に共有メモリーオブジェクトを マップする。"
12612 #: build/C/man7/shm_overview.7:49
12614 msgid "B<munmap>(2)"
12615 msgstr "B<munmap>(2)"
12617 #. type: Plain text
12618 #: build/C/man7/shm_overview.7:53
12620 "Unmap the shared memory object from the virtual address space of the calling "
12623 "呼び出したプロセスの仮想アドレス空間から 共有メモリーオブジェクトをアンマップ"
12627 #: build/C/man7/shm_overview.7:53
12629 msgid "B<shm_unlink>(3)"
12630 msgstr "B<shm_unlink>(3)"
12632 #. type: Plain text
12633 #: build/C/man7/shm_overview.7:56
12634 msgid "Remove a shared memory object name."
12635 msgstr "共有メモリーオブジェクト名を削除する。"
12638 #: build/C/man7/shm_overview.7:56
12640 msgid "B<close>(2)"
12641 msgstr "B<close>(2)"
12643 #. type: Plain text
12644 #: build/C/man7/shm_overview.7:61
12646 "Close the file descriptor allocated by B<shm_open>(3) when it is no longer "
12649 "B<shm_open>(3) で割り当てられたファイルディスクリプターが不要になった際に、 "
12650 "そのファイルディスクリプターをクローズする。"
12653 #: build/C/man7/shm_overview.7:61
12655 msgid "B<fstat>(2)"
12656 msgstr "B<fstat>(2)"
12658 #. type: Plain text
12659 #: build/C/man7/shm_overview.7:75
12661 "Obtain a I<stat> structure that describes the shared memory object. Among "
12662 "the information returned by this call are the object's size (I<st_size>), "
12663 "permissions (I<st_mode>), owner (I<st_uid>), and group (I<st_gid>)."
12665 "その共有メモリーオブジェクトについての情報が入った I<stat> 構造体を取得す"
12666 "る。 このシステムコールが返す情報には、オブジェクトのサイズ (I<st_size>)、 許"
12667 "可属性 (I<st_mode>)、 所有者 (I<st_uid>)、 グループ (I<st_gid>) がある。"
12670 #: build/C/man7/shm_overview.7:75
12672 msgid "B<fchown>(2)"
12673 msgstr "B<fchown>(2)"
12675 #. type: Plain text
12676 #: build/C/man7/shm_overview.7:78
12677 msgid "To change the ownership of a shared memory object."
12678 msgstr "共有メモリーオブジェクトの所有権を変更する。"
12681 #: build/C/man7/shm_overview.7:78
12683 msgid "B<fchmod>(2)"
12684 msgstr "B<fchmod>(2)"
12686 #. type: Plain text
12687 #: build/C/man7/shm_overview.7:81
12688 msgid "To change the permissions of a shared memory object."
12689 msgstr "共有メモリーオブジェクトの許可属性を変更する。"
12692 #: build/C/man7/shm_overview.7:81
12697 #. type: Plain text
12698 #: build/C/man7/shm_overview.7:83
12699 msgid "POSIX shared memory is supported since Linux 2.4 and glibc 2.2."
12700 msgstr "POSIX 共有メモリーは Linux 2.4 と glibc 2.2 以降でサポートされている。"
12703 #: build/C/man7/shm_overview.7:83
12705 msgid "Persistence"
12708 #. type: Plain text
12709 #: build/C/man7/shm_overview.7:88
12711 "POSIX shared memory objects have kernel persistence: a shared memory object "
12712 "will exist until the system is shut down, or until all processes have "
12713 "unmapped the object and it has been deleted with B<shm_unlink>(3)"
12715 "POSIX 共有メモリーオブジェクトはカーネル内で保持される。 共有メモリーオブジェ"
12716 "クトは、システムがシャットダウンされるか、 全てのプロセスがそのオブジェクトを"
12717 "アンマップし、 B<shm_unlink>(3) で削除されるまで、存在し続ける。"
12720 #: build/C/man7/shm_overview.7:88
12725 #. type: Plain text
12726 #: build/C/man7/shm_overview.7:93
12728 "Programs using the POSIX shared memory API must be compiled with I<cc -lrt> "
12729 "to link against the real-time library, I<librt>."
12731 "POSIX 共有メモリー API を使用したプログラムは I<cc -lrt> でコンパイルし、リア"
12732 "ルタイムライブラリ I<librt> とリンクしなければならない。"
12735 #: build/C/man7/shm_overview.7:93
12737 msgid "Accessing shared memory objects via the filesystem"
12738 msgstr "ファイルシステム経由での共有メモリーオブジェクトへのアクセス"
12740 #. type: Plain text
12741 #: build/C/man7/shm_overview.7:100
12744 #| "On Linux, shared memory objects are created in a (I<tmpfs>) virtual "
12745 #| "filesystem, normally mounted under I</dev/shm>. Since kernel 2.6.19, "
12746 #| "Linux supports the use of access control lists (ACLs) to control the "
12747 #| "permissions of objects in the virtual filesystem."
12749 "On Linux, shared memory objects are created in a (I<tmpfs>(5)) virtual "
12750 "filesystem, normally mounted under I</dev/shm>. Since kernel 2.6.19, Linux "
12751 "supports the use of access control lists (ACLs) to control the permissions "
12752 "of objects in the virtual filesystem."
12754 "Linux では、共有メモリーオブジェクトは通常 I</dev/shm> 以下にマウントされる仮"
12755 "想ファイルシステム (I<tmpfs>) 内に作成される。 カーネル 2.6.19 以降の Linux "
12756 "では、 仮想ファイルシステム内のオブジェクトの許可属性の制御に、 アクセス制御"
12757 "リスト (ACL; access control lists) を使うことができる。"
12759 #. type: Plain text
12760 #: build/C/man7/shm_overview.7:103
12762 "Typically, processes must synchronize their access to a shared memory "
12763 "object, using, for example, POSIX semaphores."
12765 "通常は、共有メモリーオブジェクトにアクセスするプロセスは、 POSIX セマフォなど"
12766 "を使ってプロセス間で同期をとらなければならない。"
12768 #. type: Plain text
12769 #: build/C/man7/shm_overview.7:111
12771 "System V shared memory (B<shmget>(2), B<shmop>(2), etc.) is an older shared "
12772 "memory API. POSIX shared memory provides a simpler, and better designed "
12773 "interface; on the other hand POSIX shared memory is somewhat less widely "
12774 "available (especially on older systems) than System V shared memory."
12776 "System V 共有メモリー (B<shmget>(2), B<shmop>(2) など) は古い共有メモリー "
12777 "API である。 POSIX 共有メモリーは、より簡単で、うまく設計されたインターフェー"
12778 "スを提供している。 一方で、POSIX 共有メモリーは System V 共有メモリーと比べる"
12779 "と 利用できるシステムが少ない (特に、古いシステムでは少ない)。"
12781 #. type: Plain text
12782 #: build/C/man7/shm_overview.7:124
12784 "B<fchmod>(2), B<fchown>(2), B<fstat>(2), B<ftruncate>(2), B<mmap>(2), "
12785 "B<mprotect>(2), B<munmap>(2), B<shmget>(2), B<shmop>(2), B<shm_open>(3), "
12786 "B<shm_unlink>(3), B<sem_overview>(7)"
12788 "B<fchmod>(2), B<fchown>(2), B<fstat>(2), B<ftruncate>(2), B<mmap>(2), "
12789 "B<mprotect>(2), B<munmap>(2), B<shmget>(2), B<shmop>(2), B<shm_open>(3), "
12790 "B<shm_unlink>(3), B<sem_overview>(7)"
12793 #: build/C/man2/shmctl.2:46
12798 #. type: Plain text
12799 #: build/C/man2/shmctl.2:49
12800 msgid "shmctl - System V shared memory control"
12801 msgstr "shmctl - System V 共有メモリー (shared memory) を制御する"
12803 #. type: Plain text
12804 #: build/C/man2/shmctl.2:52 build/C/man2/shmget.2:44
12805 msgid "B<#include E<lt>sys/ipc.hE<gt>>"
12806 msgstr "B<#include E<lt>sys/ipc.hE<gt>>"
12808 #. type: Plain text
12809 #: build/C/man2/shmctl.2:54 build/C/man2/shmget.2:46
12810 msgid "B<#include E<lt>sys/shm.hE<gt>>"
12811 msgstr "B<#include E<lt>sys/shm.hE<gt>>"
12813 #. type: Plain text
12814 #: build/C/man2/shmctl.2:56
12816 "B<int shmctl(int >I<shmid>B<, int >I<cmd>B<, struct shmid_ds *>I<buf>B<);>"
12818 "B<int shmctl(int >I<shmid>B<, int >I<cmd>B<, struct shmid_ds *>I<buf>B<);>"
12820 #. type: Plain text
12821 #: build/C/man2/shmctl.2:63
12823 "B<shmctl>() performs the control operation specified by I<cmd> on the System"
12824 "\\ V shared memory segment whose identifier is given in I<shmid>."
12826 "B<shmctl>() は、識別子が I<shmid> の System\\ V 共有メモリーセグメントに対し"
12827 "て I<cmd> で指示した制御命令を実行する。"
12829 #. type: Plain text
12830 #: build/C/man2/shmctl.2:68
12832 "The I<buf> argument is a pointer to a I<shmid_ds> structure, defined in "
12833 "I<E<lt>sys/shm.hE<gt>> as follows:"
12835 "I<buf> 引き数は、 I<shmid_ds> 構造体へのポインターである。 この構造体は "
12836 "I<E<lt>sys/shm.hE<gt>> で以下のように定義されている"
12838 #. type: Plain text
12839 #: build/C/man2/shmctl.2:83
12842 #| "struct shmid_ds {\n"
12843 #| " struct ipc_perm shm_perm; /* Ownership and permissions */\n"
12844 #| " size_t shm_segsz; /* Size of segment (bytes) */\n"
12845 #| " time_t shm_atime; /* Last attach time */\n"
12846 #| " time_t shm_dtime; /* Last detach time */\n"
12847 #| " time_t shm_ctime; /* Last change time */\n"
12848 #| " pid_t shm_cpid; /* PID of creator */\n"
12849 #| " pid_t shm_lpid; /* PID of last shmat(2)/shmdt(2) */\n"
12850 #| " shmatt_t shm_nattch; /* No. of current attaches */\n"
12854 "struct shmid_ds {\n"
12855 " struct ipc_perm shm_perm; /* Ownership and permissions */\n"
12856 " size_t shm_segsz; /* Size of segment (bytes) */\n"
12857 " time_t shm_atime; /* Last attach time */\n"
12858 " time_t shm_dtime; /* Last detach time */\n"
12859 " time_t shm_ctime; /* Creation time/time of last\n"
12860 " modification via shmctl() */\n"
12861 " pid_t shm_cpid; /* PID of creator */\n"
12862 " pid_t shm_lpid; /* PID of last shmat(2)/shmdt(2) */\n"
12863 " shmatt_t shm_nattch; /* No. of current attaches */\n"
12867 "struct shmid_ds {\n"
12868 " struct ipc_perm shm_perm; /* 所有権と許可 */\n"
12869 " size_t shm_segsz; /* セグメントのサイズ (バイト) */\n"
12870 " time_t shm_atime; /* 最後の付加 (attach) の時刻 */\n"
12871 " time_t shm_dtime; /* 最後の分離 (detach) の時刻 */\n"
12872 " time_t shm_ctime; /* 最後に変更が行われた時刻 */\n"
12873 " pid_t shm_cpid; /* 作成者 (creator) の PID */\n"
12874 " pid_t shm_lpid; /* 最後の shmat(2)/shmdt(2) の PID */\n"
12875 " shmatt_t shm_nattch; /* 現在付加されている数 */\n"
12879 #. type: Plain text
12880 #: build/C/man2/shmctl.2:89
12883 #| "The fields of the I<mallinfo> structure contain the following information:"
12884 msgid "The fields of the I<shmid_ds> structure are as follows:"
12885 msgstr "I<mallinfo> 構造体の各フィールドには以下の情報が格納される。"
12888 #: build/C/man2/shmctl.2:89
12890 #| msgid "B<shm_open>(3)"
12891 msgid "I<shm_perm>"
12892 msgstr "B<shm_open>(3)"
12894 #. type: Plain text
12895 #: build/C/man2/shmctl.2:95
12897 "This is an I<ipc_perm> structure (see below) that specifies the access "
12898 "permissions on the shared memory segment."
12902 #: build/C/man2/shmctl.2:95
12904 msgid "I<shm_segsz>"
12907 #. type: Plain text
12908 #: build/C/man2/shmctl.2:98
12910 #| msgid "Maximum size in bytes for a shared memory segment."
12911 msgid "Size in bytes of the shared memory segment."
12912 msgstr "1 つの共有メモリーセグメントの最大サイズ (バイト数)。"
12915 #: build/C/man2/shmctl.2:98
12917 msgid "I<shm_atime>"
12920 #. type: Plain text
12921 #: build/C/man2/shmctl.2:103
12922 msgid "Time of the last B<shmat>(2) system call that attached this segment."
12926 #: build/C/man2/shmctl.2:103
12928 msgid "I<shm_dtime>"
12931 #. type: Plain text
12932 #: build/C/man2/shmctl.2:108
12933 msgid "Time of the last B<shmdt>(2) system call that detached tgis segment."
12937 #: build/C/man2/shmctl.2:108
12939 msgid "I<shm_ctime>"
12942 #. type: Plain text
12943 #: build/C/man2/shmctl.2:114
12945 "Time of creation of segment or time of the last B<shmctl>() B<IPC_SET> "
12950 #: build/C/man2/shmctl.2:114
12952 msgid "I<shm_cpid>"
12955 #. type: Plain text
12956 #: build/C/man2/shmctl.2:117
12958 #| msgid "shmget - allocates a System V shared memory segment"
12959 msgid "ID of the process that created the shared memory segment."
12960 msgstr "shmget - System V 共有メモリーセグメントを割り当てる"
12963 #: build/C/man2/shmctl.2:117
12965 msgid "I<shm_lpid>"
12968 #. type: Plain text
12969 #: build/C/man2/shmctl.2:124
12971 "ID of the last process that executed a B<shmat>(2) or B<shmdt>(2) system "
12972 "call on this segment."
12976 #: build/C/man2/shmctl.2:124
12978 msgid "I<shm_nattch>"
12981 #. type: Plain text
12982 #: build/C/man2/shmctl.2:127
12983 msgid "Number of processes that have this segment attached."
12986 #. type: Plain text
12987 #: build/C/man2/shmctl.2:133
12989 "The I<ipc_perm> structure is defined as follows (the highlighted fields are "
12990 "settable using B<IPC_SET>):"
12992 "I<ipc_perm> 構造体は以下のように定義されている (強調されたフィールドは "
12993 "B<IPC_SET> を使って設定可能である):"
12995 #. type: Plain text
12996 #: build/C/man2/shmctl.2:146
12999 "struct ipc_perm {\n"
13000 " key_t __key; /* Key supplied to shmget(2) */\n"
13001 " uid_t B<uid>; /* Effective UID of owner */\n"
13002 " gid_t B<gid>; /* Effective GID of owner */\n"
13003 " uid_t cuid; /* Effective UID of creator */\n"
13004 " gid_t cgid; /* Effective GID of creator */\n"
13005 " unsigned short B<mode>; /* B<Permissions> + SHM_DEST and\n"
13006 " SHM_LOCKED flags */\n"
13007 " unsigned short __seq; /* Sequence number */\n"
13010 "struct ipc_perm {\n"
13011 " key_t __key; /* shmget(2) に与えられるキー */\n"
13012 " uid_t B<uid>; /* 所有者の実効 UID */\n"
13013 " gid_t B<gid>; /* 所有者の実効 GID */\n"
13014 " uid_t cuid; /* 作成者の実効 UID */\n"
13015 " gid_t cgid; /* 作成者の実効 GID */\n"
13016 " unsigned short B<mode>; /* B<許可> + SHM_DEST と\n"
13017 " SHM_LOCKED フラグ */\n"
13018 " unsigned short __seq; /* シーケンス番号 */\n"
13021 #. type: Plain text
13022 #: build/C/man2/shmctl.2:155
13024 "The least significant 9 bits of the I<mode> field of the I<ipc_perm> "
13025 "structure define the access permissions for the shared memory segment. The "
13026 "permission bits are as follows:"
13030 #: build/C/man2/shmctl.2:157
13036 #: build/C/man2/shmctl.2:157
13038 msgid "Read by user"
13042 #: build/C/man2/shmctl.2:158
13048 #: build/C/man2/shmctl.2:158
13050 msgid "Write by user"
13054 #: build/C/man2/shmctl.2:159
13060 #: build/C/man2/shmctl.2:159
13062 msgid "Read by group"
13066 #: build/C/man2/shmctl.2:160
13072 #: build/C/man2/shmctl.2:160
13074 msgid "Write by group"
13078 #: build/C/man2/shmctl.2:161
13084 #: build/C/man2/shmctl.2:161
13086 msgid "Read by others"
13090 #: build/C/man2/shmctl.2:162
13096 #: build/C/man2/shmctl.2:162
13098 msgid "Write by others"
13101 #. type: Plain text
13102 #: build/C/man2/shmctl.2:172
13104 "Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. (It "
13105 "is not necessary to have execute permission on a segment in order to perform "
13106 "a B<shmat>(2) call with the B<SHM_EXEC> flag.)"
13109 #. type: Plain text
13110 #: build/C/man2/shmctl.2:176
13111 msgid "Valid values for I<cmd> are:"
13112 msgstr "I<cmd> として有効な値は以下の通り:"
13115 #: build/C/man2/shmctl.2:176
13117 msgid "B<IPC_STAT>"
13118 msgstr "B<IPC_STAT>"
13120 #. type: Plain text
13121 #: build/C/man2/shmctl.2:185
13123 "Copy information from the kernel data structure associated with I<shmid> "
13124 "into the I<shmid_ds> structure pointed to by I<buf>. The caller must have "
13125 "read permission on the shared memory segment."
13127 "I<shmid> に関連づけられたカーネルデータ構造体の情報を I<buf> で指された "
13128 "I<shmid_ds> 構造体にコピーする。 呼び出し元は共有メモリーセグメントに対する "
13129 "読み込み許可を持たなければならない。"
13132 #: build/C/man2/shmctl.2:185
13135 msgstr "B<IPC_SET>"
13137 #. type: Plain text
13138 #: build/C/man2/shmctl.2:195
13140 "Write the values of some members of the I<shmid_ds> structure pointed to by "
13141 "I<buf> to the kernel data structure associated with this shared memory "
13142 "segment, updating also its I<shm_ctime> member."
13145 #. type: Plain text
13146 #: build/C/man2/shmctl.2:199
13149 #| "The least significant 9 bits of I<shm_perm.mode> are set to the least "
13150 #| "significant 9 bit of I<shmflg>."
13152 "The following fields are updated: I<shm_perm.uid>, I<shm_perm.gid>, and (the "
13153 "least significant 9 bits of) I<shm_perm.mode>."
13155 "I<shm_perm.mode> の下位 9 ビットに I<shmflg> の下位 9 ビットを設定する。"
13157 #. type: Plain text
13158 #: build/C/man2/shmctl.2:205
13160 "The effective UID of the calling process must match the owner (I<shm_perm."
13161 "uid>) or creator (I<shm_perm.cuid>) of the shared memory segment, or the "
13162 "caller must be privileged."
13166 #: build/C/man2/shmctl.2:205
13168 msgid "B<IPC_RMID>"
13169 msgstr "B<IPC_RMID>"
13171 #. type: Plain text
13172 #: build/C/man2/shmctl.2:218
13174 "Mark the segment to be destroyed. The segment will actually be destroyed "
13175 "only after the last process detaches it (i.e., when the I<shm_nattch> member "
13176 "of the associated structure I<shmid_ds> is zero). The caller must be the "
13177 "owner or creator of the segment, or be privileged. The I<buf> argument is "
13180 "セグメントに破棄済みのマークを付ける。 セグメントは、実際には最後プロセスがセ"
13181 "グメントを分離した (関連する I<shmid_ds> 構造体の I<shm_nattch> メンバーが 0 "
13182 "になった) 後でのみ破棄される。 呼び出し元はそのセグメントの所有者か作成者であ"
13183 "るか、特権を持たなければならない。 I<buf> 引き数は無視される。"
13185 #. type: Plain text
13186 #: build/C/man2/shmctl.2:226
13188 "If a segment has been marked for destruction, then the (nonstandard) "
13189 "B<SHM_DEST> flag of the I<shm_perm.mode> field in the associated data "
13190 "structure retrieved by B<IPC_STAT> will be set."
13192 "セグメントに破棄のマークが付けられると、 関連するデータ構造体において "
13193 "I<shm_perm.mode> フィールドの (標準ではない) B<SHM_DEST> フラグが設定され"
13194 "る。 このデータ構造体は B<IPC_STAT> で取得される。"
13196 #. type: Plain text
13197 #: build/C/man2/shmctl.2:229
13199 "The caller I<must> ensure that a segment is eventually destroyed; otherwise "
13200 "its pages that were faulted in will remain in memory or swap."
13202 "呼び出し元は最終的にはセグメントを忘れずに破棄I<しなければならない>。 そうで"
13203 "なれば、フォールト (fault) されたページは メモリーかスワップ (swap) に残り続"
13206 #. type: Plain text
13207 #: build/C/man2/shmctl.2:234
13209 "See also the description of I</proc/sys/kernel/shm_rmid_forced> in "
13211 msgstr "B<proc>(5) の I</proc/sys/kernel/shm_rmid_forced> の説明も参照のこと。"
13214 #: build/C/man2/shmctl.2:234
13216 msgid "B<IPC_INFO> (Linux-specific)"
13217 msgstr "B<IPC_INFO> (Linux 固有)"
13219 #. type: Plain text
13220 #: build/C/man2/shmctl.2:247
13222 "Return information about system-wide shared memory limits and parameters in "
13223 "the structure pointed to by I<buf>. This structure is of type I<shminfo> "
13224 "(thus, a cast is required), defined in I<E<lt>sys/shm.hE<gt>> if the "
13225 "B<_GNU_SOURCE> feature test macro is defined:"
13227 "システム全体での共有メモリーの制限とパラメーターに関する情報を、 I<buf> が指"
13228 "す構造体に入れて返す。 この構造体は I<shminfo> 型である (そのためキャストが必"
13229 "要である)。 I<shminfo> は B<_GNU_SOURCE> 機能検査マクロが定義された場合に "
13230 "I<E<lt>sys/shm.hE<gt>> で以下のように定義される:"
13232 #. type: Plain text
13233 #: build/C/man2/shmctl.2:261
13236 "struct shminfo {\n"
13237 " unsigned long shmmax; /* Maximum segment size */\n"
13238 " unsigned long shmmin; /* Minimum segment size;\n"
13240 " unsigned long shmmni; /* Maximum number of segments */\n"
13241 " unsigned long shmseg; /* Maximum number of segments\n"
13242 " that a process can attach;\n"
13243 " unused within kernel */\n"
13244 " unsigned long shmall; /* Maximum number of pages of\n"
13245 " shared memory, system-wide */\n"
13248 "struct shminfo {\n"
13249 " unsigned long shmmax; /* 最大セグメントサイズ */\n"
13250 " unsigned long shmmin; /* 最小セグメントサイズ。\n"
13252 " unsigned long shmmni; /* 最大セグメント数 */\n"
13253 " unsigned long shmseg; /* プロセスが付加できる\n"
13256 " unsigned long shmall; /* 共有メモリーの最大ページ数。\n"
13260 #. type: Plain text
13261 #: build/C/man2/shmctl.2:274
13263 "The I<shmmni>, I<shmmax>, and I<shmall> settings can be changed via I</proc> "
13264 "files of the same name; see B<proc>(5) for details."
13266 "設定 I<shmmni>, I<shmmax>, I<shmall> は I</proc> にある同じ名前のファイル経由"
13267 "で変更可能である。 詳しくは B<proc>(5) を参照。"
13270 #: build/C/man2/shmctl.2:274
13272 msgid "B<SHM_INFO> (Linux-specific)"
13273 msgstr "B<SHM_INFO> (Linux 固有)"
13275 #. type: Plain text
13276 #: build/C/man2/shmctl.2:285
13278 "Return a I<shm_info> structure whose fields contain information about system "
13279 "resources consumed by shared memory. This structure is defined in "
13280 "I<E<lt>sys/shm.hE<gt>> if the B<_GNU_SOURCE> feature test macro is defined:"
13282 "共有メモリーが消費しているシステム資源に関する情報を 格納した I<shm_info> 構"
13283 "造体を返す。 この構造体は、 B<_GNU_SOURCE> 機能検査マクロが定義された場合に "
13284 "I<E<lt>sys/shm.hE<gt>> で以下のように定義される:"
13286 #. type: Plain text
13287 #: build/C/man2/shmctl.2:302
13290 "struct shm_info {\n"
13291 " int used_ids; /* # of currently existing\n"
13293 " unsigned long shm_tot; /* Total number of shared\n"
13294 " memory pages */\n"
13295 " unsigned long shm_rss; /* # of resident shared\n"
13296 " memory pages */\n"
13297 " unsigned long shm_swp; /* # of swapped shared\n"
13298 " memory pages */\n"
13299 " unsigned long swap_attempts;\n"
13300 " /* Unused since Linux 2.4 */\n"
13301 " unsigned long swap_successes;\n"
13302 " /* Unused since Linux 2.4 */\n"
13305 "struct shm_info {\n"
13306 " int used_ids; /* 現在存在するセグメント数 */\n"
13307 " unsigned long shm_tot; /* 共有メモリーのページ総数 */\n"
13308 " unsigned long shm_rss; /* メモリー上にある (スワップされて\n"
13309 " いない) 共有メモリーページ数 */\n"
13310 " unsigned long shm_swp; /* スワップされている共有メモリー\n"
13312 " unsigned long swap_attempts;\n"
13313 " /* Linux 2.4 以降では未使用 */\n"
13314 " unsigned long swap_successes;\n"
13315 " /* Linux 2.4 以降では未使用 */\n"
13319 #: build/C/man2/shmctl.2:304
13321 msgid "B<SHM_STAT> (Linux-specific)"
13322 msgstr "B<SHM_STAT> (Linux 固有)"
13324 #. type: Plain text
13325 #: build/C/man2/shmctl.2:315
13327 "Return a I<shmid_ds> structure as for B<IPC_STAT>. However, the I<shmid> "
13328 "argument is not a segment identifier, but instead an index into the kernel's "
13329 "internal array that maintains information about all shared memory segments "
13332 "B<IPC_STAT> と同じく I<shmid_ds> 構造体を返す。 但し、 I<shmid> 引き数は、セ"
13333 "グメント識別子ではなく、システム上の全ての共有メモリー セグメントに関する情報"
13334 "を管理するカーネルの内部配列へのインデックス である。"
13337 #: build/C/man2/shmctl.2:315
13339 #| msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
13340 msgid "B<SHM_STAT_ANY> (Linux-specific, since Linux 4.17)"
13341 msgstr "B<SHM_EXEC> (Linux 固有; Linux 2.6.9 以降)"
13343 #. type: Plain text
13344 #: build/C/man2/shmctl.2:328
13346 "Return a I<shmid_ds> structure as for B<SHM_STAT>. However, I<shm_perm."
13347 "mode> is not checked for read access for I<shmid>, meaning that any user can "
13348 "employ this operation (just as any user may read I</proc/sysvipc/shm> to "
13349 "obtain the same information)."
13352 #. type: Plain text
13353 #: build/C/man2/shmctl.2:331
13355 "The caller can prevent or allow swapping of a shared memory segment with the "
13356 "following I<cmd> values:"
13358 "呼び出し元は、I<cmd> に以下の値を指定することで、共有メモリーセグメントが ス"
13359 "ワップされることを防止したり、許可したりできる:"
13362 #: build/C/man2/shmctl.2:331
13364 msgid "B<SHM_LOCK> (Linux-specific)"
13365 msgstr "B<SHM_LOCK> (Linux 固有)"
13367 #. type: Plain text
13368 #: build/C/man2/shmctl.2:343
13370 "Prevent swapping of the shared memory segment. The caller must fault in any "
13371 "pages that are required to be present after locking is enabled. If a "
13372 "segment has been locked, then the (nonstandard) B<SHM_LOCKED> flag of the "
13373 "I<shm_perm.mode> field in the associated data structure retrieved by "
13374 "B<IPC_STAT> will be set."
13376 "共有メモリーセグメントをスワップすることを防止する。 ロックが有効になった後、"
13377 "呼び出し元は、 存在することが要求された全てのページをフォールトさせなければな"
13378 "らない。 セグメントがロックされると、 関連するデータ構造体において "
13379 "I<shm_perm.mode> フィールドの (標準的ではない) B<SHM_LOCKED> フラグが設定さ"
13380 "れる。 このデータ構造体は B<IPC_STAT> で取得される。"
13383 #: build/C/man2/shmctl.2:343
13385 msgid "B<SHM_UNLOCK> (Linux-specific)"
13386 msgstr "B<SHM_UNLOCK> (Linux 固有)"
13388 #. type: Plain text
13389 #: build/C/man2/shmctl.2:346
13390 msgid "Unlock the segment, allowing it to be swapped out."
13391 msgstr "セグメントのロックを解除し、スワップアウトすることを可能にする。"
13393 #. There was some weirdness in 2.6.9: SHM_LOCK and SHM_UNLOCK could
13394 #. be applied to a segment, regardless of ownership of the segment.
13395 #. This was a botch-up in the move to RLIMIT_MEMLOCK, and was fixed
13396 #. in 2.6.10. MTK, May 2005
13397 #. type: Plain text
13398 #: build/C/man2/shmctl.2:364
13400 "In kernels before 2.6.10, only a privileged process could employ B<SHM_LOCK> "
13401 "and B<SHM_UNLOCK>. Since kernel 2.6.10, an unprivileged process can employ "
13402 "these operations if its effective UID matches the owner or creator UID of "
13403 "the segment, and (for B<SHM_LOCK>) the amount of memory to be locked falls "
13404 "within the B<RLIMIT_MEMLOCK> resource limit (see B<setrlimit>(2))."
13406 "2.6.10 より前のカーネルでは、特権プロセスだけが B<SHM_LOCK> と B<SHM_UNLOCK> "
13407 "を利用することができた。 2.6.10 以降のカーネルでは、非特権プロセスであっても"
13408 "次の条件を満たせば これらの操作を利用することができる。その条件とは、プロセス"
13409 "の実効 UID がそのセグメントの所有者もしくは作成者の UID と一致し、 "
13410 "(B<SHM_LOCK> の場合には) ロックするメモリーの合計が B<RLIMIT_MEMLOCK> リソー"
13411 "ス上限 (B<setrlimit>(2) 参照) の範囲内に入っていることである。"
13413 #. type: Plain text
13414 #: build/C/man2/shmctl.2:384
13417 #| "A successful B<IPC_INFO> or B<SHM_INFO> operation returns the index of "
13418 #| "the highest used entry in the kernel's internal array recording "
13419 #| "information about all shared memory segments. (This information can be "
13420 #| "used with repeated B<SHM_STAT> operations to obtain information about all "
13421 #| "shared memory segments on the system.) A successful B<SHM_STAT> "
13422 #| "operation returns the identifier of the shared memory segment whose index "
13423 #| "was given in I<shmid>. Other operations return 0 on success."
13425 "A successful B<IPC_INFO> or B<SHM_INFO> operation returns the index of the "
13426 "highest used entry in the kernel's internal array recording information "
13427 "about all shared memory segments. (This information can be used with "
13428 "repeated B<SHM_STAT> or B<SHM_STAT_ANY> operations to obtain information "
13429 "about all shared memory segments on the system.) A successful B<SHM_STAT> "
13430 "operation returns the identifier of the shared memory segment whose index "
13431 "was given in I<shmid>. Other operations return 0 on success."
13433 "B<IPC_INFO> と B<SHM_INFO> 操作は、成功すると、全ての共有メモリーセグメントに"
13434 "関する情報を 管理しているカーネルの内部配列の使用中エントリーのインデックス"
13435 "の うち最大値を返す (この情報は、システムの全ての共有メモリーセグメントに関す"
13436 "る情報を 取得するために、 B<SHM_STAT> 操作を繰り返し実行する際に使用でき"
13437 "る)。 B<SHM_STAT> 操作は、成功すると、 I<shmid> で指定されたインデックスを持"
13438 "つ共有メモリーセグメントの識別子を返す。 他の操作は、成功の場合 0 を返す。"
13440 #. type: Plain text
13441 #: build/C/man2/shmctl.2:388
13442 msgid "On error, -1 is returned, and I<errno> is set appropriately."
13443 msgstr "エラーの場合は -1 を返し、 I<errno> を適切に設定する。"
13445 #. type: Plain text
13446 #: build/C/man2/shmctl.2:397
13449 #| "B<IPC_STAT> or B<SHM_STAT> is requested and I<shm_perm.mode> does not "
13450 #| "allow read access for I<shmid>, and the calling process does not have the "
13451 #| "B<CAP_IPC_OWNER> capability."
13453 "B<IPC_STAT> or B<SHM_STAT> is requested and I<shm_perm.mode> does not allow "
13454 "read access for I<shmid>, and the calling process does not have the "
13455 "B<CAP_IPC_OWNER> capability in the user namespace that governs its IPC "
13458 "B<IPC_STAT> または B<SHM_STAT> が要求され、 I<shm_perm.mode> が I<shmid> への"
13459 "読み込みアクセスを許しておらず、 かつ呼び出したプロセスが B<CAP_IPC_OWNER> "
13460 "ケーパビリティ (capability) を持っていない。"
13462 #. type: Plain text
13463 #: build/C/man2/shmctl.2:408
13465 "The argument I<cmd> has value B<IPC_SET> or B<IPC_STAT> but the address "
13466 "pointed to by I<buf> isn't accessible."
13468 "I<cmd> 引き数に B<IPC_SET> か B<IPC_STAT> が指定されたが I<buf> で指されてい"
13472 #: build/C/man2/shmctl.2:408 build/C/man2/shmop.2:193
13477 #. type: Plain text
13478 #: build/C/man2/shmctl.2:411 build/C/man2/shmop.2:196
13479 msgid "I<shmid> points to a removed identifier."
13480 msgstr "I<shmid> が削除 (remove) された識別子 (identifier) を指している。"
13482 #. type: Plain text
13483 #: build/C/man2/shmctl.2:422
13486 #| "I<shmid> is not a valid identifier, or I<cmd> is not a valid command. "
13487 #| "Or: for a B<SHM_STAT> operation, the index value specified in I<shmid> "
13488 #| "referred to an array slot that is currently unused."
13490 "I<shmid> is not a valid identifier, or I<cmd> is not a valid command. Or: "
13491 "for a B<SHM_STAT> or B<SHM_STAT_ANY> operation, the index value specified in "
13492 "I<shmid> referred to an array slot that is currently unused."
13494 "I<shmid> が有効な識別子でないか、 I<cmd> が有効なコマンドでない。 もしくは、 "
13495 "B<SHM_STAT> 操作の場合に、 I<shmid> で指定されたインデックス値が現在未使用の"
13498 #. type: Plain text
13499 #: build/C/man2/shmctl.2:433
13501 "(In kernels since 2.6.9), B<SHM_LOCK> was specified and the size of the to-"
13502 "be-locked segment would mean that the total bytes in locked shared memory "
13503 "segments would exceed the limit for the real user ID of the calling "
13504 "process. This limit is defined by the B<RLIMIT_MEMLOCK> soft resource limit "
13505 "(see B<setrlimit>(2))."
13507 "(2.6.9 以降のカーネルにおいて) B<SHM_LOCK> が指定され、 ロックされる予定のセ"
13508 "グメントのサイズ (ロックされる共有メモリーセグメントの合計バイト数) が、 呼び"
13509 "出したプロセスの実ユーザー ID についての制限を超えた。 この制限は "
13510 "B<RLIMIT_MEMLOCK> ソフト資源制限で定義される (B<setrlimit>(2) を参照)。"
13512 #. type: Plain text
13513 #: build/C/man2/shmctl.2:438
13515 "B<IPC_STAT> is attempted, and the GID or UID value is too large to be stored "
13516 "in the structure pointed to by I<buf>."
13518 "B<IPC_STAT> が試みられ、GID や UID の値が I<buf> で指示される構造体に格納する"
13521 #. type: Plain text
13522 #: build/C/man2/shmctl.2:450
13524 "B<IPC_SET> or B<IPC_RMID> is attempted, and the effective user ID of the "
13525 "calling process is not that of the creator (found in I<shm_perm.cuid>), or "
13526 "the owner (found in I<shm_perm.uid>), and the process was not privileged "
13527 "(Linux: did not have the B<CAP_SYS_ADMIN> capability)."
13529 "B<IPC_SET> か B<IPC_RMID> が試みられ、 呼び出したプロセスの実効ユーザー ID が"
13530 "作成者 (I<shm_perm.cuid>) でも所有者 (I<shm_perm.uid>) でもなく、プロセスが"
13531 "特権を持たない (Linux では B<CAP_SYS_ADMIN> ケーパビリティを持たない)。"
13533 #. type: Plain text
13534 #: build/C/man2/shmctl.2:462
13536 "Or (in kernels before 2.6.9), B<SHM_LOCK> or B<SHM_UNLOCK> was specified, "
13537 "but the process was not privileged (Linux: did not have the B<CAP_IPC_LOCK> "
13538 "capability). (Since Linux 2.6.9, this error can also occur if the "
13539 "B<RLIMIT_MEMLOCK> is 0 and the caller is not privileged.)"
13541 "または (2.6.9 より前のカーネルで) B<SHM_LOCK> または B<SHM_UNLOCK> が指定さ"
13542 "れているが、プロセスが特権を持たない (Linux では B<CAP_IPC_LOCK> ケーパビリ"
13543 "ティを持たない)。 (Linux 2.6.9 以降では、 B<RLIMIT_MEMLOCK> が 0 で呼び出し元"
13544 "が特権を持たない場合にも、このエラーが起こる。)"
13546 #. Like Linux, the FreeBSD man pages still document
13547 #. the inclusion of these header files.
13548 #. type: Plain text
13549 #: build/C/man2/shmctl.2:480 build/C/man2/shmget.2:301
13551 "The inclusion of I<E<lt>sys/types.hE<gt>> and I<E<lt>sys/ipc.hE<gt>> isn't "
13552 "required on Linux or by any version of POSIX. However, some old "
13553 "implementations required the inclusion of these header files, and the SVID "
13554 "also documented their inclusion. Applications intended to be portable to "
13555 "such old systems may need to include these header files."
13557 "Linux や POSIX の全てのバージョンでは、 I<E<lt>sys/types.hE<gt>> と "
13558 "I<E<lt>sys/ipc.hE<gt>> のインクルードは必要ない。しかしながら、いくつかの古い"
13559 "実装ではこれらのヘッダーファイルのインクルードが必要であり、 SVID でもこれら"
13560 "のインクルードをするように記載されている。このような古いシステムへの移植性を"
13561 "意図したアプリケーションではこれらのファイルをインクルードする必要があるかも"
13564 #. type: Plain text
13565 #: build/C/man2/shmctl.2:492
13568 #| "The B<IPC_INFO>, B<SHM_STAT> and B<SHM_INFO> operations are used by the "
13569 #| "B<ipcs>(1) program to provide information on allocated resources. In "
13570 #| "the future, these may modified or moved to a I</proc> filesystem "
13573 "The B<IPC_INFO>, B<SHM_STAT>, and B<SHM_INFO> operations are used by the "
13574 "B<ipcs>(1) program to provide information on allocated resources. In the "
13575 "future, these may modified or moved to a I</proc> filesystem interface."
13577 "B<IPC_INFO>, B<SHM_STAT>, B<SHM_INFO> 操作は、 B<ipcs>(1) プログラムで割り当"
13578 "て済の資源に関する情報を提供するために 使用されている。将来、これらの操作は変"
13579 "更されたり、 I</proc> ファイルシステムのインターフェースに移動されるかもしれ"
13582 #. type: Plain text
13583 #: build/C/man2/shmctl.2:500
13585 "Linux permits a process to attach (B<shmat>(2)) a shared memory segment "
13586 "that has already been marked for deletion using I<shmctl(IPC_RMID)>. This "
13587 "feature is not available on other UNIX implementations; portable "
13588 "applications should avoid relying on it."
13590 "Linux では、 I<shmctl(IPC_RMID)> を使ってすでに削除マークがつけられている共有"
13591 "メモリーセグメントを あるプロセスが付加 (attach) (B<shmat>(2)) することを許"
13592 "可している。 この機能は他の UNIX の実装では利用できない。 移植性を考慮したア"
13593 "プリケーションではこれに依存しないようにすべきである。"
13595 #. type: Plain text
13596 #: build/C/man2/shmctl.2:513
13598 "Various fields in a I<struct shmid_ds> were typed as I<short> under Linux "
13599 "2.2 and have become I<long> under Linux 2.4. To take advantage of this, a "
13600 "recompilation under glibc-2.1.91 or later should suffice. (The kernel "
13601 "distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
13603 "I<構造体 shmid_ds> 内の多くのフィールドは、 Linux 2.2 では I<short> 型だった"
13604 "が、Linux 2.4 では I<long> 型になった。 この利点を生かすには、glibc-2.1.91 以"
13605 "降の環境下で 再コンパイルすれば十分である。 カーネルは新しい形式の呼び出しと"
13606 "古い形式の呼び出しを I<cmd> 内の B<IPC_64> フラグで区別する。"
13608 #. type: Plain text
13609 #: build/C/man2/shmctl.2:520
13612 #| "B<mlock>(2), B<setrlimit>(2), B<shmget>(2), B<shmop>(2), "
13613 #| "B<capabilities>(7), B<svipc>(7)"
13615 "B<mlock>(2), B<setrlimit>(2), B<shmget>(2), B<shmop>(2), B<capabilities>(7), "
13618 "B<mlock>(2), B<setrlimit>(2), B<shmget>(2), B<shmop>(2), B<capabilities>(7), "
13619 "B<shm_overview>(7), B<svipc>(7)"
13622 #: build/C/man2/shmget.2:38
13627 #. type: Plain text
13628 #: build/C/man2/shmget.2:41
13629 msgid "shmget - allocates a System V shared memory segment"
13630 msgstr "shmget - System V 共有メモリーセグメントを割り当てる"
13632 #. type: Plain text
13633 #: build/C/man2/shmget.2:48
13634 msgid "B<int shmget(key_t >I<key>B<, size_t >I<size>B<, int >I<shmflg>B<);>"
13635 msgstr "B<int shmget(key_t >I<key>B<, size_t >I<size>B<, int >I<shmflg>B<);>"
13637 #. type: Plain text
13638 #: build/C/man2/shmget.2:62
13641 #| "B<shmget>() returns the identifier of the System\\ V shared memory "
13642 #| "segment associated with the value of the argument I<key>. A new shared "
13643 #| "memory segment, with size equal to the value of I<size> rounded up to a "
13644 #| "multiple of B<PAGE_SIZE>, is created if I<key> has the value "
13645 #| "B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no shared memory segment "
13646 #| "corresponding to I<key> exists, and B<IPC_CREAT> is specified in "
13649 "B<shmget>() returns the identifier of the System\\ V shared memory segment "
13650 "associated with the value of the argument I<key>. It may be used either to "
13651 "obtain the identifier of a previously created shared memory segment (when "
13652 "I<shmflg> is zero and I<key> does not have the value B<IPC_PRIVATE>), or to "
13653 "create a new set."
13655 "B<shmget>() は I<key> 引き数に対応する System\\ V 共有メモリーセグメントの識"
13656 "別子を返す。 I<key> の値が B<IPC_PRIVATE> の場合、もしくは I<key> に対応する"
13657 "共有メモリーセグメントが存在せず、 I<shmflg> に B<IPC_CREAT> が指定されていた"
13658 "場合、 新しい共有メモリーセグメントを作成する。 作成される共有メモリーセグメ"
13659 "ントは、 I<size> 引き数の値を B<PAGE_SIZE> の倍数へと切り上げた (round up) 大"
13662 #. type: Plain text
13663 #: build/C/man2/shmget.2:81
13666 #| "B<shmget>() returns the identifier of the System\\ V shared memory "
13667 #| "segment associated with the value of the argument I<key>. A new shared "
13668 #| "memory segment, with size equal to the value of I<size> rounded up to a "
13669 #| "multiple of B<PAGE_SIZE>, is created if I<key> has the value "
13670 #| "B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no shared memory segment "
13671 #| "corresponding to I<key> exists, and B<IPC_CREAT> is specified in "
13674 "A new shared memory segment, with size equal to the value of I<size> rounded "
13675 "up to a multiple of B<PAGE_SIZE>, is created if I<key> has the value "
13676 "B<IPC_PRIVATE> or I<key> isn't B<IPC_PRIVATE>, no shared memory segment "
13677 "corresponding to I<key> exists, and B<IPC_CREAT> is specified in I<shmflg>."
13679 "B<shmget>() は I<key> 引き数に対応する System\\ V 共有メモリーセグメントの識"
13680 "別子を返す。 I<key> の値が B<IPC_PRIVATE> の場合、もしくは I<key> に対応する"
13681 "共有メモリーセグメントが存在せず、 I<shmflg> に B<IPC_CREAT> が指定されていた"
13682 "場合、 新しい共有メモリーセグメントを作成する。 作成される共有メモリーセグメ"
13683 "ントは、 I<size> 引き数の値を B<PAGE_SIZE> の倍数へと切り上げた (round up) 大"
13686 #. type: Plain text
13687 #: build/C/man2/shmget.2:100
13689 "If I<shmflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a shared memory "
13690 "segment already exists for I<key>, then B<shmget>() fails with I<errno> set "
13691 "to B<EEXIST>. (This is analogous to the effect of the combination B<O_CREAT "
13692 "| O_EXCL> for B<open>(2).)"
13694 "I<shmflg> に B<IPC_CREAT> と B<IPC_EXCL> の両方が指定された場合、 I<key> に対"
13695 "応する共有メモリーセグメントが既に存在すると、 B<shmget>() は失敗し、 "
13696 "I<errno> に B<EEXIST> が設定される (これは B<open>(2) に B<O_CREAT | "
13697 "O_EXCL> を指定した場合の動作と同じである)。"
13699 #. type: Plain text
13700 #: build/C/man2/shmget.2:104
13701 msgid "The value I<shmflg> is composed of:"
13702 msgstr "I<shmflg> は以下の内容から構成される:"
13705 #: build/C/man2/shmget.2:104
13707 msgid "B<IPC_CREAT>"
13708 msgstr "B<IPC_CREAT>"
13710 #. type: Plain text
13711 #: build/C/man2/shmget.2:111
13713 "Create a new segment. If this flag is not used, then B<shmget>() will find "
13714 "the segment associated with I<key> and check to see if the user has "
13715 "permission to access the segment."
13717 "新しいセグメントを作成する。このフラグが指定されなかった場合、 B<shmget>() "
13718 "は I<key> に対応するセグメントを探し、 ユーザーがそのセグメントにアクセスする"
13719 "許可があるかどうかをチェックする。"
13722 #: build/C/man2/shmget.2:111
13724 msgid "B<IPC_EXCL>"
13725 msgstr "B<IPC_EXCL>"
13727 #. type: Plain text
13728 #: build/C/man2/shmget.2:117
13730 "This flag is used with B<IPC_CREAT> to ensure that this call creates the "
13731 "segment. If the segment already exists, the call fails."
13733 "このフラグは B<IPC_CREAT> とともに使用し、 この呼び出しで確実にセグメントが作"
13734 "成されるようにする。 セグメントが既に存在した場合には、 呼び出しは失敗する。"
13737 #: build/C/man2/shmget.2:117
13739 msgid "B<SHM_HUGETLB> (since Linux 2.6)"
13740 msgstr "B<SHM_HUGETLB> (Linux 2.6 以降)"
13742 #. type: Plain text
13743 #: build/C/man2/shmget.2:123
13746 #| "Allocate the segment using \"huge pages.\" See the Linux kernel source "
13747 #| "file I<Documentation/vm/hugetlbpage.txt> for further information."
13749 "Allocate the segment using \"huge pages.\" See the Linux kernel source file "
13750 "I<Documentation/admin-guide/mm/hugetlbpage.rst> for further information."
13752 "\"ヒュージページ (huge page)\" を使うセグメントを割り当てる。詳細な情報は、"
13753 "Linux カーネルソースのファイル I<Documentation/vm/hugetlbpage.txt> を参照。"
13756 #: build/C/man2/shmget.2:123
13758 #| msgid "B<SHM_HUGETLB> (since Linux 2.6)"
13759 msgid "B<SHM_HUGE_2MB>, B<SHM_HUGE_1GB> (since Linux 3.8)"
13760 msgstr "B<SHM_HUGETLB> (Linux 2.6 以降)"
13762 #. See https://lwn.net/Articles/533499/
13763 #. type: Plain text
13764 #: build/C/man2/shmget.2:130
13766 "Used in conjunction with B<SHM_HUGETLB> to select alternative hugetlb page "
13767 "sizes (respectively, 2\\ MB and 1\\ GB) on systems that support multiple "
13768 "hugetlb page sizes."
13771 #. type: Plain text
13772 #: build/C/man2/shmget.2:135
13774 "More generally, the desired huge page size can be configured by encoding the "
13775 "base-2 logarithm of the desired page size in the six bits at the offset "
13776 "B<SHM_HUGE_SHIFT>. Thus, the above two constants are defined as:"
13779 #. type: Plain text
13780 #: build/C/man2/shmget.2:140
13783 "#define SHM_HUGE_2MB (21 E<lt>E<lt> SHM_HUGE_SHIFT)\n"
13784 "#define SHM_HUGE_1GB (30 E<lt>E<lt> SHM_HUGE_SHIFT)\n"
13787 #. type: Plain text
13788 #: build/C/man2/shmget.2:146
13790 "For some additional details, see the discussion of the similarly named "
13791 "constants in B<mmap>(2)."
13795 #: build/C/man2/shmget.2:146
13797 msgid "B<SHM_NORESERVE> (since Linux 2.6.15)"
13798 msgstr "B<SHM_NORESERVE> (Linux 2.6.15 以降)"
13800 #. As at 2.6.17-rc2, this flag has no effect if SHM_HUGETLB was also
13802 #. type: Plain text
13803 #: build/C/man2/shmget.2:165
13805 "This flag serves the same purpose as the B<mmap>(2) B<MAP_NORESERVE> flag. "
13806 "Do not reserve swap space for this segment. When swap space is reserved, "
13807 "one has the guarantee that it is possible to modify the segment. When swap "
13808 "space is not reserved one might get B<SIGSEGV> upon a write if no physical "
13809 "memory is available. See also the discussion of the file I</proc/sys/vm/"
13810 "overcommit_memory> in B<proc>(5)."
13812 "このフラグは、 B<mmap>(2) の B<MAP_NORESERVE> フラグと同じ役割を果たす。 こ"
13813 "のセグメントに対するスワップ空間の予約を行わない。 スワップ空間を予約した場合"
13814 "は、そのセグメントの変更が必ず成功することが 保証される。スワップ空間の予約を"
13815 "行わなかった場合は、物理メモリーに空きが ないと書き込み時に B<SIGSEGV> を受け"
13816 "取る可能性がある。 B<proc>(5) にある I</proc/sys/vm/overcommit_memory> ファ"
13819 #. type: Plain text
13820 #: build/C/man2/shmget.2:175
13822 "In addition to the above flags, the least significant 9 bits of I<shmflg> "
13823 "specify the permissions granted to the owner, group, and others. These bits "
13824 "have the same format, and the same meaning, as the I<mode> argument of "
13825 "B<open>(2). Presently, execute permissions are not used by the system."
13827 "上記のフラグに加えて、 I<shmflg> の下位 9 ビットは、所有者、グループ、その他"
13828 "への許可を指定する。 これらのビットは B<open>(2) の I<mode> 引き数と同じ形式"
13829 "で同じ意味を持つ。 今のところ、システムは実行 (execute) 許可を参照しない。"
13831 #. type: Plain text
13832 #: build/C/man2/shmget.2:183
13834 "When a new shared memory segment is created, its contents are initialized to "
13835 "zero values, and its associated data structure, I<shmid_ds> (see "
13836 "B<shmctl>(2)), is initialized as follows:"
13838 "共有メモリーセグメントが新たに作成される際、 共有メモリーセグメントの内容は "
13839 "0 で初期化され、 関連情報を保持するデータ構造体 I<shmid_ds> は以下のように初"
13843 #: build/C/man2/shmget.2:183 build/C/man2/shmget.2:188
13844 #: build/C/man2/shmget.2:193 build/C/man2/shmget.2:198
13845 #: build/C/man2/shmget.2:202 build/C/man2/shmget.2:209 build/C/man2/shmop.2:61
13846 #: build/C/man2/shmop.2:67 build/C/man2/shmop.2:79 build/C/man2/shmop.2:129
13847 #: build/C/man2/shmop.2:132 build/C/man2/shmop.2:135 build/C/man2/shmop.2:156
13848 #: build/C/man2/shmop.2:159 build/C/man2/shmop.2:162
13853 #. type: Plain text
13854 #: build/C/man2/shmget.2:188
13856 "I<shm_perm.cuid> and I<shm_perm.uid> are set to the effective user ID of the "
13859 "I<shm_perm.cuid> と I<shm_perm.uid> に呼び出し元プロセスの実効 (effective) "
13862 #. type: Plain text
13863 #: build/C/man2/shmget.2:193
13865 "I<shm_perm.cgid> and I<shm_perm.gid> are set to the effective group ID of "
13866 "the calling process."
13868 "I<shm_perm.cgid> と I<shm_perm.gid> に呼び出し元プロセスの実効グループID を設"
13871 #. type: Plain text
13872 #: build/C/man2/shmget.2:198
13874 "The least significant 9 bits of I<shm_perm.mode> are set to the least "
13875 "significant 9 bit of I<shmflg>."
13877 "I<shm_perm.mode> の下位 9 ビットに I<shmflg> の下位 9 ビットを設定する。"
13879 #. type: Plain text
13880 #: build/C/man2/shmget.2:202
13881 msgid "I<shm_segsz> is set to the value of I<size>."
13882 msgstr "I<shm_segsz> に I<size> の値を設定する。"
13884 #. type: Plain text
13885 #: build/C/man2/shmget.2:209
13887 "I<shm_lpid>, I<shm_nattch>, I<shm_atime>, and I<shm_dtime> are set to 0."
13889 "I<shm_lpid>, I<shm_nattch>, I<shm_atime>, I<shm_dtime> に 0 を設定する。"
13891 #. type: Plain text
13892 #: build/C/man2/shmget.2:212
13893 msgid "I<shm_ctime> is set to the current time."
13894 msgstr "I<shm_ctime> に現在の時刻を設定する。"
13896 #. type: Plain text
13897 #: build/C/man2/shmget.2:215
13899 "If the shared memory segment already exists, the permissions are verified, "
13900 "and a check is made to see if it is marked for destruction."
13902 "共有メモリーセグメントが既に存在する場合、アクセス許可の検査と、 破壊 "
13903 "(destruction) マークがつけられていないかのチェックが行われる。"
13905 #. type: Plain text
13906 #: build/C/man2/shmget.2:220
13908 "On success, a valid shared memory identifier is returned. On error, -1 is "
13909 "returned, and I<errno> is set to indicate the error."
13911 "成功の場合、有効な共有メモリーセグメントの識別子が返される。 エラーの場合、 "
13912 "-1 が返り、 I<errno> にエラーを示す値が設定される。"
13914 #. type: Plain text
13915 #: build/C/man2/shmget.2:224
13916 msgid "On failure, I<errno> is set to one of the following:"
13917 msgstr "失敗した場合は I<errno> が以下のどれかに設定される:"
13919 #. type: Plain text
13920 #: build/C/man2/shmget.2:230
13923 #| "The user does not have permission to access the shared memory segment, "
13924 #| "and does not have the B<CAP_IPC_OWNER> capability."
13926 "The user does not have permission to access the shared memory segment, and "
13927 "does not have the B<CAP_IPC_OWNER> capability in the user namespace that "
13928 "governs its IPC namespace."
13930 "ユーザーはその共有メモリーセグメントへのアクセス許可を持たず、 "
13931 "B<CAP_IPC_OWNER> ケーパビリティも持っていない。"
13933 #. type: Plain text
13934 #: build/C/man2/shmget.2:239
13936 "B<IPC_CREAT> and B<IPC_EXCL> were specified in I<shmflg>, but a shared "
13937 "memory segment already exists for I<key>."
13939 "B<IPC_CREAT> と B<IPC_EXCL> が I<shmflg> に指定されたが、 I<key> に対応する共"
13940 "有メモリーセグメントはすでに存在する。"
13942 #. type: Plain text
13943 #: build/C/man2/shmget.2:247
13945 "A new segment was to be created and I<size> is less than B<SHMMIN> or "
13946 "greater than B<SHMMAX>."
13948 "新しいセグメントを作成しようとしたが、 I<size> が B<SHMMIN> より小さいか "
13949 "B<SHMMAX> よりも大きかった。"
13951 #. type: Plain text
13952 #: build/C/man2/shmget.2:253
13954 "A segment for the given I<key> exists, but I<size> is greater than the size "
13957 "指定された I<key> に対応するセグメントが既に存在するが、 I<size> がそのセグメ"
13960 #. type: Plain text
13961 #: build/C/man2/shmget.2:262
13963 "No segment exists for the given I<key>, and B<IPC_CREAT> was not specified."
13965 "指定された I<key> に対応するセグメントが存在せず、 B<IPC_CREAT> も指定されて"
13968 #. type: Plain text
13969 #: build/C/man2/shmget.2:265
13970 msgid "No memory could be allocated for segment overhead."
13971 msgstr "セグメントの管理情報 (overhead) に割り当てるメモリーがなかった。"
13973 #. type: Plain text
13974 #: build/C/man2/shmget.2:273
13976 "All possible shared memory IDs have been taken (B<SHMMNI>), or allocating a "
13977 "segment of the requested I<size> would cause the system to exceed the system-"
13978 "wide limit on shared memory (B<SHMALL>)."
13980 "システム全体の共有メモリーセグメント数の制限 (B<SHMMNI>) に達した、または要"
13981 "求された I<size> のセグメントの割り当てが システム全体の共有メモリーサイズの"
13982 "制限 (B<SHMALL>) を超過した。"
13984 #. type: Plain text
13985 #: build/C/man2/shmget.2:280
13987 "The B<SHM_HUGETLB> flag was specified, but the caller was not privileged "
13988 "(did not have the B<CAP_IPC_LOCK> capability)."
13990 "B<SHM_HUGETLB> フラグが指定されたが、呼び出し元には権限がなかった "
13991 "(B<CAP_IPC_LOCK> ケーパビリティを持っていなかった)。"
13993 #. type: Plain text
13994 #: build/C/man2/shmget.2:288
13995 msgid "B<SHM_HUGETLB> and B<SHM_NORESERVE> are Linux extensions."
13996 msgstr "B<SHM_HUGETLB> と B<SHM_NORESERVE> は Linux での拡張である。"
13998 #. type: Plain text
13999 #: build/C/man2/shmget.2:312
14001 "B<IPC_PRIVATE> isn't a flag field but a I<key_t> type. If this special "
14002 "value is used for I<key>, the system call ignores all but the least "
14003 "significant 9 bits of I<shmflg> and creates a new shared memory segment."
14005 "B<IPC_PRIVATE> はフラグではなく I<key_t> 型である。 この特別な値が I<key> に"
14006 "使用された場合は、 B<shmget>() は I<shmflg> の下位 9 ビットを除いた全てを無"
14007 "視し、 新しい共有メモリーセグメントを作成する。"
14010 #: build/C/man2/shmget.2:312
14012 msgid "Shared memory limits"
14015 #. type: Plain text
14016 #: build/C/man2/shmget.2:316
14018 "The following limits on shared memory segment resources affect the "
14019 "B<shmget>() call:"
14021 "B<shmget>() コールに影響する共有メモリーセグメント資源の制限は以下の通りであ"
14025 #: build/C/man2/shmget.2:316
14030 #. type: Plain text
14031 #: build/C/man2/shmget.2:320
14033 "System-wide limit on the total amount of shared memory, measured in units of "
14034 "the system page size."
14036 "共有メモリーの全使用量のシステム全体での上限値。 システムページサイズが単位で"
14039 #. commit 060028bac94bf60a65415d1d55a359c3a17d5c31
14040 #. type: Plain text
14041 #: build/C/man2/shmget.2:326
14043 "On Linux, this limit can be read and modified via I</proc/sys/kernel/"
14044 "shmall>. Since Linux 3.16, the default value for this limit is:"
14046 "Linux では、この上限値は I</proc/sys/kernel/shmall> 経由で参照したり、変更し"
14047 "たりできる。 Linux 3.16 以降では、 この上限値のデフォルト値は以下のとおりであ"
14050 #. type: Plain text
14051 #: build/C/man2/shmget.2:328 build/C/man2/shmget.2:363
14053 msgid " ULONG_MAX - 2^24\n"
14054 msgstr " ULONG_MAX - 2^24\n"
14056 #. type: Plain text
14057 #: build/C/man2/shmget.2:339
14059 "The effect of this value (which is suitable for both 32-bit and 64-bit "
14060 "systems) is to impose no limitation on allocations. This value, rather "
14061 "than B<ULONG_MAX>, was chosen as the default to prevent some cases where "
14062 "historical applications simply raised the existing limit without first "
14063 "checking its current value. Such applications would cause the value to "
14064 "overflow if the limit was set at B<ULONG_MAX>."
14066 "この値は割り当てに関する上限としては適用されない (なお、この値は 32 ビットシ"
14067 "ステムにも 64 ビットシステムにも適したものになっている)。 B<ULONG_MAX> ではな"
14068 "く、この値が選ばれたのは、 古いアプリケーションが最初に現在の値を確認せずに既"
14069 "存の上限をそのまま増やしてしまっても問題が起こらないようなデフォルト値を選ん"
14070 "だからである。 このようなアプリケーションでは、 上限を B<ULONG_MAX> に設定す"
14071 "ると値がオーバーフローしてしまうことになる。"
14073 #. type: Plain text
14074 #: build/C/man2/shmget.2:342
14075 msgid "From Linux 2.4 up to Linux 3.15, the default value for this limit was:"
14076 msgstr "Linux 2.4 から Linux 3.15 では、この上限のデフォルト値は以下であった。"
14078 #. type: Plain text
14079 #: build/C/man2/shmget.2:344
14081 msgid " SHMMAX / PAGE_SIZE * (SHMMNI / 16)\n"
14082 msgstr " SHMMAX / PAGE_SIZE * (SHMMNI / 16)\n"
14084 #. type: Plain text
14085 #: build/C/man2/shmget.2:352
14088 #| "If B<SHMMAX> and B<SHMMNI> were not modified, then multiplying the result "
14089 #| "of this formula by the page size (to get a value in bytes) yielded a "
14090 #| "value of 8 GB as the limit on the total memory used by all shared memory "
14093 "If B<SHMMAX> and B<SHMMNI> were not modified, then multiplying the result of "
14094 "this formula by the page size (to get a value in bytes) yielded a value of "
14095 "8\\ GB as the limit on the total memory used by all shared memory segments."
14097 "B<SHMMAX> と B<SHMMNI> が変更されないとすると、 この式の結果に (バイト単位の"
14098 "値を得るために) ページサイズを掛け算すると、 全ての共有メモリーセグメントで使"
14099 "用される全メモリーの上限として、 8 GB という値が得られる。"
14102 #: build/C/man2/shmget.2:352
14107 #. type: Plain text
14108 #: build/C/man2/shmget.2:355
14109 msgid "Maximum size in bytes for a shared memory segment."
14110 msgstr "1 つの共有メモリーセグメントの最大サイズ (バイト数)。"
14112 #. commit 060028bac94bf60a65415d1d55a359c3a17d5c31
14113 #. type: Plain text
14114 #: build/C/man2/shmget.2:361
14116 "On Linux, this limit can be read and modified via I</proc/sys/kernel/"
14117 "shmmax>. Since Linux 3.16, the default value for this limit is:"
14119 "Linux では、この上限値は I</proc/sys/kernel/shmmax> 経由で参照したり、変更し"
14120 "たりできる。 Linux 3.16 以降では、 この上限値のデフォルト値は以下のとおりであ"
14123 #. type: Plain text
14124 #: build/C/man2/shmget.2:372
14126 "The effect of this value (which is suitable for both 32-bit and 64-bit "
14127 "systems) is to impose no limitation on allocations. See the description of "
14128 "B<SHMALL> for a discussion of why this default value (rather than "
14129 "B<ULONG_MAX>) is used."
14131 "この値は割り当てに関する上限としては適用されない (なお、この値は 32 ビットシ"
14132 "ステムにも 64 ビットシステムにも適したものになっている)。 (B<ULONG_MAX> では"
14133 "なく) このデフォルト値が使われている理由については B<SHMALL> の説明を参照。"
14135 #. type: Plain text
14136 #: build/C/man2/shmget.2:375
14139 #| "From Linux 2.2 up to Linux 3.15, the default value of this limit was "
14140 #| "0x2000000 (32MB)."
14142 "From Linux 2.2 up to Linux 3.15, the default value of this limit was "
14143 "0x2000000 (32\\ MB)."
14145 "Linux 2.2 から Linux 3.15 までは、この上限値のデフォルト値は 0x2000000 "
14148 #. type: Plain text
14149 #: build/C/man2/shmget.2:381
14152 #| "Because it is not possible to map just part of a shared memory segment, "
14153 #| "the amount of virtual memory places another limit on the maximum size of "
14154 #| "a usable segment: for example, on i386 the largest segments that can be "
14155 #| "mapped have a size of around 2.8 GB, and on x86_64 the limit is around "
14158 "Because it is not possible to map just part of a shared memory segment, the "
14159 "amount of virtual memory places another limit on the maximum size of a "
14160 "usable segment: for example, on i386 the largest segments that can be mapped "
14161 "have a size of around 2.8\\ GB, and on x86-64 the limit is around 127 TB."
14163 "共有メモリーセグメントの一部分だけをマッピングすることはできないので、 使用可"
14164 "能なセグメントの最大サイズには仮想メモリーの総量という別の上限が適用される。 "
14165 "例えば、i386 ではマッピング可能な最大セグメントの大きさはおおよそ 2.8GB で、 "
14166 "x86_64 では上限はおおよそ 127TB である。"
14169 #: build/C/man2/shmget.2:381
14174 #. type: Plain text
14175 #: build/C/man2/shmget.2:387
14177 "Minimum size in bytes for a shared memory segment: implementation dependent "
14178 "(currently 1 byte, though B<PAGE_SIZE> is the effective minimum size)."
14180 "共有メモリーセグメントのバイト単位の大きさの下限: 実装依存 (現在は 1 バイトだ"
14181 "が、実質的な最小サイズは B<PAGE_SIZE> である)。"
14184 #: build/C/man2/shmget.2:387
14189 #. type: Plain text
14190 #: build/C/man2/shmget.2:392
14192 "System-wide limit on the number of shared memory segments. In Linux 2.2, "
14193 "the default value for this limit was 128; since Linux 2.4, the default value "
14196 "システム全体の共有メモリーセグメント数の上限値。 この上限値のデフォルトは、 "
14197 "Linux 2.2 以降では 128、 Linux 2.4 以降で 4096 である。"
14199 #. Kernels between 2.4.x and 2.6.8 had an off-by-one error that meant
14200 #. that we could create one more segment than SHMMNI -- MTK
14201 #. This /proc file is not available in Linux 2.2 and earlier -- MTK
14202 #. type: Plain text
14203 #: build/C/man2/shmget.2:398
14205 "On Linux, this limit can be read and modified via I</proc/sys/kernel/shmmni>."
14207 "Linux では、この上限値は I</proc/sys/kernel/shmmni> 経由で参照したり、変更し"
14210 #. type: Plain text
14211 #: build/C/man2/shmget.2:402
14213 "The implementation has no specific limits for the per-process maximum number "
14214 "of shared memory segments (B<SHMSEG>)."
14216 "プロセス当りの共有メモリーセグメントの個数の最大値 (B<SHMSEG>) に関する実装"
14219 #. type: Plain text
14220 #: build/C/man2/shmget.2:408
14222 "Until version 2.3.30, Linux would return B<EIDRM> for a B<shmget>() on a "
14223 "shared memory segment scheduled for deletion."
14225 "バージョン 2.3.30 までは、Linux は 削除が予定されている共有メモリーセグメント"
14226 "に対して B<shmget>() が行われると B<EIDRM> を返していた。"
14228 #. type: Plain text
14229 #: build/C/man2/shmget.2:414
14231 "The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
14232 "more clearly show its function."
14234 "B<IPC_PRIVATE> という名前を選んだのはおそらく失敗であろう。 B<IPC_NEW> の方が"
14235 "より明確にその機能を表しているだろう。"
14237 #. type: Plain text
14238 #: build/C/man2/shmget.2:417
14240 #| msgid "B<shm_open>(3)"
14241 msgid "See B<shmop>(2)."
14242 msgstr "B<shm_open>(3)"
14244 #. type: Plain text
14245 #: build/C/man2/shmget.2:426
14248 #| "B<memfd_create>(2), B<shmat>(2), B<shmctl>(2), B<shmdt>(2), B<ftok>(3), "
14249 #| "B<capabilities>(7), B<shm_overview>(7), B<svipc>(7)"
14251 "B<memfd_create>(2), B<shmat>(2), B<shmctl>(2), B<shmdt>(2), B<ftok>(3), "
14252 "B<capabilities>(7), B<shm_overview>(7), B<sysvipc>(7)"
14254 "B<memfd_create>(2), B<shmat>(2), B<shmctl>(2), B<shmdt>(2), B<ftok>(3), "
14255 "B<capabilities>(7), B<shm_overview>(7), B<svipc>(7)"
14258 #: build/C/man2/shmop.2:40
14263 #. type: Plain text
14264 #: build/C/man2/shmop.2:43
14265 msgid "shmat, shmdt - System V shared memory operations"
14266 msgstr "shmat, shmdt - System V 共有メモリー (shared memory) の操作"
14268 #. type: Plain text
14269 #: build/C/man2/shmop.2:47
14272 "B<#include E<lt>sys/types.hE<gt>>\n"
14273 "B<#include E<lt>sys/shm.hE<gt>>\n"
14275 "B<#include E<lt>sys/types.hE<gt>>\n"
14276 "B<#include E<lt>sys/shm.hE<gt>>\n"
14278 #. type: Plain text
14279 #: build/C/man2/shmop.2:49
14281 msgid "B<void *shmat(int >I<shmid>B<, const void *>I<shmaddr>B<, int >I<shmflg>B<);>\n"
14282 msgstr "B<void *shmat(int >I<shmid>B<, const void *>I<shmaddr>B<, int >I<shmflg>B<);>\n"
14284 #. type: Plain text
14285 #: build/C/man2/shmop.2:51
14287 msgid "B<int shmdt(const void *>I<shmaddr>B<);>\n"
14288 msgstr "B<int shmdt(const void *>I<shmaddr>B<);>\n"
14291 #: build/C/man2/shmop.2:53
14296 #. type: Plain text
14297 #: build/C/man2/shmop.2:61
14299 "B<shmat>() attaches the System\\ V shared memory segment identified by "
14300 "I<shmid> to the address space of the calling process. The attaching address "
14301 "is specified by I<shmaddr> with one of the following criteria:"
14303 "B<shmat>() は I<shmid> で指定された System\\ V 共有メモリーセグメント "
14304 "(shared memory segment) を コールしたプロセスのアドレス空間に付加 (attach) す"
14305 "る。 付加するアドレスは I<shmaddr> に以下のどれかの形式で指定する:"
14307 #. type: Plain text
14308 #: build/C/man2/shmop.2:67
14311 #| "If I<shmaddr> is NULL, the system chooses a suitable (unused) address at "
14312 #| "which to attach the segment."
14314 "If I<shmaddr> is NULL, the system chooses a suitable (unused) page-aligned "
14315 "address to attach the segment."
14317 "I<shmaddr> が NULL ならば、システムはセグメントを付加するための 適切な (使用"
14318 "されていない) アドレスを選択する。"
14320 #. type: Plain text
14321 #: build/C/man2/shmop.2:79
14323 "If I<shmaddr> isn't NULL and B<SHM_RND> is specified in I<shmflg>, the "
14324 "attach occurs at the address equal to I<shmaddr> rounded down to the nearest "
14325 "multiple of B<SHMLBA>."
14327 "I<shmaddr> が NULL でなく B<SHM_RND> が I<shmflg> に指定されている場合は、 "
14328 "I<shmaddr> を B<SHMLBA> の倍数へと切り捨てた (rounding down) のと等しいアドレ"
14331 #. type: Plain text
14332 #: build/C/man2/shmop.2:83
14334 "Otherwise, I<shmaddr> must be a page-aligned address at which the attach "
14337 "その他の場合は I<shmaddr> は付加を行なうアドレスで、ページ境界を指している必"
14340 #. type: Plain text
14341 #: build/C/man2/shmop.2:89
14343 "In addition to B<SHM_RND>, the following flags may be specified in the "
14344 "I<shmflg> bit-mask argument:"
14346 "B<SHM_RND> に加えて、以下のフラグを I<shmflg> ビットマスク引き数に指定でき"
14350 #: build/C/man2/shmop.2:89
14352 msgid "B<SHM_EXEC> (Linux-specific; since Linux 2.6.9)"
14353 msgstr "B<SHM_EXEC> (Linux 固有; Linux 2.6.9 以降)"
14355 #. type: Plain text
14356 #: build/C/man2/shmop.2:93
14358 "Allow the contents of the segment to be executed. The caller must have "
14359 "execute permission on the segment."
14361 "セグメントの内容を実行できる。 呼び出し元はセグメントに対する実行許可を持って"
14365 #: build/C/man2/shmop.2:93
14367 msgid "B<SHM_RDONLY>"
14368 msgstr "B<SHM_RDONLY>"
14370 #. type: Plain text
14371 #: build/C/man2/shmop.2:101
14373 "Attach the segment for read-only access. The process must have read "
14374 "permission for the segment. If this flag is not specified, the segment is "
14375 "attached for read and write access, and the process must have read and write "
14376 "permission for the segment. There is no notion of a write-only shared "
14379 "セグメントを読み込み専用に付加する。 プロセスはそのセグメントへの読み込み許可"
14380 "を持っていなければならない。 このフラグが指定されなかった場合、そのセグメント"
14381 "は読み込みと書き込みアクセスのために付加され、 プロセスはそのセグメントに読み"
14382 "込みと書き込みの許可を持っていなければならない。 書き込み専用の共有メモリーセ"
14386 #: build/C/man2/shmop.2:101
14388 msgid "B<SHM_REMAP> (Linux-specific)"
14389 msgstr "B<SHM_REMAP> (Linux 固有)"
14391 #. type: Plain text
14392 #: build/C/man2/shmop.2:114
14394 "This flag specifies that the mapping of the segment should replace any "
14395 "existing mapping in the range starting at I<shmaddr> and continuing for the "
14396 "size of the segment. (Normally, an B<EINVAL> error would result if a "
14397 "mapping already exists in this address range.) In this case, I<shmaddr> "
14398 "must not be NULL."
14400 "このフラグは、 セグメントのマッピングを既存のマッピングに置き換えることを指示"
14401 "する。 マッピングの範囲は、 I<shmaddr> から始まりセグメントのサイズ分だけあ"
14402 "る (通常 B<EINVAL> エラーは、このアドレス範囲にマッピングが既に存在するために"
14403 "起る)。 このフラグを指定する場合は、 I<shmaddr> が NULL であってはならない。"
14405 #. type: Plain text
14406 #: build/C/man2/shmop.2:121
14408 "The B<brk>(2) value of the calling process is not altered by the attach. "
14409 "The segment will automatically be detached at process exit. The same "
14410 "segment may be attached as a read and as a read-write one, and more than "
14411 "once, in the process's address space."
14413 "呼び出したプロセスの B<brk>(2) の値は付加によって変化しない。 そのセグメント"
14414 "はプロセスが終了 (exit) したら自動的に分離 (detach) される。 同じセグメントを"
14415 "プロセスのアドレス空間に、読み込み専用および読み書き両用 として付加でき、また"
14418 #. type: Plain text
14419 #: build/C/man2/shmop.2:129
14421 "A successful B<shmat>() call updates the members of the I<shmid_ds> "
14422 "structure (see B<shmctl>(2)) associated with the shared memory segment as "
14425 "成功した B<shmat>() コールは共有メモリーセグメントに関連する I<shmid_ds> 構"
14426 "造体 (B<shmctl>(2) を参照) のメンバーを以下のように更新する:"
14428 #. type: Plain text
14429 #: build/C/man2/shmop.2:132
14430 msgid "I<shm_atime> is set to the current time."
14431 msgstr "I<shm_atime> には現在の時刻を設定する。"
14433 #. type: Plain text
14434 #: build/C/man2/shmop.2:135 build/C/man2/shmop.2:162
14435 msgid "I<shm_lpid> is set to the process-ID of the calling process."
14436 msgstr "I<shm_lpid> には呼び出したプロセスのプロセス ID が設定される。"
14438 #. type: Plain text
14439 #: build/C/man2/shmop.2:139
14440 msgid "I<shm_nattch> is incremented by one."
14441 msgstr "I<shm_nattch> を 1 増加させる。"
14444 #: build/C/man2/shmop.2:139
14449 #. type: Plain text
14450 #: build/C/man2/shmop.2:150
14452 "B<shmdt>() detaches the shared memory segment located at the address "
14453 "specified by I<shmaddr> from the address space of the calling process. The "
14454 "to-be-detached segment must be currently attached with I<shmaddr> equal to "
14455 "the value returned by the attaching B<shmat>() call."
14457 "B<shmdt>() は呼び出したプロセスのアドレス空間から I<shmaddr> で指定されたア"
14458 "ドレスに配置された共有メモリーセグメントを分離 (detach) する。 分離する共有メ"
14459 "モリーセグメントは、現在 I<shmaddr> に付加されているものでなければならない。 "
14460 "I<shmaddr> は、それを付加した時に B<shmat>() が返した値に等しくなければなら"
14463 #. type: Plain text
14464 #: build/C/man2/shmop.2:156
14466 "On a successful B<shmdt>() call, the system updates the members of the "
14467 "I<shmid_ds> structure associated with the shared memory segment as follows:"
14469 "成功した B<shmdt>() コールはその共有メモリーセグメントに関連する "
14470 "I<shmid_ds> 構造体のメンバーを以下のように更新する:"
14472 #. type: Plain text
14473 #: build/C/man2/shmop.2:159
14474 msgid "I<shm_dtime> is set to the current time."
14475 msgstr "I<shm_dtime> には現在の時刻が設定される。"
14477 #. type: Plain text
14478 #: build/C/man2/shmop.2:167
14480 "I<shm_nattch> is decremented by one. If it becomes 0 and the segment is "
14481 "marked for deletion, the segment is deleted."
14483 "I<shm_nattch> を 1 減少させる。 もし 0 になり、削除マークがあった場合は その"
14486 #. type: Plain text
14487 #: build/C/man2/shmop.2:175
14489 "On success, B<shmat>() returns the address of the attached shared memory "
14490 "segment; on error, I<(void\\ *)\\ -1> is returned, and I<errno> is set to "
14491 "indicate the cause of the error."
14493 "B<shmat>() は、成功した場合、 付加された共有メモリーセグメントのアドレスを返"
14494 "す。 エラーの場合、 I<(void\\ *)\\ -1> を返し、 I<errno> にエラーの原因を示す"
14497 #. type: Plain text
14498 #: build/C/man2/shmop.2:181
14500 "On success, B<shmdt>() returns 0; on error -1 is returned, and I<errno> is "
14501 "set to indicate the cause of the error."
14503 "B<shmdt>() は、成功すると 0 を返す。 エラーの場合、-1 を返し、 I<errno> にエ"
14506 #. type: Plain text
14507 #: build/C/man2/shmop.2:187
14508 msgid "When B<shmat>() fails, I<errno> is set to one of the following:"
14510 "B<shmat>() が失敗した場合、 I<errno> に以下の値のどれかを設定して返す:"
14512 #. type: Plain text
14513 #: build/C/man2/shmop.2:193
14516 #| "The calling process does not have the required permissions for the "
14517 #| "requested attach type, and does not have the B<CAP_IPC_OWNER> capability."
14519 "The calling process does not have the required permissions for the requested "
14520 "attach type, and does not have the B<CAP_IPC_OWNER> capability in the user "
14521 "namespace that governs its IPC namespace."
14523 "呼び出したプロセスに要求された種類の付加に必要な許可がなく、 "
14524 "B<CAP_IPC_OWNER> ケーパビリティ (capability) がない。"
14526 #. type: Plain text
14527 #: build/C/man2/shmop.2:210
14529 "Invalid I<shmid> value, unaligned (i.e., not page-aligned and B<SHM_RND> was "
14530 "not specified) or invalid I<shmaddr> value, or can't attach segment at "
14531 "I<shmaddr>, or B<SHM_REMAP> was specified and I<shmaddr> was NULL."
14533 "I<shmid> の値が不正である。 I<shmaddr> の値が境界違反 (unaligned) (つまり、"
14534 "ページ境界に合っておらず、 B<SHM_RND> が指定されていない) または が不正であ"
14535 "る。 I<shmaddr> へのセグメントの付加に失敗した。 または B<SHM_REMAP> が指定さ"
14536 "れているが、 I<shmaddr> が NULL であった。"
14538 #. type: Plain text
14539 #: build/C/man2/shmop.2:213
14540 msgid "Could not allocate memory for the descriptor or for the page tables."
14542 "ディスクリプター (descriptor) やページテーブルのためのメモリーを 割り当てるこ"
14545 #. type: Plain text
14546 #: build/C/man2/shmop.2:219
14547 msgid "When B<shmdt>() fails, I<errno> is set as follows:"
14548 msgstr "B<shmdt>() が失敗した場合、 B<EINVAL> は以下のようにセットされる:"
14550 #. The following since 2.6.17-rc1:
14551 #. type: Plain text
14552 #: build/C/man2/shmop.2:227
14554 "There is no shared memory segment attached at I<shmaddr>; or, I<shmaddr> is "
14555 "not aligned on a page boundary."
14557 "I<shmaddr> に付加された共有メモリーセグメントが存在しない。 もしくは、 "
14558 "I<shmaddr> がページ境界に合っていない。"
14560 #. type: Plain text
14561 #: build/C/man2/shmop.2:242
14563 "In SVID 3 (or perhaps earlier), the type of the I<shmaddr> argument was "
14564 "changed from I<char\\ *> into I<const void\\ *>, and the returned type of "
14565 "B<shmat>() from I<char\\ *> into I<void\\ *>."
14567 "SVID 3 で (たぶんそれより前だと思うが) I<shmaddr> 引き数の型は I<char\\ *> "
14568 "から I<const void\\ *> に、I<shmat>() の返り値の型は I<char\\ *> から I<void"
14571 #. type: Plain text
14572 #: build/C/man2/shmop.2:246
14574 "After a B<fork>(2), the child inherits the attached shared memory segments."
14576 "B<fork>(2) した後、子プロセスは付加された共有メモリーセグメントを継承する。"
14578 #. type: Plain text
14579 #: build/C/man2/shmop.2:250
14581 "After an B<execve>(2), all attached shared memory segments are detached from "
14584 "B<exec>(2) した後、全ての付加された共有メモリーセグメントはプロセスから分離"
14587 #. type: Plain text
14588 #: build/C/man2/shmop.2:254
14590 "Upon B<_exit>(2), all attached shared memory segments are detached from the "
14593 "B<exit>(2) において、全ての付加された共有メモリーセグメントはプロセスから分"
14596 #. type: Plain text
14597 #: build/C/man2/shmop.2:266
14599 "Using B<shmat>() with I<shmaddr> equal to NULL is the preferred, portable "
14600 "way of attaching a shared memory segment. Be aware that the shared memory "
14601 "segment attached in this way may be attached at different addresses in "
14602 "different processes. Therefore, any pointers maintained within the shared "
14603 "memory must be made relative (typically to the starting address of the "
14604 "segment), rather than absolute."
14606 "共有メモリーセグメントを付加する場合の移植性の高い方法としては、 I<shmaddr> "
14607 "を NULL にして B<shmat>() を使用するのがよい。 このような方法で付加される共"
14608 "有メモリーセグメントは、 プロセスが異なれば別のアドレスに付加される、という点"
14609 "に注意すること。 よって共有メモリー内で管理されるポインターは、 絶対アドレス"
14610 "ではなく、 (一般的にはセグメントの開始アドレスからの) 相対アドレスで作成する"
14613 #. type: Plain text
14614 #: build/C/man2/shmop.2:271
14617 #| "On Linux, it is possible to attach a shared memory segment even if it is "
14618 #| "already marked to be deleted. However, POSIX.1-2001 does not specify "
14619 #| "this behavior and many other implementations do not support it."
14621 "On Linux, it is possible to attach a shared memory segment even if it is "
14622 "already marked to be deleted. However, POSIX.1 does not specify this "
14623 "behavior and many other implementations do not support it."
14625 "Linux では共有メモリーセグメントに既に削除マークが付けられていても、 その共有"
14626 "メモリーセグメントを付加することができる。 しかし POSIX.1-2001 ではこのような"
14627 "動作を指定しておらず、 他の多くの実装もこれをサポートしていない。"
14629 #. type: Plain text
14630 #: build/C/man2/shmop.2:274
14631 msgid "The following system parameter affects B<shmat>():"
14632 msgstr "以下のシステムパラメーターは、 B<shmat>() に影響する:"
14635 #: build/C/man2/shmop.2:274
14640 #. type: Plain text
14641 #: build/C/man2/shmop.2:289
14644 #| "Segment low boundary address multiple. When explicitly specifying an "
14645 #| "attach address in a call to B<shmat>(), the caller should ensure that the "
14646 #| "address is a multiple of this value. This is necessary on some "
14647 #| "architectures, in order either to ensure good CPU cache performance or to "
14648 #| "ensure that different attaches of the same segment have consistent views "
14649 #| "within the CPU cache. B<SHMLBA> is normally some multiple of the system "
14650 #| "page size (on many Linux architectures, it is the same as the system page "
14653 "Segment low boundary address multiple. When explicitly specifying an attach "
14654 "address in a call to B<shmat>(), the caller should ensure that the address "
14655 "is a multiple of this value. This is necessary on some architectures, in "
14656 "order either to ensure good CPU cache performance or to ensure that "
14657 "different attaches of the same segment have consistent views within the CPU "
14658 "cache. B<SHMLBA> is normally some multiple of the system page size. (On "
14659 "many Linux architectures, B<SHMLBA> is the same as the system page size.)"
14661 "セグメントの下限アドレス倍数 (Segment low boundary address multiple)。 "
14662 "B<shmat>() の呼び出しにおいて付加するアドレスを明示的に指定する際、 呼び出し"
14663 "元は指定するアドレスがこの値の倍数になるように保証しなければならない。 これは"
14664 "いくつかのアーキテクチャーでは必要なことで、 CPU キャッシュの性能を保証するた"
14665 "めであったり、 同じセグメントの別の付与を CPU キャッシュ内部で一貫して扱える"
14666 "ようにするためだったりする。 B<SHMLBA> は通常はシステムページサイズの倍数であ"
14667 "る (Linux の多くのアーキテクチャーではシステムページサイズと同じである)。"
14669 #. type: Plain text
14670 #: build/C/man2/shmop.2:293
14672 "The implementation places no intrinsic per-process limit on the number of "
14673 "shared memory segments (B<SHMSEG>)."
14675 "現在の実装では、プロセスごとの 共有メモリーセグメントの最大数 (B<SHMSEG>) に"
14678 #. type: Plain text
14679 #: build/C/man2/shmop.2:297
14681 "The two programs shown below exchange a string using a shared memory "
14682 "segment. Further details about the programs are given below. First, we "
14683 "show a shell session demonstrating their use."
14686 #. type: Plain text
14687 #: build/C/man2/shmop.2:302
14689 "In one terminal window, we run the \"reader\" program, which creates a "
14690 "System V shared memory segment and a System V semaphore set. The program "
14691 "prints out the IDs of the created objects, and then waits for the semaphore "
14695 #. type: Plain text
14696 #: build/C/man2/shmop.2:307
14699 "$ B<./svshm_string_read>\n"
14700 "shmid = 1114194; semid = 15\n"
14703 #. type: Plain text
14704 #: build/C/man2/shmop.2:316
14706 "In another terminal window, we run the \"writer\" program. The \"writer\" "
14707 "program takes three command-line arguments: the IDs of the shared memory "
14708 "segment and semaphore set created by the \"reader\", and a string. It "
14709 "attaches the existing shared memory segment, copies the string to the shared "
14710 "memory, and modifies the semaphore value."
14713 #. type: Plain text
14714 #: build/C/man2/shmop.2:320
14716 msgid "$ B<./svshm_string_write 1114194 15 \\(aqHello, world\\(aq>\n"
14719 #. type: Plain text
14720 #: build/C/man2/shmop.2:327
14722 "Returning to the terminal where the \"reader\" is running, we see that the "
14723 "program has ceased waiting on the semaphore and has printed the string that "
14724 "was copied into the shared memory segment by the writer:"
14727 #. type: Plain text
14728 #: build/C/man2/shmop.2:331
14730 msgid "Hello, world\n"
14734 #: build/C/man2/shmop.2:334
14736 #| msgid "Program source: t_memfd_create.c"
14737 msgid "Program source: svshm_string.h"
14738 msgstr "プログラムのソース: t_memfd_create.c"
14740 #. type: Plain text
14741 #: build/C/man2/shmop.2:336
14743 "The following header file is included by the \"reader\" and \"writer\" "
14747 #. type: Plain text
14748 #: build/C/man2/shmop.2:346
14751 #| "#include E<lt>unistd.hE<gt>\n"
14752 #| "#include E<lt>signal.hE<gt>\n"
14753 #| "#include E<lt>stdio.hE<gt>\n"
14754 #| "#include E<lt>malloc.hE<gt>\n"
14755 #| "#include E<lt>stdlib.hE<gt>\n"
14756 #| "#include E<lt>errno.hE<gt>\n"
14757 #| "#include E<lt>sys/mman.hE<gt>\n"
14759 "#include E<lt>sys/types.hE<gt>\n"
14760 "#include E<lt>sys/ipc.hE<gt>\n"
14761 "#include E<lt>sys/shm.hE<gt>\n"
14762 "#include E<lt>sys/sem.hE<gt>\n"
14763 "#include E<lt>stdio.hE<gt>\n"
14764 "#include E<lt>stdlib.hE<gt>\n"
14765 "#include E<lt>string.hE<gt>\n"
14767 "#include E<lt>unistd.hE<gt>\n"
14768 "#include E<lt>signal.hE<gt>\n"
14769 "#include E<lt>stdio.hE<gt>\n"
14770 "#include E<lt>malloc.hE<gt>\n"
14771 "#include E<lt>stdlib.hE<gt>\n"
14772 "#include E<lt>errno.hE<gt>\n"
14773 "#include E<lt>sys/mman.hE<gt>\n"
14775 #. type: Plain text
14776 #: build/C/man2/shmop.2:358
14779 "union semun { /* Used in calls to semctl() */\n"
14781 " struct semid_ds * buf;\n"
14782 " unsigned short * array;\n"
14783 "#if defined(__linux__)\n"
14784 " struct seminfo * __buf;\n"
14789 #. type: Plain text
14790 #: build/C/man2/shmop.2:360
14792 msgid "#define MEM_SIZE 4096\n"
14796 #: build/C/man2/shmop.2:363
14798 #| msgid "Program source: t_get_seals.c"
14799 msgid "Program source: svshm_string_read.c"
14800 msgstr "プログラムのソース: t_get_seals.c"
14802 #. type: Plain text
14803 #: build/C/man2/shmop.2:371
14805 "The \"reader\" program creates a shared memory segment and a semaphore set "
14806 "containing one semaphore. It then attaches the shared memory object into "
14807 "its address space and initializes the semaphore value to 1. Finally, the "
14808 "program waits for the semaphore value to become 0, and afterwards prints the "
14809 "string that has been copied into the shared memory segment by the \"writer\"."
14812 #. type: Plain text
14813 #: build/C/man2/shmop.2:375
14815 msgid "/* svshm_string_read.c\n"
14818 #. type: Plain text
14819 #: build/C/man2/shmop.2:379 build/C/man2/shmop.2:453
14822 " Licensed under GNU General Public License v2 or later.\n"
14824 "#include \"svshm_string.h\"\n"
14827 #. type: Plain text
14828 #: build/C/man2/shmop.2:387
14832 #| "main(int argc, char *argv[])\n"
14835 #| " unsigned int seals;\n"
14838 "main(int argc, char *argv[])\n"
14840 " int semid, shmid;\n"
14841 " union semun arg, dummy;\n"
14842 " struct sembuf sop;\n"
14846 "main(int argc, char *argv[])\n"
14849 " unsigned int seals;\n"
14851 #. type: Plain text
14852 #: build/C/man2/shmop.2:390
14855 " /* Create shared memory and semaphore set containing one\n"
14859 #. type: Plain text
14860 #: build/C/man2/shmop.2:394
14863 #| " seals = fcntl(fd, F_GET_SEALS);\n"
14864 #| " if (seals == -1)\n"
14865 #| " errExit(\"fcntl\");\n"
14867 " shmid = shmget(IPC_PRIVATE, MEM_SIZE, IPC_CREAT | 0600);\n"
14868 " if (shmid == -1)\n"
14869 " errExit(\"shmget\");\n"
14871 " seals = fcntl(fd, F_GET_SEALS);\n"
14872 " if (seals == -1)\n"
14873 " errExit(\"fcntl\");\n"
14875 #. type: Plain text
14876 #: build/C/man2/shmop.2:398
14879 #| " fd = open(argv[1], O_RDWR);\n"
14880 #| " if (fd == -1)\n"
14881 #| " errExit(\"open\");\n"
14883 " semid = semget(IPC_PRIVATE, 1, IPC_CREAT | 0600);\n"
14884 " if (shmid == -1)\n"
14885 " errExit(\"shmget\");\n"
14887 " fd = open(argv[1], O_RDWR);\n"
14889 " errExit(\"open\");\n"
14891 #. type: Plain text
14892 #: build/C/man2/shmop.2:400
14894 msgid " /* Attach shared memory into our address space */\n"
14897 #. type: Plain text
14898 #: build/C/man2/shmop.2:404
14901 #| " fd = memfd_create(name, MFD_ALLOW_SEALING);\n"
14902 #| " if (fd == -1)\n"
14903 #| " errExit(\"memfd_create\");\n"
14905 " addr = shmat(shmid, NULL, SHM_RDONLY);\n"
14906 " if (addr == (void *) -1)\n"
14907 " errExit(\"shmat\");\n"
14909 " fd = memfd_create(name, MFD_ALLOW_SEALING);\n"
14911 " errExit(\"memfd_create\");\n"
14913 #. type: Plain text
14914 #: build/C/man2/shmop.2:406
14916 msgid " /* Initialize semaphore 0 in set with value 1 */\n"
14919 #. type: Plain text
14920 #: build/C/man2/shmop.2:410
14923 #| " if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n"
14924 #| " errExit(\"fcntl\");\n"
14928 " if (semctl(semid, 0, SETVAL, arg) == -1)\n"
14929 " errExit(\"semctl\");\n"
14931 " if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n"
14932 " errExit(\"fcntl\");\n"
14935 #. type: Plain text
14936 #: build/C/man2/shmop.2:412
14938 msgid " printf(\"shmid = %d; semid = %d\\en\", shmid, semid);\n"
14941 #. type: Plain text
14942 #: build/C/man2/shmop.2:414
14944 msgid " /* Wait for semaphore value to become 0 */\n"
14947 #. type: Plain text
14948 #: build/C/man2/shmop.2:418
14951 " sop.sem_num = 0;\n"
14952 " sop.sem_op = 0;\n"
14953 " sop.sem_flg = 0;\n"
14956 #. type: Plain text
14957 #: build/C/man2/shmop.2:421 build/C/man2/shmop.2:495
14960 #| " if (ftruncate(fd, len) == -1)\n"
14961 #| " errExit(\"truncate\");\n"
14963 " if (semop(semid, &sop, 1) == -1)\n"
14964 " errExit(\"semop\");\n"
14966 " if (ftruncate(fd, len) == -1)\n"
14967 " errExit(\"truncate\");\n"
14969 #. type: Plain text
14970 #: build/C/man2/shmop.2:423
14972 #| msgid " /* The main thread also allocates some memory */\n"
14973 msgid " /* Print the string from shared memory */\n"
14974 msgstr " /* The main thread also allocates some memory */\n"
14976 #. type: Plain text
14977 #: build/C/man2/shmop.2:425
14979 msgid " printf(\"%s\\en\", addr);\n"
14982 #. type: Plain text
14983 #: build/C/man2/shmop.2:427
14985 msgid " /* Remove shared memory and semaphore set */\n"
14988 #. type: Plain text
14989 #: build/C/man2/shmop.2:432
14992 " if (shmctl(shmid, IPC_RMID, NULL) == -1)\n"
14993 " errExit(\"shmctl\");\n"
14994 " if (semctl(semid, 0, IPC_RMID, dummy) == -1)\n"
14995 " errExit(\"semctl\");\n"
14999 #: build/C/man2/shmop.2:438
15001 #| msgid "Program source: t_get_seals.c"
15002 msgid "Program source: svshm_string_write.c"
15003 msgstr "プログラムのソース: t_get_seals.c"
15005 #. type: Plain text
15006 #: build/C/man2/shmop.2:445
15008 "The writer program takes three command-line arguments: the IDs of the shared "
15009 "memory segment and semaphore set that have already been created by the "
15010 "\"reader\", and a string. It attaches the shared memory segment into its "
15011 "address space, and then decrements the semaphore value to 0 in order to "
15012 "inform the \"reader\" that it can now examine the contents of the shared "
15016 #. type: Plain text
15017 #: build/C/man2/shmop.2:449
15019 msgid "/* svshm_string_write.c\n"
15022 #. type: Plain text
15023 #: build/C/man2/shmop.2:461
15027 #| "main(int argc, char *argv[])\n"
15030 #| " unsigned int seals;\n"
15031 #| " char *addr;\n"
15032 #| " char *name, *seals_arg;\n"
15033 #| " ssize_t len;\n"
15036 "main(int argc, char *argv[])\n"
15038 " int semid, shmid;\n"
15039 " struct sembuf sop;\n"
15044 "main(int argc, char *argv[])\n"
15047 " unsigned int seals;\n"
15049 " char *name, *seals_arg;\n"
15052 #. type: Plain text
15053 #: build/C/man2/shmop.2:466
15056 #| " if (argc != 2) {\n"
15057 #| " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
15058 #| " exit(EXIT_FAILURE);\n"
15061 " if (argc != 4) {\n"
15062 " fprintf(stderr, \"Usage: %s shmid semid string\\en\", argv[0]);\n"
15063 " exit(EXIT_FAILURE);\n"
15066 " if (argc != 2) {\n"
15067 " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
15068 " exit(EXIT_FAILURE);\n"
15071 #. type: Plain text
15072 #: build/C/man2/shmop.2:472
15075 #| " p = malloc(1000);\n"
15076 #| " if (p == NULL) {\n"
15077 #| " fprintf(stderr, \"malloc() failed\");\n"
15078 #| " exit(EXIT_FAILURE);\n"
15081 " len = strlen(argv[3]) + 1; /* +1 to include trailing \\(aq\\e0\\(aq */\n"
15082 " if (len E<gt> MEM_SIZE) {\n"
15083 " fprintf(stderr, \"String is too big!\\en\");\n"
15084 " exit(EXIT_FAILURE);\n"
15087 " p = malloc(1000);\n"
15088 " if (p == NULL) {\n"
15089 " fprintf(stderr, \"malloc() failed\");\n"
15090 " exit(EXIT_FAILURE);\n"
15093 #. type: Plain text
15094 #: build/C/man2/shmop.2:474
15096 #| msgid " /* Size the file as specified on the command line */\n"
15097 msgid " /* Get object IDs from command-line */\n"
15098 msgstr " /* Size the file as specified on the command line */\n"
15100 #. type: Plain text
15101 #: build/C/man2/shmop.2:477
15104 #| " name = argv[1];\n"
15105 #| " len = atoi(argv[2]);\n"
15106 #| " seals_arg = argv[3];\n"
15108 " shmid = atoi(argv[1]);\n"
15109 " semid = atoi(argv[2]);\n"
15111 " name = argv[1];\n"
15112 " len = atoi(argv[2]);\n"
15113 " seals_arg = argv[3];\n"
15115 #. type: Plain text
15116 #: build/C/man2/shmop.2:480
15119 " /* Attach shared memory into our address space and copy string\n"
15120 " (including trailing null byte) into memory. */\n"
15123 #. type: Plain text
15124 #: build/C/man2/shmop.2:484
15127 #| " seals = fcntl(fd, F_GET_SEALS);\n"
15128 #| " if (seals == -1)\n"
15129 #| " errExit(\"fcntl\");\n"
15131 " addr = shmat(shmid, NULL, 0);\n"
15132 " if (addr == (void *) -1)\n"
15133 " errExit(\"shmat\");\n"
15135 " seals = fcntl(fd, F_GET_SEALS);\n"
15136 " if (seals == -1)\n"
15137 " errExit(\"fcntl\");\n"
15139 #. type: Plain text
15140 #: build/C/man2/shmop.2:486
15142 msgid " memcpy(addr, argv[3], len);\n"
15145 #. type: Plain text
15146 #: build/C/man2/shmop.2:488
15148 msgid " /* Decrement semaphore to 0 */\n"
15151 #. type: Plain text
15152 #: build/C/man2/shmop.2:492
15155 " sop.sem_num = 0;\n"
15156 " sop.sem_op = -1;\n"
15157 " sop.sem_flg = 0;\n"
15160 #. type: Plain text
15161 #: build/C/man2/shmop.2:508
15164 #| "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
15165 #| "B<shm_overview>(7), B<svipc>(7)"
15167 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
15168 "B<shm_overview>(7), B<sysvipc>(7)"
15170 "B<brk>(2), B<mmap>(2), B<shmctl>(2), B<shmget>(2), B<capabilities>(7), "
15171 "B<shm_overview>(7), B<svipc>(7)"
15174 #: build/C/man2/subpage_prot.2:30
15176 msgid "SUBPAGE_PROT"
15177 msgstr "SUBPAGE_PROT"
15179 #. type: Plain text
15180 #: build/C/man2/subpage_prot.2:33
15181 msgid "subpage_prot - define a subpage protection for an address range"
15184 #. type: Plain text
15185 #: build/C/man2/subpage_prot.2:37
15188 #| "B<long subpage_prot(unsigned long >I<addr>B<, unsigned long >I<len>B<,>\n"
15189 #| "B< uint32_t *>I<map>B<);>\n"
15191 "B<int subpage_prot(unsigned long >I<addr>B<, unsigned long >I<len>B<,>\n"
15192 "B< uint32_t *>I<map>B<);>\n"
15194 "B<long subpage_prot(unsigned long >I<addr>B<, unsigned long >I<len>B<,>\n"
15195 "B< uint32_t *>I<map>B<);>\n"
15197 #. type: Plain text
15198 #: build/C/man2/subpage_prot.2:41 build/C/man2/membarrier.2:38
15199 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
15201 "I<注>: このシステムコールには glibc のラッパー関数は存在しない。「注意」の節"
15204 #. type: Plain text
15205 #: build/C/man2/subpage_prot.2:47
15207 "The PowerPC-specific B<subpage_prot>() system call provides the facility to "
15208 "control the access permissions on individual 4\\ kB subpages on systems "
15209 "configured with a page size of 64\\ kB."
15212 #. type: Plain text
15213 #: build/C/man2/subpage_prot.2:54
15215 "The protection map is applied to the memory pages in the region starting at "
15216 "I<addr> and continuing for I<len> bytes. Both of these arguments must be "
15217 "aligned to a 64-kB boundary."
15220 #. type: Plain text
15221 #: build/C/man2/subpage_prot.2:66
15223 "The protection map is specified in the buffer pointed to by I<map>. The map "
15224 "has 2 bits per 4\\ kB subpage; thus each 32-bit word specifies the "
15225 "protections of 16 4\\ kB subpages inside a 64\\ kB page (so, the number of "
15226 "32-bit words pointed to by I<map> should equate to the number of 64-kB pages "
15227 "specified by I<len>). Each 2-bit field in the protection map is either 0 to "
15228 "allow any access, 1 to prevent writes, or 2 or 3 to prevent all accesses."
15231 #. type: Plain text
15232 #: build/C/man2/subpage_prot.2:71
15234 "On success, B<subpage_prot>() returns 0. Otherwise, one of the error codes "
15235 "specified below is returned."
15238 #. type: Plain text
15239 #: build/C/man2/subpage_prot.2:77
15240 msgid "The buffer referred to by I<map> is not accessible."
15243 #. type: Plain text
15244 #: build/C/man2/subpage_prot.2:87
15246 "The I<addr> or I<len> arguments are incorrect. Both of these arguments must "
15247 "be aligned to a multiple of the system page size, and they must not refer to "
15248 "a region outside of the address space of the process or to a region that "
15249 "consists of huge pages."
15252 #. type: Plain text
15253 #: build/C/man2/subpage_prot.2:90 build/C/man2/sync_file_range.2:166
15254 msgid "Out of memory."
15255 msgstr "メモリー不足である。"
15257 #. type: Plain text
15258 #: build/C/man2/subpage_prot.2:96
15260 "This system call is provided on the PowerPC architecture since Linux "
15261 "2.6.25. The system call is provided only if the kernel is configured with "
15262 "B<CONFIG_PPC_64K_PAGES>. No library support is provided."
15265 #. type: Plain text
15266 #: build/C/man2/subpage_prot.2:101 build/C/man2/membarrier.2:328
15268 "Glibc does not provide a wrapper for this system call; call it using "
15272 #. type: Plain text
15273 #: build/C/man2/subpage_prot.2:106
15275 "Normal page protections (at the 64-kB page level) also apply; the subpage "
15276 "protection mechanism is an additional constraint, so putting 0 in a 2-bit "
15277 "field won't allow writes to a page that is otherwise write-protected."
15281 #: build/C/man2/subpage_prot.2:106
15286 #. In the initial implementation, it was the case that:
15287 #. In fact the whole process is switched to use 4 kB hardware pages when the
15288 #. subpage_prot system call is used, but this could be improved in future
15289 #. to switch only the affected segments.
15290 #. But Paul Mackerass says (Oct 2010): I'm pretty sure we now only switch
15291 #. the affected segment, not the whole process.
15292 #. type: Plain text
15293 #: build/C/man2/subpage_prot.2:128
15295 "This system call is provided to assist writing emulators that operate using "
15296 "64-kB pages on PowerPC systems. When emulating systems such as x86, which "
15297 "uses a smaller page size, the emulator can no longer use the memory-"
15298 "management unit (MMU) and normal system calls for controlling page "
15299 "protections. (The emulator could emulate the MMU by checking and possibly "
15300 "remapping the address for each memory access in software, but that is "
15301 "slow.) The idea is that the emulator supplies an array of protection masks "
15302 "to apply to a specified range of virtual addresses. These masks are applied "
15303 "at the level where hardware page-table entries (PTEs) are inserted into the "
15304 "hardware page table based on the Linux PTEs, so the Linux PTEs are not "
15305 "affected. Implicit in this is that the regions of the address space that "
15306 "are protected are switched to use 4-kB hardware pages rather than 64-kB "
15307 "hardware pages (on machines with hardware 64-kB page support)."
15310 #. type: Plain text
15311 #: build/C/man2/subpage_prot.2:131
15312 msgid "B<mprotect>(2), B<syscall>(2)"
15313 msgstr "B<mprotect>(2), B<syscall>(2)"
15315 #. type: Plain text
15316 #: build/C/man2/subpage_prot.2:134
15318 #| msgid "I<Documentation/vm/hugetlbpage.txt> in the Linux kernel source tree"
15320 "I<Documentation/admin-guide/mm/hugetlbpage.rst> in the Linux kernel source "
15322 msgstr "Linux カーネルソースの I<Documentation/vm/hugetlbpage.txt>"
15325 #: build/C/man2/sync_file_range.2:30
15327 msgid "SYNC_FILE_RANGE"
15328 msgstr "SYNC_FILE_RANGE"
15330 #. type: Plain text
15331 #: build/C/man2/sync_file_range.2:33
15332 msgid "sync_file_range - sync a file segment with disk"
15333 msgstr "sync_file_range - ファイルセグメントをディスクと同期する"
15335 #. type: Plain text
15336 #: build/C/man2/sync_file_range.2:37
15339 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
15340 "B<#include E<lt>fcntl.hE<gt>>\n"
15342 "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
15343 "B<#include E<lt>fcntl.hE<gt>>\n"
15345 #. type: Plain text
15346 #: build/C/man2/sync_file_range.2:40
15349 "B<int sync_file_range(int >I<fd>B<, off64_t >I<offset>B<, off64_t >I<nbytes>B<,>\n"
15350 "B< unsigned int >I<flags>B<);>\n"
15352 "B<int sync_file_range(int >I<fd>B<, off64_t >I<offset>B<, off64_t >I<nbytes>B<,>\n"
15353 "B< unsigned int >I<flags>B<);>\n"
15355 #. type: Plain text
15356 #: build/C/man2/sync_file_range.2:47
15358 "B<sync_file_range>() permits fine control when synchronizing the open file "
15359 "referred to by the file descriptor I<fd> with disk."
15361 "B<sync_file_range>() を使うと、ファイルディスクリプター I<fd> で参照される"
15362 "オープンされたファイルのディスクとの同期に関して、 きめ細かな制御が可能とな"
15365 #. type: Plain text
15366 #: build/C/man2/sync_file_range.2:61
15368 "I<offset> is the starting byte of the file range to be synchronized. "
15369 "I<nbytes> specifies the length of the range to be synchronized, in bytes; if "
15370 "I<nbytes> is zero, then all bytes from I<offset> through to the end of file "
15371 "are synchronized. Synchronization is in units of the system page size: "
15372 "I<offset> is rounded down to a page boundary; I<(offset+nbytes-1)> is "
15373 "rounded up to a page boundary."
15375 "I<offset> は、同期を行うファイルの領域の開始バイトである。 I<nbytes> には同期"
15376 "を行う領域の長さをバイト単位で指定する。 I<nbytes> が 0 の場合は、 I<offset> "
15377 "からファイル末尾までの全バイトを同期する。 同期はシステムのページサイズの単位"
15378 "で行われる。 I<offset> はページ境界にあわせて切り下げられ、 I<(offset"
15379 "+nbytes-1)> はページ境界にあわせて切り上げられる。"
15381 #. type: Plain text
15382 #: build/C/man2/sync_file_range.2:65
15383 msgid "The I<flags> bit-mask argument can include any of the following values:"
15384 msgstr "ビットマスク引き数 I<flags> には以下の値を指定することができる:"
15387 #: build/C/man2/sync_file_range.2:65
15389 msgid "B<SYNC_FILE_RANGE_WAIT_BEFORE>"
15390 msgstr "B<SYNC_FILE_RANGE_WAIT_BEFORE>"
15392 #. type: Plain text
15393 #: build/C/man2/sync_file_range.2:70
15395 "Wait upon write-out of all pages in the specified range that have already "
15396 "been submitted to the device driver for write-out before performing any "
15399 "何らかの書き込みを行う前に、指定された領域のページで 書き出しを行うようにデバ"
15400 "イスドライバにすでに要求が発行されている ページの書き出しが全て完了するのを待"
15404 #: build/C/man2/sync_file_range.2:70 build/C/man2/sync_file_range.2:120
15406 msgid "B<SYNC_FILE_RANGE_WRITE>"
15407 msgstr "B<SYNC_FILE_RANGE_WRITE>"
15409 #. type: Plain text
15410 #: build/C/man2/sync_file_range.2:76
15412 "Initiate write-out of all dirty pages in the specified range which are not "
15413 "presently submitted write-out. Note that even this may block if you attempt "
15414 "to write more than request queue size."
15416 "指定された領域のページで、書き出し要求が発行されていない 全ての dirty (キャッ"
15417 "シュだけが変更されている) ページの 書き出しを開始する。 リクエストキューの大"
15418 "きさより多く書き込もうとした場合には、 この処理は停止 (block) する可能性があ"
15422 #: build/C/man2/sync_file_range.2:76
15424 msgid "B<SYNC_FILE_RANGE_WAIT_AFTER>"
15425 msgstr "B<SYNC_FILE_RANGE_WAIT_AFTER>"
15427 #. type: Plain text
15428 #: build/C/man2/sync_file_range.2:80
15430 "Wait upon write-out of all pages in the range after performing any write."
15432 "何らかの書き込み後に、指定された領域の全てのページの 書き出しが行われるのを待"
15435 #. type: Plain text
15436 #: build/C/man2/sync_file_range.2:84
15437 msgid "Specifying I<flags> as 0 is permitted, as a no-op."
15438 msgstr "I<flags> に 0 を指定した場合、何もしないことを表す。"
15441 #: build/C/man2/sync_file_range.2:84
15446 #. type: Plain text
15447 #: build/C/man2/sync_file_range.2:100
15449 "This system call is extremely dangerous and should not be used in portable "
15450 "programs. None of these operations writes out the file's metadata. "
15451 "Therefore, unless the application is strictly performing overwrites of "
15452 "already-instantiated disk blocks, there are no guarantees that the data will "
15453 "be available after a crash. There is no user interface to know if a write "
15454 "is purely an overwrite. On filesystems using copy-on-write semantics (e.g., "
15455 "I<btrfs>) an overwrite of existing allocated blocks is impossible. When "
15456 "writing into preallocated space, many filesystems also require calls into "
15457 "the block allocator, which this system call does not sync out to disk. This "
15458 "system call does not flush disk write caches and thus does not provide any "
15459 "data integrity on systems with volatile disk write caches."
15461 "このシステムコールは非常に危険であり、 移植性が必要なプログラムで使用すべきで"
15462 "はない。 これらの操作ではどれもファイルのメタデータの書き出しを行わない。 し"
15463 "たがって、アプリケーションにより作成済みのディスクブロックの 上書きの実行が確"
15464 "実に行われない限り、クラッシュの後でもデータが 利用できる保証はない。 書き込"
15465 "みが上書きだけであるかを知るためのユーザーインターフェースは存在しない。 "
15466 "(I<btrfs> などの) copy-on-write 動作を使ったファイルシステムでは、 既存の割り"
15467 "当て済みのブロックに対する上書き自体ができない。 前もって割り当てられた領域に"
15468 "書き込みを行う場合、 多くのファイルシステムでは block allocator への書き込み"
15469 "も必要となるが、 このシステムコールは block allocator のディスクへの同期を行"
15470 "わない。 このシステムコールはディスク書き込みキャッシュのフラッシュを 行わな"
15471 "いので、揮発性のディスク書き込みキャッシュを使ったシステムでは このシステム"
15472 "コールではデータの一貫性を確保できないことになる。"
15475 #: build/C/man2/sync_file_range.2:100
15477 msgid "Some details"
15480 #. type: Plain text
15481 #: build/C/man2/sync_file_range.2:108
15483 "B<SYNC_FILE_RANGE_WAIT_BEFORE> and B<SYNC_FILE_RANGE_WAIT_AFTER> will detect "
15484 "any I/O errors or B<ENOSPC> conditions and will return these to the caller."
15486 "B<SYNC_FILE_RANGE_WAIT_BEFORE> と B<SYNC_FILE_RANGE_WAIT_AFTER> は I/O エラー"
15487 "や B<ENOSPC> 状態を検出し、呼び出し元にこれらの情報を返す。"
15489 #. type: Plain text
15490 #: build/C/man2/sync_file_range.2:112
15491 msgid "Useful combinations of the I<flags> bits are:"
15492 msgstr "I<flags> の役に立つビットの組み合わせを以下に示す:"
15495 #: build/C/man2/sync_file_range.2:112
15497 msgid "B<SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE>"
15498 msgstr "B<SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE>"
15500 #. type: Plain text
15501 #: build/C/man2/sync_file_range.2:120
15503 "Ensures that all pages in the specified range which were dirty when "
15504 "B<sync_file_range>() was called are placed under write-out. This is a "
15505 "start-write-for-data-integrity operation."
15507 "指定された範囲内のページで、 B<sync_file_range>() が呼び出された際に dirty "
15508 "であった全てのページが、 確実に書き出し対象となるようにする。 これは、start-"
15509 "write-for-data-integrity 操作 (データ完全性確保のための書き込み開始の操作) で"
15512 #. type: Plain text
15513 #: build/C/man2/sync_file_range.2:127
15515 "Start write-out of all dirty pages in the specified range which are not "
15516 "presently under write-out. This is an asynchronous flush-to-disk "
15517 "operation. This is not suitable for data integrity operations."
15519 "指定された範囲内のページで、現在書き出し中でない全ての dirty ページの 書き出"
15520 "しを開始する。これは非同期のディスクへのフラッシュ (flush-to-disk) 操作であ"
15521 "る。データ完全性確保が必要な操作としては適切ではない。"
15524 #: build/C/man2/sync_file_range.2:127
15526 msgid "B<SYNC_FILE_RANGE_WAIT_BEFORE> (or B<SYNC_FILE_RANGE_WAIT_AFTER>)"
15527 msgstr "B<SYNC_FILE_RANGE_WAIT_BEFORE> (or B<SYNC_FILE_RANGE_WAIT_AFTER>)"
15529 #. type: Plain text
15530 #: build/C/man2/sync_file_range.2:134
15532 "Wait for completion of write-out of all pages in the specified range. This "
15533 "can be used after an earlier B<SYNC_FILE_RANGE_WAIT_BEFORE | "
15534 "SYNC_FILE_RANGE_WRITE> operation to wait for completion of that operation, "
15535 "and obtain its result."
15537 "指定された範囲内の全てのページの書き出しの完了を待つ。 このフラグは、前に行わ"
15538 "れた操作 B<SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE> の後に使用で"
15539 "き、この操作の完了を待ち、結果を取得することができる。"
15542 #: build/C/man2/sync_file_range.2:134
15544 msgid "B<SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER>"
15545 msgstr "B<SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER>"
15547 #. type: Plain text
15548 #: build/C/man2/sync_file_range.2:141
15550 "This is a write-for-data-integrity operation that will ensure that all pages "
15551 "in the specified range which were dirty when B<sync_file_range>() was "
15552 "called are committed to disk."
15554 "これは write-for-data-integrity 操作 (データ完全性確保のための書き込み) であ"
15555 "り、指定された範囲内の、 B<sync_file_range>() が呼ばれた時点で dirty な全て"
15556 "のページが ディスクに格納されることが保証される。"
15558 #. type: Plain text
15559 #: build/C/man2/sync_file_range.2:147
15561 "On success, B<sync_file_range>() returns 0; on failure -1 is returned and "
15562 "I<errno> is set to indicate the error."
15564 "成功の場合、 B<sync_file_range>() は 0 を返す。失敗の場合、-1 を返し、 "
15565 "I<errno> にエラーを示す値を設定する。"
15567 #. type: Plain text
15568 #: build/C/man2/sync_file_range.2:152
15569 msgid "I<fd> is not a valid file descriptor."
15570 msgstr "I<fd> が有効なファイルディスクリプターではない。"
15572 #. type: Plain text
15573 #: build/C/man2/sync_file_range.2:160
15575 "I<flags> specifies an invalid bit; or I<offset> or I<nbytes> is invalid."
15577 "I<flags> に不正なビットが指定されている。または I<offset> か I<nbytes> が不正"
15580 #. type: Plain text
15581 #: build/C/man2/sync_file_range.2:163
15585 #. type: Plain text
15586 #: build/C/man2/sync_file_range.2:169
15587 msgid "Out of disk space."
15588 msgstr "ディスク領域不足である。"
15590 #. type: Plain text
15591 #: build/C/man2/sync_file_range.2:174
15594 #| "I<fd> refers to something other than a regular file, a block device, a "
15595 #| "directory, or a symbolic link."
15597 "I<fd> refers to something other than a regular file, a block device, or a "
15600 "I<fd> が、通常のファイル、ブロックデバイス、ディレクトリ、シンボリックリンク "
15603 #. type: Plain text
15604 #: build/C/man2/sync_file_range.2:177
15605 msgid "B<sync_file_range>() appeared on Linux in kernel 2.6.17."
15606 msgstr "B<sync_file_range>() はカーネル 2.6.17 で Linux に登場した。"
15608 #. type: Plain text
15609 #: build/C/man2/sync_file_range.2:180
15611 "This system call is Linux-specific, and should be avoided in portable "
15614 "このシステムコールは Linux 独自であり、 移植性が必要なプログラムでは使用を避"
15618 #: build/C/man2/sync_file_range.2:181
15620 msgid "sync_file_range2()"
15621 msgstr "sync_file_range2()"
15623 #. See kernel commit edd5cd4a9424f22b0fa08bef5e299d41befd5622
15624 #. type: Plain text
15625 #: build/C/man2/sync_file_range.2:198
15627 "Some architectures (e.g., PowerPC, ARM) need 64-bit arguments to be aligned "
15628 "in a suitable pair of registers. On such architectures, the call signature "
15629 "of B<sync_file_range>() shown in the SYNOPSIS would force a register to be "
15630 "wasted as padding between the I<fd> and I<offset> arguments. (See "
15631 "B<syscall>(2) for details.) Therefore, these architectures define a "
15632 "different system call that orders the arguments suitably:"
15634 "いくつかのアーキテクチャー (例えば、 PowerPC や ARM) では、 64 ビットの引き数"
15635 "は適切なレジスターの組に割り当てる必要がある。 このようなアーキテクチャーで"
15636 "は、 「書式」に書かれている B<sync_file_range>() の呼び出しシグネチャーで、 "
15637 "引き数 I<fd> と I<offset> の間のパディング (詰めもの) でレジスターが一つ消費"
15638 "されてしまう (詳細は B<syscall>(2) 参照)。 そのため、 これらのアーキテク"
15639 "チャーでは引き数が適切な順序になった別のシステムコールが定義されている。"
15641 #. type: Plain text
15642 #: build/C/man2/sync_file_range.2:203
15645 "B<int sync_file_range2(int >I<fd>B<, unsigned int >I<flags>B<,>\n"
15646 "B< off64_t >I<offset>B<, off64_t >I<nbytes>B<);>\n"
15648 "B<int sync_file_range2(int >I<fd>B<, unsigned int >I<flags>B<,>\n"
15649 "B< off64_t >I<offset>B<, off64_t >I<nbytes>B<);>\n"
15651 #. type: Plain text
15652 #: build/C/man2/sync_file_range.2:208
15654 "The behavior of this system call is otherwise exactly the same as "
15655 "B<sync_file_range>()."
15657 "上記の点以外は、このシステムコールの動作は B<sync_file_range>() と\n"
15658 "全く同じである。このシステムコールに対するライブラリによるサポートは\n"
15659 "glibc では提供されていない。"
15661 #. type: Plain text
15662 #: build/C/man2/sync_file_range.2:219
15664 "A system call with this signature first appeared on the ARM architecture in "
15665 "Linux 2.6.20, with the name B<arm_sync_file_range>(). It was renamed in "
15666 "Linux 2.6.22, when the analogous system call was added for PowerPC. On "
15667 "architectures where glibc support is provided, glibc transparently wraps "
15668 "B<sync_file_range2>() under the name B<sync_file_range>()."
15670 "このバージョンのシステムコールは、Linux 2.6.20 で ARM アーキテクチャーで\n"
15671 "初めて登場し、 B<arm_sync_file_range>() という名前であった。\n"
15672 "Linux 2.6.22 で、同様のシステムコールが PowerPC 用に追加された際に、\n"
15673 "システムコールの名前が変更された。\n"
15674 "glibc によるサポートが提供されているアーキテクチャーでは、\n"
15675 "glibc のラッパー関数は B<sync_file_range>() という名前で\n"
15676 "B<sync_file_range2>() を適切に使用するようになっている。"
15678 #. type: Plain text
15679 #: build/C/man2/sync_file_range.2:224
15680 msgid "B<fdatasync>(2), B<fsync>(2), B<msync>(2), B<sync>(2)"
15681 msgstr "B<fdatasync>(2), B<fsync>(2), B<msync>(2), B<sync>(2)"
15684 #: build/C/man2/memfd_create.2:21
15686 msgid "MEMFD_CREATE"
15687 msgstr "MEMFD_CREATE"
15689 #. type: Plain text
15690 #: build/C/man2/memfd_create.2:24
15691 msgid "memfd_create - create an anonymous file"
15692 msgstr "memfd_create - 無名ファイル (anonymous file) を作成する"
15694 #. type: Plain text
15695 #: build/C/man2/memfd_create.2:30
15697 #| msgid "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>"
15698 msgid "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>\n"
15699 msgstr "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>"
15702 #. memfd uses VM_NORESERVE so each page is accounted on first access.
15703 #. This means, the overcommit-limits (see __vm_enough_memory()) and the
15704 #. memory-cgroup limits (mem_cgroup_try_charge()) are applied. Note that
15705 #. those are accounted on "current" and "current->mm", that is, the
15706 #. process doing the first page access.
15707 #. type: Plain text
15708 #: build/C/man2/memfd_create.2:54
15710 "B<memfd_create>() creates an anonymous file and returns a file descriptor "
15711 "that refers to it. The file behaves like a regular file, and so can be "
15712 "modified, truncated, memory-mapped, and so on. However, unlike a regular "
15713 "file, it lives in RAM and has a volatile backing storage. Once all "
15714 "references to the file are dropped, it is automatically released. Anonymous "
15715 "memory is used for all backing pages of the file. Therefore, files created "
15716 "by B<memfd_create>() have the same semantics as other anonymous memory "
15717 "allocations such as those allocated using B<mmap>(2) with the "
15718 "B<MAP_ANONYMOUS> flag."
15720 "B<memfd_create>() は、 無名ファイル (anonymous file) を作成し、 そのファイル"
15721 "を参照するファイルディスクリプターを返す。 このファイルは通常のファイルと同様"
15722 "に振る舞い、 変更、切り詰め (truncate)、 メモリーマップなどを行うことができ"
15723 "る。 しかし、 通常のファイルとは違い、 このファイルは RAM 上に置かれ、 格納さ"
15724 "れるストレージは揮発性である。 このファイルへの参照がすべてなくなると、 ファ"
15725 "イルは自動的に解放される。 このファイルが置かれるページには無名メモリー "
15726 "(anonymous memory) が使用される。 したがって、 B<memfd_create>() で作成された"
15727 "フィアルは、 他の無名メモリーの割り当て (B<MAP_ANONYMOUS> フラグ付きの "
15728 "B<mmap>(2) を使って割り当てられた無名メモリーなど) と同じ動作をする。"
15730 #. type: Plain text
15731 #: build/C/man2/memfd_create.2:61
15733 "The initial size of the file is set to 0. Following the call, the file size "
15734 "should be set using B<ftruncate>(2). (Alternatively, the file may be "
15735 "populated by calls to B<write>(2) or similar.)"
15737 "ファイルの初期サイズは 0 に設定される。 呼び出しの後に、 B<ftruncate>(2) を"
15738 "使ってファイルサイズを設定すべきである (代わりに、 B<write>(2) や同様の関数を"
15739 "呼び出してファイルにデータを書き込むこともできる)。"
15741 #. type: Plain text
15742 #: build/C/man2/memfd_create.2:72
15744 "The name supplied in I<name> is used as a filename and will be displayed as "
15745 "the target of the corresponding symbolic link in the directory I</proc/self/"
15746 "fd/>. The displayed name is always prefixed with I<memfd:> and serves only "
15747 "for debugging purposes. Names do not affect the behavior of the file "
15748 "descriptor, and as such multiple files can have the same name without any "
15751 "I<name> に指定された名前はファイル名として使用され、 ディレクトリ I</proc/"
15752 "self/fd/> で対応するシンボリックリンクのリンク先として表示される。 表示される"
15753 "名前の前には常に I<memfd:> が付き、 この名前はデバッグ用途としてのみ機能す"
15754 "る。 名前はファイルディスクリプターの動作には影響せず、 複数のファイルが同じ"
15757 #. type: Plain text
15758 #: build/C/man2/memfd_create.2:77
15761 #| "The following values may be bitwise ORed in I<flags> to change the "
15762 #| "behaviour of B<memfd_create>():"
15764 "The following values may be bitwise ORed in I<flags> to change the behavior "
15765 "of B<memfd_create>():"
15767 "以下の値をビット論理和で I<flags> に指定して、 B<memfd_create>() の動作を変更"
15771 #: build/C/man2/memfd_create.2:77
15773 msgid "B<MFD_CLOEXEC>"
15774 msgstr "B<MFD_CLOEXEC>"
15776 #. type: Plain text
15777 #: build/C/man2/memfd_create.2:87
15779 "Set the close-on-exec (B<FD_CLOEXEC>) flag on the new file descriptor. See "
15780 "the description of the B<O_CLOEXEC> flag in B<open>(2) for reasons why this "
15783 "新しいファイルディスクリプターに close-on-exec (B<FD_CLOEXEC>) フラグをセット"
15784 "する。 これが有用な理由については B<open>(2) の B<O_CLOEXEC> フラグの説明を参"
15788 #: build/C/man2/memfd_create.2:87
15790 msgid "B<MFD_ALLOW_SEALING>"
15791 msgstr "B<MFD_ALLOW_SEALING>"
15793 #. FIXME Why is the MFD_ALLOW_SEALING behavior not simply the default?
15794 #. Is it worth adding some text explaining this?
15795 #. type: Plain text
15796 #: build/C/man2/memfd_create.2:103
15798 "Allow sealing operations on this file. See the discussion of the "
15799 "B<F_ADD_SEALS> and B<F_GET_SEALS> operations in B<fcntl>(2), and also NOTES, "
15800 "below. The initial set of seals is empty. If this flag is not set, the "
15801 "initial set of seals will be B<F_SEAL_SEAL>, meaning that no other seals can "
15802 "be set on the file."
15804 "このファイルに対して sealing 操作を許可する。 B<fcntl>(2) の B<F_ADD_SEALS> "
15805 "と B<F_GET_SEALS> 操作の議論を参照。 下記の「注意」も参照。 初期の seal 集合"
15806 "は空となる。 このフラグを指定しなかった場合、 初期の seal 集合は "
15807 "B<F_SEAL_SEAL> となり、 これはこのファイルには他の seal をセットできないこと"
15811 #: build/C/man2/memfd_create.2:103
15813 #| msgid "B<SHM_HUGETLB> (since Linux 2.6)"
15814 msgid "B<MFD_HUGETLB> (since Linux 4.14)"
15815 msgstr "B<SHM_HUGETLB> (Linux 2.6 以降)"
15817 #. commit 749df87bd7bee5a79cef073f5d032ddb2b211de8
15818 #. commit 47b9012ecdc747f6936395265e677d41e11a31ff
15819 #. type: Plain text
15820 #: build/C/man2/memfd_create.2:119
15822 "The anonymous file will be created in the hugetlbfs filesystem using huge "
15823 "pages. See the Linux kernel source file I<Documentation/admin-guide/mm/"
15824 "hugetlbpage.rst> for more information about hugetlbfs. Specifying both "
15825 "B<MFD_HUGETLB> and B<MFD_ALLOW_SEALING> in I<flags> is supported since Linux "
15830 #: build/C/man2/memfd_create.2:119
15832 msgid "B<MFD_HUGE_2MB>, B<MFD_HUGE_1GB>, B<...>"
15835 #. type: Plain text
15836 #: build/C/man2/memfd_create.2:128
15838 "Used in conjunction with B<MFD_HUGETLB> to select alternative hugetlb page "
15839 "sizes (respectively, 2\\ MB, 1\\ GB, ...) on systems that support multiple "
15840 "hugetlb page sizes. Definitions for known huge page sizes are included in "
15841 "the header file I<E<lt>linux/memfd.hE<gt>.>"
15844 #. type: Plain text
15845 #: build/C/man2/memfd_create.2:132
15847 "For details on encoding huge page sizes not included in the header file, see "
15848 "the discussion of the similarly named constants in B<mmap>(2)."
15851 #. type: Plain text
15852 #: build/C/man2/memfd_create.2:136
15853 msgid "Unused bits in I<flags> must be 0."
15854 msgstr "I<flags> の未使用のビットは 0 でなければならない。"
15856 #. type: Plain text
15857 #: build/C/man2/memfd_create.2:145
15860 #| "As its return value, B<memfd_create>() returns a new file descriptor "
15861 #| "that can be used to refer to the file. This file descriptor is opened "
15862 #| "for both reading and writing (B<O_RDWR>) and B<O_LARGEFILE> is set for "
15863 #| "the descriptor."
15865 "As its return value, B<memfd_create>() returns a new file descriptor that "
15866 "can be used to refer to the file. This file descriptor is opened for both "
15867 "reading and writing (B<O_RDWR>) and B<O_LARGEFILE> is set for the file "
15870 "返り値として B<memfd_create>() は、 作成したファイルを参照するのに使用できる"
15871 "新しいファイルディスクリプターを返す。 このファイルディスクリプターは読み書き"
15872 "両用 (B<O_RDWR>) でオープンされ、 B<O_LARGEFILE> がこのファイルディスクリプ"
15875 #. type: Plain text
15876 #: build/C/man2/memfd_create.2:158
15878 "With respect to B<fork>(2) and B<execve>(2), the usual semantics apply for "
15879 "the file descriptor created by B<memfd_create>(). A copy of the file "
15880 "descriptor is inherited by the child produced by B<fork>(2) and refers to "
15881 "the same file. The file descriptor is preserved across B<execve>(2), unless "
15882 "the close-on-exec flag has been set."
15884 "B<fork>(2) と B<execve>(2) に関しては、 B<memfd_create>() で作成したファイル"
15885 "ディスクリプターについても通常の動作が適用される。 ファイルディスクリプターの"
15886 "コピーは B<fork>(2) で生成される子プロセスに継承され、 同じファイルを参照す"
15887 "る。 close-on-exec フラグがセットされていない限り、 B<execve>(2) の前後でファ"
15888 "イルディスクリプターは保持される。"
15890 #. type: Plain text
15891 #: build/C/man2/memfd_create.2:165
15893 "On success, B<memfd_create>() returns a new file descriptor. On error, -1 "
15894 "is returned and I<errno> is set to indicate the error."
15896 "成功の場合、 B<memfd_create>() は新しいファイルディスクリプターを返す。 エ"
15897 "ラーの場合、-1 を返し、 I<errno> にエラーを示す値を設定する。"
15899 #. type: Plain text
15900 #: build/C/man2/memfd_create.2:171
15901 msgid "The address in I<name> points to invalid memory."
15902 msgstr "I<name> のアドレスが無効なメモリーを指している。"
15904 #. type: Plain text
15905 #: build/C/man2/memfd_create.2:175
15906 msgid "I<flags> included unknown bits."
15909 #. NAME_MAX - strlen("memfd:")
15910 #. type: Plain text
15911 #: build/C/man2/memfd_create.2:182
15913 "I<name> was too long. (The limit is 249 bytes, excluding the terminating "
15917 #. type: Plain text
15918 #: build/C/man2/memfd_create.2:190
15920 "Both B<MFD_HUGETLB> and B<MFD_ALLOW_SEALING> were specified in I<flags>."
15923 #. type: Plain text
15924 #: build/C/man2/memfd_create.2:199
15925 msgid "There was insufficient memory to create a new anonymous file."
15926 msgstr "新しい無名ファイルを作成するのに十分なメモリーがなかった。"
15928 #. type: Plain text
15929 #: build/C/man2/memfd_create.2:204
15932 #| "The B<remap_file_pages>() system call appeared in Linux 2.5.46; glibc "
15933 #| "support was added in version 2.3.3."
15935 "The B<memfd_create>() system call first appeared in Linux 3.17; glibc "
15936 "support was added in version 2.27."
15938 "B<remap_file_pages>() システムコールは Linux 2.5.46 で登場した。 glibc での"
15939 "サポートは glibc バージョン 2.3.3 で追加された。"
15941 #. type: Plain text
15942 #: build/C/man2/memfd_create.2:208
15943 msgid "The B<memfd_create>() system call is Linux-specific."
15944 msgstr "B<memfd_create>() システムコールは Linux 固有である。"
15946 #. See also http://lwn.net/Articles/593918/
15947 #. and http://lwn.net/Articles/594919/ and http://lwn.net/Articles/591108/
15948 #. type: Plain text
15949 #: build/C/man2/memfd_create.2:221
15952 #| "The B<memfd_create>() system call provides a simple alternative to "
15953 #| "manually mounting a I<tmpfs> filesystem and creating and opening a file "
15954 #| "in that filesystem. The primary purpose of B<memfd_create>() is to "
15955 #| "create files and associated file descriptors that are used with the file-"
15956 #| "sealing APIs provided by B<fcntl>(2)."
15958 "The B<memfd_create>() system call provides a simple alternative to manually "
15959 "mounting a B<tmpfs>(5) filesystem and creating and opening a file in that "
15960 "filesystem. The primary purpose of B<memfd_create>() is to create files "
15961 "and associated file descriptors that are used with the file-sealing APIs "
15962 "provided by B<fcntl>(2)."
15964 "B<memfd_create>() システムコールは、 手動で I<tmpfs> ファイルシステムをマウン"
15965 "トして、 そのファイルシステムにファイルをオープンするという操作の、 簡単な代"
15966 "替手段を提供している。 B<memfd_create>() の主な目的は、 B<fcntl>(2) が提供す"
15967 "る file-sealing API で使用できる、 ファイルとそれに関連付けられるファイルディ"
15968 "スクリプターを作成することである。"
15970 #. type: Plain text
15971 #: build/C/man2/memfd_create.2:235
15973 "The B<memfd_create>() system call also has uses without file sealing (which "
15974 "is why file-sealing is disabled, unless explicitly requested with the "
15975 "B<MFD_ALLOW_SEALING> flag). In particular, it can be used as an alternative "
15976 "to creating files in I<tmp> or as an alternative to using the B<open>(2) "
15977 "B<O_TMPFILE> in cases where there is no intention to actually link the "
15978 "resulting file into the filesystem."
15980 "B<memfd_create>() システムコールは、 file sealing なしでも用途がある (これが"
15981 "明示的に B<MFD_ALLOW_SEALING> フラグが要求されない限り、 file-sealing が無効"
15982 "になる理由である)。 特に、 ファイルシステムに実際にファイルを残す意図がない場"
15983 "合、 I<tmp> にファイルを作成したり B<open>(2) B<O_TMPFILE> を使ったりする際の"
15987 #: build/C/man2/memfd_create.2:235
15989 msgid "File sealing"
15990 msgstr "file sealing"
15992 #. type: Plain text
15993 #: build/C/man2/memfd_create.2:253
15995 "In the absence of file sealing, processes that communicate via shared memory "
15996 "must either trust each other, or take measures to deal with the possibility "
15997 "that an untrusted peer may manipulate the shared memory region in "
15998 "problematic ways. For example, an untrusted peer might modify the contents "
15999 "of the shared memory at any time, or shrink the shared memory region. The "
16000 "former possibility leaves the local process vulnerable to time-of-check-to-"
16001 "time-of-use race conditions (typically dealt with by copying data from the "
16002 "shared memory region before checking and using it). The latter possibility "
16003 "leaves the local process vulnerable to B<SIGBUS> signals when an attempt is "
16004 "made to access a now-nonexistent location in the shared memory region. "
16005 "(Dealing with this possibility necessitates the use of a handler for the "
16006 "B<SIGBUS> signal.)"
16008 "file sealing がない場合、 共有メモリー経由で通信するプロセスは、 互いに信頼す"
16009 "るか、 信頼していない相手が共有メモリー領域を問題がある方法で操作する可能性に"
16010 "対処するための対策を講じなければならない。\n"
16011 "例えば、 信頼していない相手は、 いつでも共有メモリーの内容を変更したり、 共有"
16012 "メモリー領域を縮小したりする可能性がある。 前者の場合は、 ローカルプロセスで"
16013 "は、 データの確認時点と使用時点の競合条件の問題が起こり得る (通常はこの問題へ"
16014 "の対処は共有メモリー領域からデータをこぴーしてからデータを確認、使用すること"
16015 "である)。 後者の場合は、 ローカルプロセスでは、 共有メモリー領域の存在しなく"
16016 "なった場所にアクセスしようとした際にシグナル B<SIGBUS> が発生する可能性があ"
16017 "る (この可能性に対処するにはシグナル B<SIGBUS> に対してハンドラーを使用する必"
16020 #. type: Plain text
16021 #: build/C/man2/memfd_create.2:259
16023 "Dealing with untrusted peers imposes extra complexity on code that employs "
16024 "shared memory. Memory sealing enables that extra complexity to be "
16025 "eliminated, by allowing a process to operate secure in the knowledge that "
16026 "its peer can't modify the shared memory in an undesired fashion."
16028 "信頼していない相手への対処により、 共有メモリーを利用するコードに余計な複雑性"
16029 "が増すことになる。 メモリー sealing により余計な複雑性をなくすことができる。 "
16030 "相手が望まない方法で共有メモリーを変更できないことを知っていることで、 プロセ"
16033 #. type: Plain text
16034 #: build/C/man2/memfd_create.2:261
16035 msgid "An example of the usage of the sealing mechanism is as follows:"
16036 msgstr "sealing 機構の使い方の例は以下のとおりである。"
16038 #. type: Plain text
16039 #: build/C/man2/memfd_create.2:267
16042 #| "The first process creates a I<tmpfs> file using B<memfd_create>(). The "
16043 #| "call yields a file descriptor used in subsequent steps."
16045 "The first process creates a B<tmpfs>(5) file using B<memfd_create>(). The "
16046 "call yields a file descriptor used in subsequent steps."
16048 "最初のプロセスは B<memfd_create>() を使って I<tmpfs> ファイルを作成する。 "
16049 "B<memfd_create>() はこれ以降のステップで使用するファイルディスクリプターを返"
16052 #. type: Plain text
16053 #: build/C/man2/memfd_create.2:274
16055 "The first process sizes the file created in the previous step using "
16056 "B<ftruncate>(2), maps it using B<mmap>(2), and populates the shared memory "
16057 "with the desired data."
16059 "最初のプロセスは B<ftruncate>(2) を使って直前のステップで作成したファイルのサ"
16060 "イズを変更し、 B<mmap>(2) を使ってそのファイルをマッピングし、 共有メモリーに"
16064 #: build/C/man2/memfd_create.2:274
16069 #. type: Plain text
16070 #: build/C/man2/memfd_create.2:293
16073 #| "The first process uses the B<fcntl>(2) B<F_ADD_SEALS> operation to place "
16074 #| "one or more seals on the file, in order to restrict further modifications "
16075 #| "on the file. (If placing the seal B<F_SEAL_WRITE>, then it will be "
16076 #| "necessary to first unmap the shared writable mapping created in the "
16077 #| "previous step.)"
16079 "The first process uses the B<fcntl>(2) B<F_ADD_SEALS> operation to place "
16080 "one or more seals on the file, in order to restrict further modifications on "
16081 "the file. (If placing the seal B<F_SEAL_WRITE>, then it will be necessary "
16082 "to first unmap the shared writable mapping created in the previous step. "
16083 "Otherwise, behavior similar to B<F_SEAL_WRITE> can be achieved by using "
16084 "B<F_SEAL_FUTURE_WRITE>, which will prevent future writes via B<mmap>(2) and "
16085 "B<write>(2) from succeeding while keeping existing shared writable "
16088 "最初のプロセスは、 このファイルに対する今後の変更を制限するために、 "
16089 "B<fcntl>(2) の B<F_ADD_SEALS> 操作を使って、 そのファイルに seal をいくつか設"
16090 "定する。 (seal B<F_SEAL_WRITE> を設定する場合、 直前のステップで作成した書き"
16091 "込み可能な共有マッピングをまずアンマップする必要が出てくる。)"
16094 #: build/C/man2/memfd_create.2:293
16099 #. type: Plain text
16100 #: build/C/man2/memfd_create.2:298
16103 #| "A second process obtains a file descriptor for the I<tmpfs> file and maps "
16104 #| "it. Among the possible ways in which this could happen are the following:"
16106 "A second process obtains a file descriptor for the B<tmpfs>(5) file and "
16107 "maps it. Among the possible ways in which this could happen are the "
16110 "二つ目のプロセスは I<tmpfs> ファイルのファイルディスクリプターを入手し、 その"
16111 "ファイルをマップする。 以下に示す方法を使用することができる。"
16113 #. type: Plain text
16114 #: build/C/man2/memfd_create.2:309
16116 "The process that called B<memfd_create>() could transfer the resulting file "
16117 "descriptor to the second process via a UNIX domain socket (see B<unix>(7) "
16118 "and B<cmsg>(3)). The second process then maps the file using B<mmap>(2)."
16120 "B<memfd_create>() を呼び出したプロセスは、 得られたファイルディスクリプターを"
16121 "二つ目のプロセスに UNIX ドメインソケット経由で渡すことができる (B<unix>(7) "
16122 "と B<cmsg>(3) を参照)。 それから、二つ目のプロセスは B<mmap>(2) を使ってファ"
16125 #. type: Plain text
16126 #: build/C/man2/memfd_create.2:317
16128 "The second process is created via B<fork>(2) and thus automatically "
16129 "inherits the file descriptor and mapping. (Note that in this case and the "
16130 "next, there is a natural trust relationship between the two processes, since "
16131 "they are running under the same user ID. Therefore, file sealing would not "
16132 "normally be necessary.)"
16134 "二つ目のプロセスを B<fork>(2) を使って作成する。 そうすると、 自動的にファイ"
16135 "ルディスクリプターとマッピングが継承される。 (この方法と次の方法では、 二つの"
16136 "プロセス間で自然な信頼関係が存在することになる。 なぜなら、 二つのプロセスは"
16137 "同じユーザー ID。 の元で実行されているからである。 したがって、 file sealing "
16140 #. type: Plain text
16141 #: build/C/man2/memfd_create.2:331
16144 #| "The second process opens the file I</proc/E<lt>pdE<gt>/fd/E<lt>fdE<gt>>, "
16145 #| "where I<E<lt>pidE<gt>> is the PID of the first process (the one that "
16146 #| "called B<memfd_create>()), and I<E<lt>fdE<gt>> is the number of the file "
16147 #| "descriptor returned by the call to B<memfd_create>() in that process. "
16148 #| "The second process then maps the file using B<mmap>(2)."
16150 "The second process opens the file I</proc/E<lt>pidE<gt>/fd/E<lt>fdE<gt>>, "
16151 "where I<E<lt>pidE<gt>> is the PID of the first process (the one that called "
16152 "B<memfd_create>()), and I<E<lt>fdE<gt>> is the number of the file descriptor "
16153 "returned by the call to B<memfd_create>() in that process. The second "
16154 "process then maps the file using B<mmap>(2)."
16156 "二つ目のプロセスは I</proc/E<lt>pdE<gt>/fd/E<lt>fdE<gt>> をオープンする。 "
16157 "I<E<lt>pidE<gt>> は最初のプロセス (B<memfd_create>() を呼び出したプロセス) "
16158 "の PID で、 I<E<lt>fdE<gt>> は最初のプロセスでの B<memfd_create>() の呼び出し"
16159 "で返されたファイルディスクリプター番号である。 それからこのファイルを "
16160 "B<mmap>(2) を使ってマッピングする。"
16163 #: build/C/man2/memfd_create.2:332
16168 #. type: Plain text
16169 #: build/C/man2/memfd_create.2:344
16171 "The second process uses the B<fcntl>(2) B<F_GET_SEALS> operation to "
16172 "retrieve the bit mask of seals that has been applied to the file. This bit "
16173 "mask can be inspected in order to determine what kinds of restrictions have "
16174 "been placed on file modifications. If desired, the second process can apply "
16175 "further seals to impose additional restrictions (so long as the "
16176 "B<F_SEAL_SEAL> seal has not yet been applied)."
16178 "二つ目のプロセスは B<fcntl>(2) の B<F_GET_SEALS> 操作を使って、 そのファイル"
16179 "に適用されている seal のビットマスクを取得する。 このビットマスクを調べて、 "
16180 "ファイルの変更に関してどのような制限が適用されているかを知ることができる。 "
16181 "(B<F_SEAL_SEAL> seal がそれまでに適用されていない限りは) 必要であれば、 二つ"
16182 "目のプロセスはさらに seal を設定して追加の制限をかけることができる。"
16184 #. type: Plain text
16185 #: build/C/man2/memfd_create.2:348
16187 "Below are shown two example programs that demonstrate the use of "
16188 "B<memfd_create>() and the file sealing API."
16190 "以下では B<memfd_create>() と file sealing API の使用例を示すサンプルプログラ"
16193 #. type: Plain text
16194 #: build/C/man2/memfd_create.2:363
16197 #| "The first program, I<t_memfd_create.c>, creates a I<tmpfs> file using "
16198 #| "B<memfd_create>(), sets a size for the file, maps it into memory, and "
16199 #| "optionally places some seals on the file. The program accepts up to "
16200 #| "three command-line arguments, of which the first two are required. The "
16201 #| "first argument is the name to associate with the file, the second "
16202 #| "argument is the size to be set for the file, and the optional third is a "
16203 #| "string of characters that specify seals to be set on file."
16205 "The first program, I<t_memfd_create.c>, creates a B<tmpfs>(5) file using "
16206 "B<memfd_create>(), sets a size for the file, maps it into memory, and "
16207 "optionally places some seals on the file. The program accepts up to three "
16208 "command-line arguments, of which the first two are required. The first "
16209 "argument is the name to associate with the file, the second argument is the "
16210 "size to be set for the file, and the optional third argument is a string of "
16211 "characters that specify seals to be set on file."
16213 "最初のプログラム I<t_memfd_create.c> は、 B<memfd_create>() を使って "
16214 "I<tmpfs> ファイルを作成し、 そのファイルのサイズを設定し、 メモリーにマッピン"
16215 "グし、 要求された場合にはそのファイルに seal を設定する。 このプログラムは最"
16216 "大で 3 つのコマンドライン引き数を取り、 最初の 2 つは必須である。 最初の引き"
16217 "数はファイルに関連付けられる名前で、 2 番目の引き数はファイルに設定されるサイ"
16218 "ズである。 省略可能な 3 番目の引き数は、 このファイルに設定する seal を指定す"
16221 #. type: Plain text
16222 #: build/C/man2/memfd_create.2:369
16224 "The second program, I<t_get_seals.c>, can be used to open an existing file "
16225 "that was created via B<memfd_create>() and inspect the set of seals that "
16226 "have been applied to that file."
16228 "2 つめのプログラム I<t_get_seals.c> を使うと、 B<memfd_create>() を使って作成"
16229 "された既存のファイルをオープンし、 そのファイルに適用されている seal の集合を"
16232 #. type: Plain text
16233 #: build/C/man2/memfd_create.2:374
16236 #| "The following shell session demonstrates the use of these programs. "
16237 #| "First we create a I<tmpfs> file and set some seals on it:"
16239 "The following shell session demonstrates the use of these programs. First "
16240 "we create a B<tmpfs>(5) file and set some seals on it:"
16242 "以下のシェルのセッションはこれらのプログラムの使用例を示したものである。 ま"
16243 "ず I<tmpfs> ファイルを作成し、そのファイルに seal をいくつか設定している。"
16245 #. type: Plain text
16246 #: build/C/man2/memfd_create.2:380
16249 "$ B<./t_memfd_create my_memfd_file 4096 sw &>\n"
16251 "PID: 11775; fd: 3; /proc/11775/fd/3\n"
16253 "$ B<./t_memfd_create my_memfd_file 4096 sw &>\n"
16255 "PID: 11775; fd: 3; /proc/11775/fd/3\n"
16257 #. type: Plain text
16258 #: build/C/man2/memfd_create.2:398
16261 #| "At this point, the I<t_memfd_create> program continues to run in the "
16262 #| "background. From another program, we can obtain a file descriptor for "
16263 #| "the file created by B<memfd_create>() by opening the I</proc/PID/fd> "
16264 #| "file that corresponds to the descriptor opened by B<memfd_create>(). "
16265 #| "Using that pathname, we inspect the content of the I</proc/PID/fd> "
16266 #| "symbolic link, and use our I<t_get_seals> program to view the seals that "
16267 #| "have been placed on the file:"
16269 "At this point, the I<t_memfd_create> program continues to run in the "
16270 "background. From another program, we can obtain a file descriptor for the "
16271 "file created by B<memfd_create>() by opening the I</proc/[pid]/fd> file "
16272 "that corresponds to the file descriptor opened by B<memfd_create>(). Using "
16273 "that pathname, we inspect the content of the I</proc/[pid]/fd> symbolic "
16274 "link, and use our I<t_get_seals> program to view the seals that have been "
16275 "placed on the file:"
16277 "この時点では、 I<t_memfd_create> プログラムはバックグラウンドで動作し続け"
16278 "る。 もう一つのプログラムから、 B<memfd_create>() がオープンしたディスクリプ"
16279 "ターに対応する I</proc/PID/fd> ファイルをオープンすることで、 "
16280 "B<memfd_create>() で作成されたファイルのファイルディスクリプターを取得でき"
16282 "そのパス名を使って、 I</proc/PID/fd> シンボリックリンクの内容を調査し、 "
16283 "I<t_get_seals> プログラムを使ってそのファイルに設定されている seal を見ること"
16286 #. type: Plain text
16287 #: build/C/man2/memfd_create.2:405
16290 "$ B<readlink /proc/11775/fd/3>\n"
16291 "/memfd:my_memfd_file (deleted)\n"
16292 "$ B<./t_get_seals /proc/11775/fd/3>\n"
16293 "Existing seals: WRITE SHRINK\n"
16295 "$ B<readlink /proc/11775/fd/3>\n"
16296 "/memfd:my_memfd_file (deleted)\n"
16297 "$ B<./t_get_seals /proc/11775/fd/3>\n"
16298 "Existing seals: WRITE SHRINK\n"
16301 #: build/C/man2/memfd_create.2:407
16303 msgid "Program source: t_memfd_create.c"
16304 msgstr "プログラムのソース: t_memfd_create.c"
16306 #. type: Plain text
16307 #: build/C/man2/memfd_create.2:418
16310 #| "#include E<lt>sys/memfd.hE<gt>\n"
16311 #| "#include E<lt>fcntl.hE<gt>\n"
16312 #| "#include E<lt>stdlib.hE<gt>\n"
16313 #| "#include E<lt>unistd.hE<gt>\n"
16314 #| "#include E<lt>string.hE<gt>\n"
16315 #| "#include E<lt>stdio.hE<gt>\n"
16317 "#define _GNU_SOURCE\n"
16318 "#include E<lt>stdint.hE<gt>\n"
16319 "#include E<lt>sys/mman.hE<gt>\n"
16320 "#include E<lt>fcntl.hE<gt>\n"
16321 "#include E<lt>stdlib.hE<gt>\n"
16322 "#include E<lt>unistd.hE<gt>\n"
16323 "#include E<lt>string.hE<gt>\n"
16324 "#include E<lt>stdio.hE<gt>\n"
16326 "#include E<lt>sys/memfd.hE<gt>\n"
16327 "#include E<lt>fcntl.hE<gt>\n"
16328 "#include E<lt>stdlib.hE<gt>\n"
16329 "#include E<lt>unistd.hE<gt>\n"
16330 "#include E<lt>string.hE<gt>\n"
16331 "#include E<lt>stdio.hE<gt>\n"
16333 #. type: Plain text
16334 #: build/C/man2/memfd_create.2:430
16338 "main(int argc, char *argv[])\n"
16341 " unsigned int seals;\n"
16343 " char *name, *seals_arg;\n"
16347 "main(int argc, char *argv[])\n"
16350 " unsigned int seals;\n"
16352 " char *name, *seals_arg;\n"
16355 #. type: Plain text
16356 #: build/C/man2/memfd_create.2:442
16359 #| " if (argc E<lt> 3) {\n"
16360 #| " fprintf(stderr, \"%s name size [seals]\\en\", argv[0]);\n"
16361 #| " fprintf(stderr, \"\\et\\(aqseals\\(aq can contain any of the \"\n"
16362 #| " \"following characters:\\en\");\n"
16363 #| " fprintf(stderr, \"\\et\\etg - F_SEAL_GROW\\en\");\n"
16364 #| " fprintf(stderr, \"\\et\\ets - F_SEAL_SHRINK\\en\");\n"
16365 #| " fprintf(stderr, \"\\et\\etw - F_SEAL_WRITE\\en\");\n"
16366 #| " fprintf(stderr, \"\\et\\etS - F_SEAL_SEAL\\en\");\n"
16367 #| " exit(EXIT_FAILURE);\n"
16370 " if (argc E<lt> 3) {\n"
16371 " fprintf(stderr, \"%s name size [seals]\\en\", argv[0]);\n"
16372 " fprintf(stderr, \"\\et\\(aqseals\\(aq can contain any of the \"\n"
16373 " \"following characters:\\en\");\n"
16374 " fprintf(stderr, \"\\et\\etg - F_SEAL_GROW\\en\");\n"
16375 " fprintf(stderr, \"\\et\\ets - F_SEAL_SHRINK\\en\");\n"
16376 " fprintf(stderr, \"\\et\\etw - F_SEAL_WRITE\\en\");\n"
16377 " fprintf(stderr, \"\\et\\etW - F_SEAL_FUTURE_WRITE\\en\");\n"
16378 " fprintf(stderr, \"\\et\\etS - F_SEAL_SEAL\\en\");\n"
16379 " exit(EXIT_FAILURE);\n"
16382 " if (argc E<lt> 3) {\n"
16383 " fprintf(stderr, \"%s name size [seals]\\en\", argv[0]);\n"
16384 " fprintf(stderr, \"\\et\\(aqseals\\(aq can contain any of the \"\n"
16385 " \"following characters:\\en\");\n"
16386 " fprintf(stderr, \"\\et\\etg - F_SEAL_GROW\\en\");\n"
16387 " fprintf(stderr, \"\\et\\ets - F_SEAL_SHRINK\\en\");\n"
16388 " fprintf(stderr, \"\\et\\etw - F_SEAL_WRITE\\en\");\n"
16389 " fprintf(stderr, \"\\et\\etS - F_SEAL_SEAL\\en\");\n"
16390 " exit(EXIT_FAILURE);\n"
16393 #. type: Plain text
16394 #: build/C/man2/memfd_create.2:446
16397 " name = argv[1];\n"
16398 " len = atoi(argv[2]);\n"
16399 " seals_arg = argv[3];\n"
16401 " name = argv[1];\n"
16402 " len = atoi(argv[2]);\n"
16403 " seals_arg = argv[3];\n"
16405 #. type: Plain text
16406 #: build/C/man2/memfd_create.2:449
16409 " /* Create an anonymous file in tmpfs; allow seals to be\n"
16410 " placed on the file */\n"
16412 " /* Create an anonymous file in tmpfs; allow seals to be\n"
16413 " placed on the file */\n"
16415 #. type: Plain text
16416 #: build/C/man2/memfd_create.2:453
16419 " fd = memfd_create(name, MFD_ALLOW_SEALING);\n"
16421 " errExit(\"memfd_create\");\n"
16423 " fd = memfd_create(name, MFD_ALLOW_SEALING);\n"
16425 " errExit(\"memfd_create\");\n"
16427 #. type: Plain text
16428 #: build/C/man2/memfd_create.2:455
16430 msgid " /* Size the file as specified on the command line */\n"
16431 msgstr " /* Size the file as specified on the command line */\n"
16433 #. type: Plain text
16434 #: build/C/man2/memfd_create.2:458
16437 " if (ftruncate(fd, len) == -1)\n"
16438 " errExit(\"truncate\");\n"
16440 " if (ftruncate(fd, len) == -1)\n"
16441 " errExit(\"truncate\");\n"
16443 #. type: Plain text
16444 #: build/C/man2/memfd_create.2:461
16447 #| " printf(\"PID: %ld; fd: %d; /proc/%ld/fd/%d\\en\",\n"
16448 #| " (long) getpid(), fd, (long) getpid(), fd);\n"
16450 " printf(\"PID: %jd; fd: %d; /proc/%jd/fd/%d\\en\",\n"
16451 " (intmax_t) getpid(), fd, (intmax_t) getpid(), fd);\n"
16453 " printf(\"PID: %ld; fd: %d; /proc/%ld/fd/%d\\en\",\n"
16454 " (long) getpid(), fd, (long) getpid(), fd);\n"
16456 #. type: Plain text
16457 #: build/C/man2/memfd_create.2:464
16460 " /* Code to map the file and populate the mapping with data\n"
16463 " /* Code to map the file and populate the mapping with data\n"
16466 #. type: Plain text
16467 #: build/C/man2/memfd_create.2:467
16470 " /* If a \\(aqseals\\(aq command-line argument was supplied, set some\n"
16471 " seals on the file */\n"
16473 " /* If a \\(aqseals\\(aq command-line argument was supplied, set some\n"
16474 " seals on the file */\n"
16476 #. type: Plain text
16477 #: build/C/man2/memfd_create.2:470
16480 " if (seals_arg != NULL) {\n"
16483 " if (seals_arg != NULL) {\n"
16486 #. type: Plain text
16487 #: build/C/man2/memfd_create.2:481
16490 #| " if (strchr(seals_arg, \\(aqg\\(aq) != NULL)\n"
16491 #| " seals |= F_SEAL_GROW;\n"
16492 #| " if (strchr(seals_arg, \\(aqs\\(aq) != NULL)\n"
16493 #| " seals |= F_SEAL_SHRINK;\n"
16494 #| " if (strchr(seals_arg, \\(aqw\\(aq) != NULL)\n"
16495 #| " seals |= F_SEAL_WRITE;\n"
16496 #| " if (strchr(seals_arg, \\(aqS\\(aq) != NULL)\n"
16497 #| " seals |= F_SEAL_SEAL;\n"
16499 " if (strchr(seals_arg, \\(aqg\\(aq) != NULL)\n"
16500 " seals |= F_SEAL_GROW;\n"
16501 " if (strchr(seals_arg, \\(aqs\\(aq) != NULL)\n"
16502 " seals |= F_SEAL_SHRINK;\n"
16503 " if (strchr(seals_arg, \\(aqw\\(aq) != NULL)\n"
16504 " seals |= F_SEAL_WRITE;\n"
16505 " if (strchr(seals_arg, \\(aqW\\(aq) != NULL)\n"
16506 " seals |= F_SEAL_FUTURE_WRITE;\n"
16507 " if (strchr(seals_arg, \\(aqS\\(aq) != NULL)\n"
16508 " seals |= F_SEAL_SEAL;\n"
16510 " if (strchr(seals_arg, \\(aqg\\(aq) != NULL)\n"
16511 " seals |= F_SEAL_GROW;\n"
16512 " if (strchr(seals_arg, \\(aqs\\(aq) != NULL)\n"
16513 " seals |= F_SEAL_SHRINK;\n"
16514 " if (strchr(seals_arg, \\(aqw\\(aq) != NULL)\n"
16515 " seals |= F_SEAL_WRITE;\n"
16516 " if (strchr(seals_arg, \\(aqS\\(aq) != NULL)\n"
16517 " seals |= F_SEAL_SEAL;\n"
16519 #. type: Plain text
16520 #: build/C/man2/memfd_create.2:485
16523 " if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n"
16524 " errExit(\"fcntl\");\n"
16527 " if (fcntl(fd, F_ADD_SEALS, seals) == -1)\n"
16528 " errExit(\"fcntl\");\n"
16531 #. type: Plain text
16532 #: build/C/man2/memfd_create.2:488
16535 " /* Keep running, so that the file created by memfd_create()\n"
16536 " continues to exist */\n"
16538 " /* Keep running, so that the file created by memfd_create()\n"
16539 " continues to exist */\n"
16541 #. type: Plain text
16542 #: build/C/man2/memfd_create.2:490
16544 msgid " pause();\n"
16545 msgstr " pause();\n"
16548 #: build/C/man2/memfd_create.2:494
16550 msgid "Program source: t_get_seals.c"
16551 msgstr "プログラムのソース: t_get_seals.c"
16553 #. type: Plain text
16554 #: build/C/man2/memfd_create.2:504
16557 #| "#include E<lt>sys/memfd.hE<gt>\n"
16558 #| "#include E<lt>fcntl.hE<gt>\n"
16559 #| "#include E<lt>unistd.hE<gt>\n"
16560 #| "#include E<lt>stdlib.hE<gt>\n"
16561 #| "#include E<lt>string.hE<gt>\n"
16562 #| "#include E<lt>stdio.hE<gt>\n"
16564 "#define _GNU_SOURCE\n"
16565 "#include E<lt>sys/mman.hE<gt>\n"
16566 "#include E<lt>fcntl.hE<gt>\n"
16567 "#include E<lt>unistd.hE<gt>\n"
16568 "#include E<lt>stdlib.hE<gt>\n"
16569 "#include E<lt>string.hE<gt>\n"
16570 "#include E<lt>stdio.hE<gt>\n"
16572 "#include E<lt>sys/memfd.hE<gt>\n"
16573 "#include E<lt>fcntl.hE<gt>\n"
16574 "#include E<lt>unistd.hE<gt>\n"
16575 "#include E<lt>stdlib.hE<gt>\n"
16576 "#include E<lt>string.hE<gt>\n"
16577 "#include E<lt>stdio.hE<gt>\n"
16579 #. type: Plain text
16580 #: build/C/man2/memfd_create.2:513
16584 "main(int argc, char *argv[])\n"
16587 " unsigned int seals;\n"
16590 "main(int argc, char *argv[])\n"
16593 " unsigned int seals;\n"
16595 #. type: Plain text
16596 #: build/C/man2/memfd_create.2:518
16599 " if (argc != 2) {\n"
16600 " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
16601 " exit(EXIT_FAILURE);\n"
16604 " if (argc != 2) {\n"
16605 " fprintf(stderr, \"%s /proc/PID/fd/FD\\en\", argv[0]);\n"
16606 " exit(EXIT_FAILURE);\n"
16609 #. type: Plain text
16610 #: build/C/man2/memfd_create.2:522
16613 " fd = open(argv[1], O_RDWR);\n"
16615 " errExit(\"open\");\n"
16617 " fd = open(argv[1], O_RDWR);\n"
16619 " errExit(\"open\");\n"
16621 #. type: Plain text
16622 #: build/C/man2/memfd_create.2:526
16625 " seals = fcntl(fd, F_GET_SEALS);\n"
16626 " if (seals == -1)\n"
16627 " errExit(\"fcntl\");\n"
16629 " seals = fcntl(fd, F_GET_SEALS);\n"
16630 " if (seals == -1)\n"
16631 " errExit(\"fcntl\");\n"
16633 #. type: Plain text
16634 #: build/C/man2/memfd_create.2:539
16637 #| " printf(\"Existing seals:\");\n"
16638 #| " if (seals & F_SEAL_SEAL)\n"
16639 #| " printf(\" SEAL\");\n"
16640 #| " if (seals & F_SEAL_GROW)\n"
16641 #| " printf(\" GROW\");\n"
16642 #| " if (seals & F_SEAL_WRITE)\n"
16643 #| " printf(\" WRITE\");\n"
16644 #| " if (seals & F_SEAL_SHRINK)\n"
16645 #| " printf(\" SHRINK\");\n"
16646 #| " printf(\"\\en\");\n"
16648 " printf(\"Existing seals:\");\n"
16649 " if (seals & F_SEAL_SEAL)\n"
16650 " printf(\" SEAL\");\n"
16651 " if (seals & F_SEAL_GROW)\n"
16652 " printf(\" GROW\");\n"
16653 " if (seals & F_SEAL_WRITE)\n"
16654 " printf(\" WRITE\");\n"
16655 " if (seals & F_SEAL_FUTURE_WRITE)\n"
16656 " printf(\" FUTURE_WRITE\");\n"
16657 " if (seals & F_SEAL_SHRINK)\n"
16658 " printf(\" SHRINK\");\n"
16659 " printf(\"\\en\");\n"
16661 " printf(\"Existing seals:\");\n"
16662 " if (seals & F_SEAL_SEAL)\n"
16663 " printf(\" SEAL\");\n"
16664 " if (seals & F_SEAL_GROW)\n"
16665 " printf(\" GROW\");\n"
16666 " if (seals & F_SEAL_WRITE)\n"
16667 " printf(\" WRITE\");\n"
16668 " if (seals & F_SEAL_SHRINK)\n"
16669 " printf(\" SHRINK\");\n"
16670 " printf(\"\\en\");\n"
16672 #. type: Plain text
16673 #: build/C/man2/memfd_create.2:542
16676 " /* Code to map the file and access the contents of the\n"
16677 " resulting mapping omitted */\n"
16679 " /* Code to map the file and access the contents of the\n"
16680 " resulting mapping omitted */\n"
16682 #. type: Plain text
16683 #: build/C/man2/memfd_create.2:552
16684 msgid "B<fcntl>(2), B<ftruncate>(2), B<mmap>(2), B<shmget>(2), B<shm_open>(3)"
16685 msgstr "B<fcntl>(2), B<ftruncate>(2), B<mmap>(2), B<shmget>(2), B<shm_open>(3)"
16688 #: build/C/man2/s390_pci_mmio_write.2:25
16690 msgid "S390_PCI_MMIO_WRITE"
16691 msgstr "S390_PCI_MMIO_WRITE"
16693 #. type: Plain text
16694 #: build/C/man2/s390_pci_mmio_write.2:29
16696 "s390_pci_mmio_write, s390_pci_mmio_read - transfer data to/from PCI MMIO "
16700 #. type: Plain text
16701 #: build/C/man2/s390_pci_mmio_write.2:32
16703 msgid "B<#include E<lt>asm/unistd.hE<gt>>\n"
16704 msgstr "B<#include E<lt>asm/unistd.hE<gt>>\n"
16706 #. type: Plain text
16707 #: build/C/man2/s390_pci_mmio_write.2:37
16710 #| "B<int s390_pci_mmio_write(unsigned long >I<mmio_addr>B<,>\n"
16711 #| "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
16713 "B<int s390_pci_mmio_write(unsigned long >I<mmio_addr>B<,>\n"
16714 "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
16715 "B<int s390_pci_mmio_read(unsigned long >I<mmio_addr>B<,>\n"
16716 "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
16718 "B<int s390_pci_mmio_write(unsigned long >I<mmio_addr>B<,>\n"
16719 "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
16721 #. type: Plain text
16722 #: build/C/man2/s390_pci_mmio_write.2:56
16724 "The B<s390_pci_mmio_write>() system call writes I<length> bytes of data "
16725 "from the user-space buffer I<user_buffer> to the PCI MMIO memory location "
16726 "specified by I<mmio_addr>. The B<s390_pci_mmio_read>() system call reads "
16727 "I<length> bytes of data from the PCI MMIO memory location specified by "
16728 "I<mmio_addr> to the user-space buffer I<user_buffer>."
16731 #. type: Plain text
16732 #: build/C/man2/s390_pci_mmio_write.2:67
16734 "These system calls must be used instead of the simple assignment or data-"
16735 "transfer operations that are used to access the PCI MMIO memory areas mapped "
16736 "to user space on the Linux System z platform. The address specified by "
16737 "I<mmio_addr> must belong to a PCI MMIO memory page mapping in the caller's "
16738 "address space, and the data being written or read must not cross a page "
16739 "boundary. The I<length> value cannot be greater than the system page size."
16742 #. type: Plain text
16743 #: build/C/man2/s390_pci_mmio_write.2:76
16745 "On success, B<s390_pci_mmio_write>() and B<s390_pci_mmio_read>() return "
16746 "0. On error, -1 is returned and I<errno> is set to one of the error codes "
16749 "成功すると、 B<s390_pci_mmio_write>() と B<s390_pci_mmio_read>() は 0 を返"
16750 "す。 エラーの場合、-1 を返し、 I<errno> に以下のリストにあるエラーコードのい"
16753 #. type: Plain text
16754 #: build/C/man2/s390_pci_mmio_write.2:82
16755 msgid "The address in I<mmio_addr> is invalid."
16758 #. type: Plain text
16759 #: build/C/man2/s390_pci_mmio_write.2:86
16761 "I<user_buffer> does not point to a valid location in the caller's address "
16765 #. type: Plain text
16766 #: build/C/man2/s390_pci_mmio_write.2:91
16767 msgid "Invalid I<length> argument."
16770 #. type: Plain text
16771 #: build/C/man2/s390_pci_mmio_write.2:94
16772 msgid "PCI support is not enabled."
16775 #. type: Plain text
16776 #: build/C/man2/s390_pci_mmio_write.2:97
16777 msgid "Insufficient memory."
16780 #. type: Plain text
16781 #: build/C/man2/s390_pci_mmio_write.2:99
16782 msgid "These system calls are available since Linux 3.19."
16783 msgstr "これらのシステムコールは Linux 3.19 以降で使用可能である。"
16785 #. type: Plain text
16786 #: build/C/man2/s390_pci_mmio_write.2:102
16788 "This Linux-specific system call is available only on the s390 architecture. "
16789 "The required PCI support is available beginning with System z EC12."
16792 #. type: Plain text
16793 #: build/C/man2/s390_pci_mmio_write.2:106
16795 "Glibc does not provide a wrapper for this system call, use B<syscall>(2) to "
16799 #. type: Plain text
16800 #: build/C/man2/s390_pci_mmio_write.2:108
16801 msgid "B<syscall>(2)"
16802 msgstr "B<syscall>(2)"
16805 #: build/C/man2/membarrier.2:25
16810 #. type: Plain text
16811 #: build/C/man2/membarrier.2:28
16812 msgid "membarrier - issue memory barriers on a set of threads"
16815 #. type: Plain text
16816 #: build/C/man2/membarrier.2:32
16818 #| msgid "B<#include E<lt>sys/mman.hE<gt>>\n"
16819 msgid "B<#include E<lt>linux/membarrier.hE<gt>>\n"
16820 msgstr "B<#include E<lt>sys/mman.hE<gt>>\n"
16822 #. type: Plain text
16823 #: build/C/man2/membarrier.2:34
16825 #| msgid "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>"
16826 msgid "B<int membarrier(int >I<cmd>B<, unsigned int >I<flags>B<, int >I<cpu_id>B<);>\n"
16827 msgstr "B<int memfd_create(const char *>I<name>B<, unsigned int >I<flags>B<);>"
16829 #. type: Plain text
16830 #: build/C/man2/membarrier.2:48
16832 "The B<membarrier>() system call helps reducing the overhead of the memory "
16833 "barrier instructions required to order memory accesses on multi-core "
16834 "systems. However, this system call is heavier than a memory barrier, so "
16835 "using it effectively is I<not> as simple as replacing memory barriers with "
16836 "this system call, but requires understanding of the details below."
16839 #. type: Plain text
16840 #: build/C/man2/membarrier.2:53
16842 "Use of memory barriers needs to be done taking into account that a memory "
16843 "barrier always needs to be either matched with its memory barrier "
16844 "counterparts, or that the architecture's memory model doesn't require the "
16845 "matching barriers."
16848 #. type: Plain text
16849 #: build/C/man2/membarrier.2:62
16851 "There are cases where one side of the matching barriers (which we will refer "
16852 "to as \"fast side\") is executed much more often than the other (which we "
16853 "will refer to as \"slow side\"). This is a prime target for the use of "
16854 "B<membarrier>(). The key idea is to replace, for these matching barriers, "
16855 "the fast-side memory barriers by simple compiler barriers, for example:"
16858 #. type: Plain text
16859 #: build/C/man2/membarrier.2:66
16861 msgid "asm volatile (\"\" : : : \"memory\")\n"
16864 #. type: Plain text
16865 #: build/C/man2/membarrier.2:71
16866 msgid "and replace the slow-side memory barriers by calls to B<membarrier>()."
16869 #. type: Plain text
16870 #: build/C/man2/membarrier.2:77
16872 "This will add overhead to the slow side, and remove overhead from the fast "
16873 "side, thus resulting in an overall performance increase as long as the slow "
16874 "side is infrequent enough that the overhead of the B<membarrier>() calls "
16875 "does not outweigh the performance gain on the fast side."
16878 #. type: Plain text
16879 #: build/C/man2/membarrier.2:81
16882 #| "The I<flags> bit-mask argument can include any of the following values:"
16883 msgid "The I<cmd> argument is one of the following:"
16884 msgstr "ビットマスク引き数 I<flags> には以下の値を指定することができる:"
16887 #: build/C/man2/membarrier.2:81
16889 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
16890 msgid "B<MEMBARRIER_CMD_QUERY> (since Linux 4.3)"
16891 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
16893 #. type: Plain text
16894 #: build/C/man2/membarrier.2:92
16896 "Query the set of supported commands. The return value of the call is a bit "
16897 "mask of supported commands. B<MEMBARRIER_CMD_QUERY>, which has the value 0, "
16898 "is not itself included in this bit mask. This command is always supported "
16899 "(on kernels where B<membarrier>() is provided)."
16903 #: build/C/man2/membarrier.2:92
16905 #| msgid "B<MADV_REMOVE> (since Linux 2.6.16)"
16906 msgid "B<MEMBARRIER_CMD_GLOBAL> (since Linux 4.16)"
16907 msgstr "B<MADV_REMOVE> (Linux 2.6.16 以降)"
16909 #. type: Plain text
16910 #: build/C/man2/membarrier.2:100
16912 "Ensure that all threads from all processes on the system pass through a "
16913 "state where all memory accesses to user-space addresses match program order "
16914 "between entry to and return from the B<membarrier>() system call. All "
16915 "threads on the system are targeted by this command."
16919 #: build/C/man2/membarrier.2:100
16921 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
16922 msgid "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> (since Linux 4.16)"
16923 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
16925 #. type: Plain text
16926 #: build/C/man2/membarrier.2:105
16928 "Execute a memory barrier on all running threads of all processes that "
16929 "previously registered with B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
16932 #. type: Plain text
16933 #: build/C/man2/membarrier.2:113
16935 "Upon return from the system call, the calling thread has a guarantee that "
16936 "all running threads have passed through a state where all memory accesses to "
16937 "user-space addresses match program order between entry to and return from "
16938 "the system call (non-running threads are de facto in such a state). This "
16939 "guarantee is provided only for the threads of processes that previously "
16940 "registered with B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
16943 #. type: Plain text
16944 #: build/C/man2/membarrier.2:119
16946 "Given that registration is about the intent to receive the barriers, it is "
16947 "valid to invoke B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> from a process that has "
16948 "not employed B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>."
16951 #. type: Plain text
16952 #: build/C/man2/membarrier.2:122 build/C/man2/membarrier.2:142
16954 "The \"expedited\" commands complete faster than the non-expedited ones; they "
16955 "never block, but have the downside of causing extra overhead."
16959 #: build/C/man2/membarrier.2:122
16961 #| msgid "B<MADV_SOFT_OFFLINE> (since Linux 2.6.33)"
16962 msgid "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED> (since Linux 4.16)"
16963 msgstr "B<MADV_SOFT_OFFLINE> (Linux 2.6.33 以降)"
16965 #. type: Plain text
16966 #: build/C/man2/membarrier.2:127
16968 "Register the process's intent to receive B<MEMBARRIER_CMD_GLOBAL_EXPEDITED> "
16973 #: build/C/man2/membarrier.2:127
16975 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
16976 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED> (since Linux 4.14)"
16977 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
16979 #. type: Plain text
16980 #: build/C/man2/membarrier.2:131
16982 "Execute a memory barrier on each running thread belonging to the same "
16983 "process as the calling thread."
16986 #. type: Plain text
16987 #: build/C/man2/membarrier.2:139
16989 "Upon return from the system call, the calling thread has a guarantee that "
16990 "all its running thread siblings have passed through a state where all memory "
16991 "accesses to user-space addresses match program order between entry to and "
16992 "return from the system call (non-running threads are de facto in such a "
16993 "state). This guarantee is provided only for threads in the same process as "
16994 "the calling thread."
16997 #. type: Plain text
16998 #: build/C/man2/membarrier.2:145
17000 "A process must register its intent to use the private expedited command "
17001 "prior to using it."
17005 #: build/C/man2/membarrier.2:145
17007 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED> (since Linux 4.14)"
17010 #. type: Plain text
17011 #: build/C/man2/membarrier.2:149
17013 "Register the process's intent to use B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>."
17017 #: build/C/man2/membarrier.2:149
17019 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> (since Linux 4.16)"
17022 #. type: Plain text
17023 #: build/C/man2/membarrier.2:157
17025 "In addition to providing the memory ordering guarantees described in "
17026 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, upon return from system call the "
17027 "calling thread has a guarantee that all its running thread siblings have "
17028 "executed a core serializing instruction. This guarantee is provided only "
17029 "for threads in the same process as the calling thread."
17032 #. type: Plain text
17033 #: build/C/man2/membarrier.2:160
17035 "The \"expedited\" commands complete faster than the non-expedited ones, they "
17036 "never block, but have the downside of causing extra overhead."
17039 #. type: Plain text
17040 #: build/C/man2/membarrier.2:163
17042 "A process must register its intent to use the private expedited sync core "
17043 "command prior to using it."
17047 #: build/C/man2/membarrier.2:163
17049 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> (since Linux 4.16)"
17052 #. type: Plain text
17053 #: build/C/man2/membarrier.2:167
17055 "Register the process's intent to use "
17056 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>."
17060 #: build/C/man2/membarrier.2:167
17062 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
17063 msgid "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ> (since Linux 5.10)"
17064 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
17066 #. type: Plain text
17067 #: build/C/man2/membarrier.2:181
17069 "Ensure the caller thread, upon return from system call, that all its running "
17070 "thread siblings have any currently running rseq critical sections restarted "
17071 "if I<flags> parameter is 0; if I<flags> parameter is "
17072 "B<MEMBARRIER_CMD_FLAG_CPU>, then this operation is performed only on CPU "
17073 "indicated by I<cpu_id>. This guarantee is provided only for threads in the "
17074 "same process as the calling thread."
17077 #. type: Plain text
17078 #: build/C/man2/membarrier.2:183
17079 msgid "RSEQ membarrier is only available in the \"private expedited\" form."
17082 #. type: Plain text
17083 #: build/C/man2/membarrier.2:186
17085 "A process must register its intent to use the private expedited rseq command "
17086 "prior to using it."
17090 #: build/C/man2/membarrier.2:186
17092 msgid "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ> (since Linux 5.10)"
17095 #. type: Plain text
17096 #: build/C/man2/membarrier.2:190
17098 "Register the process's intent to use "
17099 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ>."
17103 #: build/C/man2/membarrier.2:190
17105 #| msgid "B<MREMAP_FIXED> (since Linux 2.3.31)"
17106 msgid "B<MEMBARRIER_CMD_SHARED> (since Linux 4.3)"
17107 msgstr "B<MREMAP_FIXED> (Linux 2.3.31 以降)"
17109 #. type: Plain text
17110 #: build/C/man2/membarrier.2:195
17112 "This is an alias for B<MEMBARRIER_CMD_GLOBAL> that exists for header "
17113 "backward compatibility."
17116 #. type: Plain text
17117 #: build/C/man2/membarrier.2:204
17119 "The I<flags> argument must be specified as 0 unless the command is "
17120 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ>, in which case I<flags> can be "
17121 "either 0 or B<MEMBARRIER_CMD_FLAG_CPU>."
17124 #. type: Plain text
17125 #: build/C/man2/membarrier.2:213
17127 "The I<cpu_id> argument is ignored unless I<flags> is "
17128 "B<MEMBARRIER_CMD_FLAG_CPU>, in which case it must specify the CPU targeted "
17129 "by this membarrier command."
17132 #. type: Plain text
17133 #: build/C/man2/membarrier.2:217
17135 "All memory accesses performed in program order from each targeted thread are "
17136 "guaranteed to be ordered with respect to B<membarrier>()."
17139 #. type: Plain text
17140 #: build/C/man2/membarrier.2:231
17142 "If we use the semantic I<barrier()> to represent a compiler barrier forcing "
17143 "memory accesses to be performed in program order across the barrier, and "
17144 "I<smp_mb()> to represent explicit memory barriers forcing full memory "
17145 "ordering across the barrier, we have the following ordering table for each "
17146 "pairing of I<barrier()>, B<membarrier>(), and I<smp_mb()>. The pair "
17147 "ordering is detailed as (O: ordered, X: not ordered):"
17150 #. type: Plain text
17151 #: build/C/man2/membarrier.2:236
17154 " barrier() smp_mb() membarrier()\n"
17155 " barrier() X X O\n"
17156 " smp_mb() X O O\n"
17157 " membarrier() O O O\n"
17160 #. type: Plain text
17161 #: build/C/man2/membarrier.2:253
17163 "On success, the B<MEMBARRIER_CMD_QUERY> operation returns a bit mask of "
17164 "supported commands, and the B<MEMBARRIER_CMD_GLOBAL>, "
17165 "B<MEMBARRIER_CMD_GLOBAL_EXPEDITED>, "
17166 "B<MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED>, "
17167 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED>, "
17168 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED>, "
17169 "B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE>, and "
17170 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> operations return "
17171 "zero. On error, -1 is returned, and I<errno> is set appropriately."
17174 #. type: Plain text
17175 #: build/C/man2/membarrier.2:263
17177 "For a given command, with I<flags> set to 0, this system call is guaranteed "
17178 "to always return the same value until reboot. Further calls with the same "
17179 "arguments will lead to the same result. Therefore, with I<flags> set to 0, "
17180 "error handling is required only for the first call to B<membarrier>()."
17183 #. type: Plain text
17184 #: build/C/man2/membarrier.2:278
17186 "I<cmd> is invalid, or I<flags> is nonzero, or the B<MEMBARRIER_CMD_GLOBAL> "
17187 "command is disabled because the I<nohz_full> CPU parameter has been set, or "
17188 "the B<MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE> and "
17189 "B<MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE> commands are not "
17190 "implemented by the architecture."
17193 #. type: Plain text
17194 #: build/C/man2/membarrier.2:283
17196 #| msgid "The system call is not supported on this kernel."
17197 msgid "The B<membarrier>() system call is not implemented by this kernel."
17198 msgstr "このシステムコールはカーネルでサポートされていない。"
17200 #. type: Plain text
17201 #: build/C/man2/membarrier.2:287
17203 "The current process was not registered prior to using private expedited "
17207 #. type: Plain text
17208 #: build/C/man2/membarrier.2:291
17210 #| msgid "The B<memfd_create>() system call is Linux-specific."
17211 msgid "The B<membarrier>() system call was added in Linux 4.3."
17212 msgstr "B<memfd_create>() システムコールは Linux 固有である。"
17214 #. type: Plain text
17215 #: build/C/man2/membarrier.2:295
17216 msgid "Before Linux 5.10, the prototype for B<membarrier>() was:"
17219 #. type: Plain text
17220 #: build/C/man2/membarrier.2:299
17222 #| msgid "B<int mallopt(int >I<param>B<, int >I<value>B<);>"
17223 msgid "B<int membarrier(int >I<cmd>B<, int >I<flags>B<);>\n"
17224 msgstr "B<int mallopt(int >I<param>B<, int >I<value>B<);>"
17227 #. FIXME See if the following syscalls make it into Linux 4.15 or later
17228 #. .BR cpu_opv (2),
17230 #. type: Plain text
17231 #: build/C/man2/membarrier.2:308
17233 #| msgid "B<fallocate>() is Linux-specific."
17234 msgid "B<membarrier>() is Linux-specific."
17235 msgstr "B<fallocate>() は Linux 固有である。"
17237 #. type: Plain text
17238 #: build/C/man2/membarrier.2:317
17240 "A memory barrier instruction is part of the instruction set of architectures "
17241 "with weakly ordered memory models. It orders memory accesses prior to the "
17242 "barrier and after the barrier with respect to matching barriers on other "
17243 "cores. For instance, a load fence can order loads prior to and following "
17244 "that fence with respect to stores ordered by store fences."
17247 #. type: Plain text
17248 #: build/C/man2/membarrier.2:320
17250 "Program order is the order in which instructions are ordered in the program "
17254 #. type: Plain text
17255 #: build/C/man2/membarrier.2:325
17257 "Examples where B<membarrier>() can be useful include implementations of "
17258 "Read-Copy-Update libraries and garbage collectors."
17261 #. type: Plain text
17262 #: build/C/man2/membarrier.2:333
17264 "Assuming a multithreaded application where \"fast_path()\" is executed very "
17265 "frequently, and where \"slow_path()\" is executed infrequently, the "
17266 "following code (x86) can be transformed using B<membarrier>():"
17269 #. type: Plain text
17270 #: build/C/man2/membarrier.2:337
17272 #| msgid "B<#include E<lt>stdlib.hE<gt>>\n"
17273 msgid "#include E<lt>stdlib.hE<gt>\n"
17274 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
17276 #. type: Plain text
17277 #: build/C/man2/membarrier.2:339 build/C/man2/membarrier.2:397
17279 msgid "static volatile int a, b;\n"
17282 #. type: Plain text
17283 #: build/C/man2/membarrier.2:347
17287 "fast_path(int *read_b)\n"
17290 " asm volatile (\"mfence\" : : : \"memory\");\n"
17295 #. type: Plain text
17296 #: build/C/man2/membarrier.2:355
17300 "slow_path(int *read_a)\n"
17303 " asm volatile (\"mfence\" : : : \"memory\");\n"
17308 #. type: Plain text
17309 #: build/C/man2/membarrier.2:360 build/C/man2/membarrier.2:446
17313 #| "main(int argc, char *argv[])\n"
17318 "main(int argc, char **argv)\n"
17320 " int read_a, read_b;\n"
17323 "main(int argc, char *argv[])\n"
17327 #. type: Plain text
17328 #: build/C/man2/membarrier.2:366 build/C/man2/membarrier.2:455
17332 " * Real applications would call fast_path() and slow_path()\n"
17333 " * from different threads. Call those from main() to keep\n"
17334 " * this example short.\n"
17338 #. type: Plain text
17339 #: build/C/man2/membarrier.2:369 build/C/man2/membarrier.2:458
17342 " slow_path(&read_a);\n"
17343 " fast_path(&read_b);\n"
17346 #. type: Plain text
17347 #: build/C/man2/membarrier.2:374 build/C/man2/membarrier.2:463
17351 " * read_b == 0 implies read_a == 1 and\n"
17352 " * read_a == 0 implies read_b == 1.\n"
17356 #. type: Plain text
17357 #: build/C/man2/membarrier.2:377 build/C/man2/membarrier.2:466
17360 " if (read_b == 0 && read_a == 0)\n"
17364 #. type: Plain text
17365 #: build/C/man2/membarrier.2:386
17366 msgid "The code above transformed to use B<membarrier>() becomes:"
17369 #. type: Plain text
17370 #: build/C/man2/membarrier.2:395
17373 #| "#include E<lt>unistd.hE<gt>\n"
17374 #| "#include E<lt>stdlib.hE<gt>\n"
17375 #| "#include E<lt>pthread.hE<gt>\n"
17376 #| "#include E<lt>malloc.hE<gt>\n"
17377 #| "#include E<lt>errno.hE<gt>\n"
17379 "#define _GNU_SOURCE\n"
17380 "#include E<lt>stdlib.hE<gt>\n"
17381 "#include E<lt>stdio.hE<gt>\n"
17382 "#include E<lt>unistd.hE<gt>\n"
17383 "#include E<lt>sys/syscall.hE<gt>\n"
17384 "#include E<lt>linux/membarrier.hE<gt>\n"
17386 "#include E<lt>unistd.hE<gt>\n"
17387 "#include E<lt>stdlib.hE<gt>\n"
17388 "#include E<lt>pthread.hE<gt>\n"
17389 "#include E<lt>malloc.hE<gt>\n"
17390 "#include E<lt>errno.hE<gt>\n"
17392 #. type: Plain text
17393 #: build/C/man2/membarrier.2:403
17397 "membarrier(int cmd, unsigned int flags, int cpu_id)\n"
17399 " return syscall(__NR_membarrier, cmd, flags, cpu_id);\n"
17403 #. type: Plain text
17404 #: build/C/man2/membarrier.2:408
17408 "init_membarrier(void)\n"
17413 #. type: Plain text
17414 #: build/C/man2/membarrier.2:410
17416 msgid " /* Check that membarrier() is supported. */\n"
17419 #. type: Plain text
17420 #: build/C/man2/membarrier.2:416
17423 " ret = membarrier(MEMBARRIER_CMD_QUERY, 0, 0);\n"
17424 " if (ret E<lt> 0) {\n"
17425 " perror(\"membarrier\");\n"
17430 #. type: Plain text
17431 #: build/C/man2/membarrier.2:422
17434 " if (!(ret & MEMBARRIER_CMD_GLOBAL)) {\n"
17435 " fprintf(stderr,\n"
17436 " \"membarrier does not support MEMBARRIER_CMD_GLOBAL\\en\");\n"
17441 #. type: Plain text
17442 #: build/C/man2/membarrier.2:425
17445 #| " return result;\n"
17451 " return result;\n"
17454 #. type: Plain text
17455 #: build/C/man2/membarrier.2:433
17459 "fast_path(int *read_b)\n"
17462 " asm volatile (\"\" : : : \"memory\");\n"
17467 #. type: Plain text
17468 #: build/C/man2/membarrier.2:441
17472 "slow_path(int *read_a)\n"
17475 " membarrier(MEMBARRIER_CMD_GLOBAL, 0, 0);\n"
17480 #. type: Plain text
17481 #: build/C/man2/membarrier.2:449
17484 #| " fprintf(stderr, \"partial write\");\n"
17485 #| " exit(EXIT_FAILURE);\n"
17488 " if (init_membarrier())\n"
17489 " exit(EXIT_FAILURE);\n"
17491 " fprintf(stderr, \"partial write\");\n"
17492 " exit(EXIT_FAILURE);\n"
17496 #: build/C/man2/pkey_alloc.2:25
17502 #. type: Plain text
17503 #: build/C/man2/pkey_alloc.2:28
17504 msgid "pkey_alloc, pkey_free - allocate or free a protection key"
17507 #. type: Plain text
17508 #: build/C/man2/pkey_alloc.2:35
17511 "B<int pkey_alloc(unsigned int >I<flags>B<, unsigned int >I<access_rights>B<);>\n"
17512 "B<int pkey_free(int >I<pkey>B<);>\n"
17515 #. type: Plain text
17516 #: build/C/man2/pkey_alloc.2:40
17518 "B<pkey_alloc>() allocates a protection key (pkey) and allows it to be "
17519 "passed to B<pkey_mprotect>(2)."
17522 #. type: Plain text
17523 #: build/C/man2/pkey_alloc.2:45
17525 "The B<pkey_alloc>() I<flags> is reserved for future use and currently must "
17526 "always be specified as 0."
17529 #. type: Plain text
17530 #: build/C/man2/pkey_alloc.2:50
17532 "The B<pkey_alloc>() I<access_rights> argument may contain zero or more "
17533 "disable operations:"
17537 #: build/C/man2/pkey_alloc.2:50
17539 msgid "B<PKEY_DISABLE_ACCESS>"
17542 #. type: Plain text
17543 #: build/C/man2/pkey_alloc.2:53
17545 "Disable all data access to memory covered by the returned protection key."
17549 #: build/C/man2/pkey_alloc.2:53
17551 #| msgid "B<MAP_DENYWRITE>"
17552 msgid "B<PKEY_DISABLE_WRITE>"
17553 msgstr "B<MAP_DENYWRITE>"
17555 #. type: Plain text
17556 #: build/C/man2/pkey_alloc.2:56
17557 msgid "Disable write access to memory covered by the returned protection key."
17560 #. type: Plain text
17561 #: build/C/man2/pkey_alloc.2:62
17563 "B<pkey_free>() frees a protection key and makes it available for later "
17564 "allocations. After a protection key has been freed, it may no longer be "
17565 "used in any protection-key-related operations."
17568 #. type: Plain text
17569 #: build/C/man2/pkey_alloc.2:70
17571 "An application should not call B<pkey_free>() on any protection key which "
17572 "has been assigned to an address range by B<pkey_mprotect>(2) and which is "
17573 "still in use. The behavior in this case is undefined and may result in an "
17577 #. type: Plain text
17578 #: build/C/man2/pkey_alloc.2:80
17581 #| "On success, B<alloc_hugepages>() returns the allocated virtual address, "
17582 #| "and B<free_hugepages>() returns zero. On error, -1 is returned, and "
17583 #| "I<errno> is set appropriately."
17585 "On success, B<pkey_alloc>() returns a positive protection key value. On "
17586 "success, B<pkey_free>() returns zero. On error, -1 is returned, and "
17587 "I<errno> is set appropriately."
17589 "成功した場合、 B<alloc_hugepages>() は割り当てられた仮想アドレスを返し、 "
17590 "B<free_hugepages>() は 0 を返す。 失敗した場合、-1 を返し、 I<errno> が適切"
17593 #. type: Plain text
17594 #: build/C/man2/pkey_alloc.2:88
17596 #| msgid "I<addr>, I<size>, I<prot>, or I<pgoff> is invalid."
17597 msgid "I<pkey>, I<flags>, or I<access_rights> is invalid."
17598 msgstr "I<addr>, I<size>, I<prot>, I<pgoff> のいずれかが不正である。"
17600 #. type: Plain text
17601 #: build/C/man2/pkey_alloc.2:97
17603 "(B<pkey_alloc>()) All protection keys available for the current process "
17604 "have been allocated. The number of keys available is architecture-specific "
17605 "and implementation-specific and may be reduced by kernel-internal use of "
17606 "certain keys. There are currently 15 keys available to user programs on x86."
17609 #. type: Plain text
17610 #: build/C/man2/pkey_alloc.2:103
17612 "This error will also be returned if the processor or operating system does "
17613 "not support protection keys. Applications should always be prepared to "
17614 "handle this error, since factors outside of the application's control can "
17615 "reduce the number of available pkeys."
17618 #. type: Plain text
17619 #: build/C/man2/pkey_alloc.2:109
17621 "B<pkey_alloc>() and B<pkey_free>() were added to Linux in kernel 4.9; "
17622 "library support was added in glibc 2.27."
17625 #. type: Plain text
17626 #: build/C/man2/pkey_alloc.2:115
17628 #| msgid "The B<memfd_create>() system call is Linux-specific."
17630 "The B<pkey_alloc>() and B<pkey_free>() system calls are Linux-specific."
17631 msgstr "B<memfd_create>() システムコールは Linux 固有である。"
17633 #. type: Plain text
17634 #: build/C/man2/pkey_alloc.2:123
17636 "B<pkey_alloc>() is always safe to call regardless of whether or not the "
17637 "operating system supports protection keys. It can be used in lieu of any "
17638 "other mechanism for detecting pkey support and will simply fail with the "
17639 "error B<ENOSPC> if the operating system has no pkey support."
17642 #. type: Plain text
17643 #: build/C/man2/pkey_alloc.2:134
17645 "The kernel guarantees that the contents of the hardware rights register "
17646 "(PKRU) will be preserved only for allocated protection keys. Any time a key "
17647 "is unallocated (either before the first call returning that key from "
17648 "B<pkey_alloc>() or after it is freed via B<pkey_free>()), the kernel may "
17649 "make arbitrary changes to the parts of the rights register affecting access "
17653 #. type: Plain text
17654 #: build/C/man2/pkey_alloc.2:137
17655 msgid "See B<pkeys>(7)."
17658 #. type: Plain text
17659 #: build/C/man2/pkey_alloc.2:140
17661 #| msgid "B<mprotect>(2), B<syscall>(2)"
17662 msgid "B<pkey_mprotect>(2), B<pkeys>(7)"
17663 msgstr "B<mprotect>(2), B<syscall>(2)"
17666 #: build/C/man7/pkeys.7:25
17671 #. type: Plain text
17672 #: build/C/man7/pkeys.7:28
17673 msgid "pkeys - overview of Memory Protection Keys"
17676 #. type: Plain text
17677 #: build/C/man7/pkeys.7:37
17679 "Memory Protection Keys (pkeys) are an extension to existing page-based "
17680 "memory permissions. Normal page permissions using page tables require "
17681 "expensive system calls and TLB invalidations when changing permissions. "
17682 "Memory Protection Keys provide a mechanism for changing protections without "
17683 "requiring modification of the page tables on every permission change."
17686 #. type: Plain text
17687 #: build/C/man7/pkeys.7:43
17689 "To use pkeys, software must first \"tag\" a page in the page tables with a "
17690 "pkey. After this tag is in place, an application only has to change the "
17691 "contents of a register in order to remove write access, or all access to a "
17695 #. type: Plain text
17696 #: build/C/man7/pkeys.7:54
17698 "Protection keys work in conjunction with the existing B<PROT_READ>/ "
17699 "B<PROT_WRITE>/ B<PROT_EXEC> permissions passed to system calls such as "
17700 "B<mprotect>(2) and B<mmap>(2), but always act to further restrict these "
17701 "traditional permission mechanisms."
17704 #. type: Plain text
17705 #: build/C/man7/pkeys.7:62
17707 "If a process performs an access that violates pkey restrictions, it receives "
17708 "a B<SIGSEGV> signal. See B<sigaction>(2) for details of the information "
17709 "available with that signal."
17712 #. type: Plain text
17713 #: build/C/man7/pkeys.7:72
17715 "To use the pkeys feature, the processor must support it, and the kernel must "
17716 "contain support for the feature on a given processor. As of early 2016 only "
17717 "future Intel x86 processors are supported, and this hardware supports 16 "
17718 "protection keys in each process. However, pkey 0 is used as the default "
17719 "key, so a maximum of 15 are available for actual application use. The "
17720 "default key is assigned to any memory region for which a pkey has not been "
17721 "explicitly assigned via B<pkey_mprotect>(2)."
17724 #. type: Plain text
17725 #: build/C/man7/pkeys.7:80
17727 "Protection keys have the potential to add a layer of security and "
17728 "reliability to applications. But they have not been primarily designed as a "
17729 "security feature. For instance, WRPKRU is a completely unprivileged "
17730 "instruction, so pkeys are useless in any case that an attacker controls the "
17731 "PKRU register or can execute arbitrary instructions."
17734 #. type: Plain text
17735 #: build/C/man7/pkeys.7:99
17737 "Applications should be very careful to ensure that they do not \"leak\" "
17738 "protection keys. For instance, before calling B<pkey_free>(2), the "
17739 "application should be sure that no memory has that pkey assigned. If the "
17740 "application left the freed pkey assigned, a future user of that pkey might "
17741 "inadvertently change the permissions of an unrelated data structure, which "
17742 "could impact security or stability. The kernel currently allows in-use "
17743 "pkeys to have B<pkey_free>(2) called on them because it would have "
17744 "processor or memory performance implications to perform the additional "
17745 "checks needed to disallow it. Implementation of the necessary checks is "
17746 "left up to applications. Applications may implement these checks by "
17747 "searching the I</proc/[pid]/smaps> file for memory regions with the pkey "
17748 "assigned. Further details can be found in B<proc>(5)."
17751 #. type: Plain text
17752 #: build/C/man7/pkeys.7:113
17754 "Any application wanting to use protection keys needs to be able to function "
17755 "without them. They might be unavailable because the hardware that the "
17756 "application runs on does not support them, the kernel code does not contain "
17757 "support, the kernel support has been disabled, or because the keys have all "
17758 "been allocated, perhaps by a library the application is using. It is "
17759 "recommended that applications wanting to use protection keys should simply "
17760 "call B<pkey_alloc>(2) and test whether the call succeeds, instead of "
17761 "attempting to detect support for the feature in any other way."
17764 #. type: Plain text
17765 #: build/C/man7/pkeys.7:126
17767 "Although unnecessary, hardware support for protection keys may be enumerated "
17768 "with the I<cpuid> instruction. Details of how to do this can be found in "
17769 "the Intel Software Developers Manual. The kernel performs this enumeration "
17770 "and exposes the information in I</proc/cpuinfo> under the \"flags\" field. "
17771 "The string \"pku\" in this field indicates hardware support for protection "
17772 "keys and the string \"ospke\" indicates that the kernel contains and has "
17773 "enabled protection keys support."
17776 #. type: Plain text
17777 #: build/C/man7/pkeys.7:139
17779 "Applications using threads and protection keys should be especially "
17780 "careful. Threads inherit the protection key rights of the parent at the "
17781 "time of the B<clone>(2), system call. Applications should either ensure "
17782 "that their own permissions are appropriate for child threads at the time "
17783 "when B<clone>(2) is called, or ensure that each child thread can perform "
17784 "its own initialization of protection key rights."
17788 #: build/C/man7/pkeys.7:139
17790 msgid "Signal Handler Behavior"
17793 #. type: Plain text
17794 #: build/C/man7/pkeys.7:148
17796 "Each time a signal handler is invoked (including nested signals), the thread "
17797 "is temporarily given a new, default set of protection key rights that "
17798 "override the rights from the interrupted context. This means that "
17799 "applications must re-establish their desired protection key rights upon "
17800 "entering a signal handler if the desired rights differ from the defaults. "
17801 "The rights of any interrupted context are restored when the signal handler "
17805 #. type: Plain text
17806 #: build/C/man7/pkeys.7:154
17808 "This signal behavior is unusual and is due to the fact that the x86 PKRU "
17809 "register (which stores protection key access rights) is managed with the "
17810 "same hardware mechanism (XSAVE) that manages floating-point registers. The "
17811 "signal behavior is the same as that of floating-point registers."
17815 #: build/C/man7/pkeys.7:154
17817 msgid "Protection Keys system calls"
17820 #. type: Plain text
17821 #: build/C/man7/pkeys.7:160
17823 "The Linux kernel implements the following pkey-related system calls: "
17824 "B<pkey_mprotect>(2), B<pkey_alloc>(2), and B<pkey_free>(2)."
17827 #. type: Plain text
17828 #: build/C/man7/pkeys.7:165
17830 "The Linux pkey system calls are available only if the kernel was configured "
17831 "and built with the B<CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS> option."
17834 #. type: Plain text
17835 #: build/C/man7/pkeys.7:174
17837 "The program below allocates a page of memory with read and write "
17838 "permissions. It then writes some data to the memory and successfully reads "
17839 "it back. After that, it attempts to allocate a protection key and disallows "
17840 "access to the page by using the WRPKRU instruction. It then tries to access "
17841 "the page, which we now expect to cause a fatal signal to the application."
17844 #. type: Plain text
17845 #: build/C/man7/pkeys.7:181
17849 "buffer contains: 73\n"
17850 "about to read buffer again...\n"
17851 "Segmentation fault (core dumped)\n"
17854 #. type: Plain text
17855 #: build/C/man7/pkeys.7:191
17858 #| "#include E<lt>unistd.hE<gt>\n"
17859 #| "#include E<lt>stdlib.hE<gt>\n"
17860 #| "#include E<lt>pthread.hE<gt>\n"
17861 #| "#include E<lt>malloc.hE<gt>\n"
17862 #| "#include E<lt>errno.hE<gt>\n"
17864 "#define _GNU_SOURCE\n"
17865 "#include E<lt>unistd.hE<gt>\n"
17866 "#include E<lt>sys/syscall.hE<gt>\n"
17867 "#include E<lt>stdio.hE<gt>\n"
17868 "#include E<lt>sys/mman.hE<gt>\n"
17870 "#include E<lt>unistd.hE<gt>\n"
17871 "#include E<lt>stdlib.hE<gt>\n"
17872 "#include E<lt>pthread.hE<gt>\n"
17873 "#include E<lt>malloc.hE<gt>\n"
17874 "#include E<lt>errno.hE<gt>\n"
17876 #. type: Plain text
17877 #: build/C/man7/pkeys.7:198
17880 "static inline void\n"
17881 "wrpkru(unsigned int pkru)\n"
17883 " unsigned int eax = pkru;\n"
17884 " unsigned int ecx = 0;\n"
17885 " unsigned int edx = 0;\n"
17888 #. type: Plain text
17889 #: build/C/man7/pkeys.7:202
17892 " asm volatile(\".byte 0x0f,0x01,0xef\\en\\et\"\n"
17893 " : : \"a\" (eax), \"c\" (ecx), \"d\" (edx));\n"
17897 #. type: Plain text
17898 #: build/C/man7/pkeys.7:209
17902 "pkey_set(int pkey, unsigned long rights, unsigned long flags)\n"
17904 " unsigned int pkru = (rights E<lt>E<lt> (2 * pkey));\n"
17905 " return wrpkru(pkru);\n"
17909 #. type: Plain text
17910 #: build/C/man7/pkeys.7:216
17914 "pkey_mprotect(void *ptr, size_t size, unsigned long orig_prot,\n"
17915 " unsigned long pkey)\n"
17917 " return syscall(SYS_pkey_mprotect, ptr, size, orig_prot, pkey);\n"
17921 #. type: Plain text
17922 #: build/C/man7/pkeys.7:222
17926 "pkey_alloc(void)\n"
17928 " return syscall(SYS_pkey_alloc, 0, 0);\n"
17932 #. type: Plain text
17933 #: build/C/man7/pkeys.7:228
17937 "pkey_free(unsigned long pkey)\n"
17939 " return syscall(SYS_pkey_free, pkey);\n"
17943 #. type: Plain text
17944 #: build/C/man7/pkeys.7:231
17947 #| "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
17948 #| " } while (0)\n"
17950 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
17953 "#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \\e\n"
17956 #. type: Plain text
17957 #: build/C/man7/pkeys.7:238
17968 #. type: Plain text
17969 #: build/C/man7/pkeys.7:246
17972 #| " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
17973 #| " MAP_PRIVATE, fd, pa_offset);\n"
17974 #| " if (addr == MAP_FAILED)\n"
17975 #| " handle_error(\"mmap\");\n"
17978 " *Allocate one page of memory\n"
17980 " buffer = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,\n"
17981 " MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);\n"
17982 " if (buffer == MAP_FAILED)\n"
17983 " errExit(\"mmap\");\n"
17985 " addr = mmap(NULL, length + offset - pa_offset, PROT_READ,\n"
17986 " MAP_PRIVATE, fd, pa_offset);\n"
17987 " if (addr == MAP_FAILED)\n"
17988 " handle_error(\"mmap\");\n"
17990 #. type: Plain text
17991 #: build/C/man7/pkeys.7:252
17995 " * Put some random data into the page (still OK to touch)\n"
17997 " *buffer = __LINE__;\n"
17998 " printf(\"buffer contains: %d\\en\", *buffer);\n"
18001 #. type: Plain text
18002 #: build/C/man7/pkeys.7:259
18006 " * Allocate a protection key:\n"
18008 " pkey = pkey_alloc();\n"
18009 " if (pkey == -1)\n"
18010 " errExit(\"pkey_alloc\");\n"
18013 #. type: Plain text
18014 #: build/C/man7/pkeys.7:267
18018 " * Disable access to any memory with \"pkey\" set,\n"
18019 " * even though there is none right now\n"
18021 " status = pkey_set(pkey, PKEY_DISABLE_ACCESS, 0);\n"
18023 " errExit(\"pkey_set\");\n"
18026 #. type: Plain text
18027 #: build/C/man7/pkeys.7:277
18031 " * Set the protection key on \"buffer\".\n"
18032 " * Note that it is still read/write as far as mprotect() is\n"
18033 " * concerned and the previous pkey_set() overrides it.\n"
18035 " status = pkey_mprotect(buffer, getpagesize(),\n"
18036 " PROT_READ | PROT_WRITE, pkey);\n"
18037 " if (status == -1)\n"
18038 " errExit(\"pkey_mprotect\");\n"
18041 #. type: Plain text
18042 #: build/C/man7/pkeys.7:279
18044 msgid " printf(\"about to read buffer again...\\en\");\n"
18047 #. type: Plain text
18048 #: build/C/man7/pkeys.7:284
18052 " * This will crash, because we have disallowed access\n"
18054 " printf(\"buffer contains: %d\\en\", *buffer);\n"
18057 #. type: Plain text
18058 #: build/C/man7/pkeys.7:288
18061 #| " seals = fcntl(fd, F_GET_SEALS);\n"
18062 #| " if (seals == -1)\n"
18063 #| " errExit(\"fcntl\");\n"
18065 " status = pkey_free(pkey);\n"
18066 " if (status == -1)\n"
18067 " errExit(\"pkey_free\");\n"
18069 " seals = fcntl(fd, F_GET_SEALS);\n"
18070 " if (seals == -1)\n"
18071 " errExit(\"fcntl\");\n"
18073 #. type: Plain text
18074 #: build/C/man7/pkeys.7:297
18076 #| msgid "B<fallocate>(1), B<fallocate>(2), B<lseek>(2), B<posix_fadvise>(2)"
18077 msgid "B<pkey_alloc>(2), B<pkey_free>(2), B<pkey_mprotect>(2), B<sigaction>(2)"
18078 msgstr "B<fallocate>(1), B<fallocate>(2), B<lseek>(2), B<posix_fadvise>(2)"
18080 #~ msgid "2007-05-31"
18081 #~ msgstr "2007-05-31"
18083 #~ msgid "2013-10-07"
18084 #~ msgstr "2013-10-07"
18086 #~ msgid "Multithreading (see pthreads(7))"
18087 #~ msgstr "マルチスレッディング (pthreads(7) 参照)"
18089 #~ msgid "The B<alloca>() function is thread-safe."
18090 #~ msgstr "B<alloca>() 関数はスレッドセーフである。"
18092 #~ msgid "2007-05-26"
18093 #~ msgstr "2007-05-26"
18096 #~ "This Linux-specific system call is available only on MIPS-based systems. "
18097 #~ "It should not be used in programs intended to be portable."
18099 #~ "この Linux 特有のシステムコールは MIPS ベースのシステムでのみ有効である。 "
18100 #~ "移植を意図したプログラムで使用すべきではない。"
18102 #~ msgid "2015-01-22"
18103 #~ msgstr "2015-01-22"
18106 #~ "Do not expect access in the near future. (For the time being, the "
18107 #~ "application is finished with the given range, so the kernel can free "
18108 #~ "resources associated with it.) Subsequent accesses of pages in this "
18109 #~ "range will succeed, but will result either in reloading of the memory "
18110 #~ "contents from the underlying mapped file (see B<mmap>(2)) or zero-fill-"
18111 #~ "on-demand pages for mappings without an underlying file."
18113 #~ "しばらくアクセスはなさそうだ。 (現時点でアプリケーションは与えた範囲の処理"
18114 #~ "を終えている。 したがってカーネルはこれに関連するリソースを解放して良"
18115 #~ "い。) これ以降この範囲のページへのアクセスがあると、 成功はするが、メモ"
18116 #~ "リーの内容をマップ元のファイルからロードし直すことになる (B<mmap>(2) を見"
18117 #~ "よ) か、 または元ファイルがないマップページでは アクセスがあったときに 0 "
18121 #~ "Free up a given range of pages and its associated backing store. "
18122 #~ "Currently, only shmfs/tmpfs supports this; other filesystems return with "
18123 #~ "the error B<ENOSYS>."
18125 #~ "指定された範囲のページと関連するバッキングストアを解放する。 現在のとこ"
18126 #~ "ろ、 shmfs/tmpfs だけがこれに対応している。 他のファイルシステムでは "
18127 #~ "B<ENOSYS> が返される。"
18129 #~ msgid "This error can occur for the following reasons:"
18130 #~ msgstr "このエラーは以下の理由で発生する。"
18132 #~ msgid "The value I<len> is negative."
18133 #~ msgstr "I<len> が負の値である。"
18136 #~ "The application is attempting to release locked or shared pages (with "
18137 #~ "B<MADV_DONTNEED>)."
18139 #~ "アプリケーションがロックされたページや共有ページを (B<MADV_DONTNEED> で) "
18144 #~ "B<MADV_REMOVE>, B<MADV_DONTFORK>, B<MADV_DOFORK>, B<MADV_HWPOISON>, "
18145 #~ "B<MADV_MERGEABLE>, and B<MADV_UNMERGEABLE> are Linux-specific."
18147 #~ "B<MADV_REMOVE>, B<MADV_DONTFORK>, B<MADV_DOFORK>, B<MADV_HWPOISON>,\n"
18148 #~ "B<MADV_MERGEABLE>, B<MADV_UNMERGEABLE> は Linux 固有である。"
18151 #~ "The current Linux implementation (2.4.0) views this system call more as a "
18152 #~ "command than as advice and hence may return an error when it cannot do "
18153 #~ "what it usually would do in response to this advice. (See the ERRORS "
18154 #~ "description above.) This is nonstandard behavior."
18156 #~ "現在の Linux の実装 (2.4.0) では、 このシステムコールをアドバイスというよ"
18157 #~ "りは命令と見ている。 したがってこのアドバイスに対して通常行われる動作が不"
18158 #~ "可能な場合は、 エラーを返すことがある (上記の エラー の記述を参照)。 この"
18161 #~ msgid "2012-05-06"
18162 #~ msgstr "2012-05-06"
18165 #~ "#include E<lt>malloc.hE<gt>\n"
18166 #~ "#include \"tlpi_hdr.h\"\n"
18168 #~ "#include E<lt>malloc.hE<gt>\n"
18169 #~ "#include \"tlpi_hdr.h\"\n"
18171 #~ msgid "2014-06-13"
18172 #~ msgstr "2014-06-13"
18174 #~ msgid "2010-10-13"
18175 #~ msgstr "2010-10-13"
18179 #~ "main(int argc, char *argv[])\n"
18181 #~ " int j, tn, sleepTime;\n"
18182 #~ " pthread_t *thr;\n"
18185 #~ "main(int argc, char *argv[])\n"
18187 #~ " int j, tn, sleepTime;\n"
18188 #~ " pthread_t *thr;\n"
18190 #~ msgid "2014-05-28"
18191 #~ msgstr "2014-05-28"
18194 #~ "This function cannot release free memory located at places other than the "
18195 #~ "top of the heap."
18197 #~ "この関数は、 ヒープの一番上以外の場所にある未使用メモリーを解放することは"
18200 #~ msgid "This function releases only memory in the main arena."
18201 #~ msgstr "この関数はメイン領域のメモリーだけを解放する。"
18203 #~ msgid "The B<malloc_usable_size>() function is thread-safe."
18204 #~ msgstr "B<malloc_usable_size>() 関数はスレッドセーフである。"
18206 #~ msgid "2014-07-08"
18207 #~ msgstr "2014-07-08"
18209 #~ msgid "2014-01-11"
18210 #~ msgstr "2014-01-11"
18212 #~ msgid "2014-04-14"
18213 #~ msgstr "2014-04-14"
18215 #~ msgid "AVAILABILITY"
18218 #~ msgid "Both of these flags are described in POSIX.1-2001."
18219 #~ msgstr "上記の二つのフラグは POSIX.1-2001 で規定されている。"
18221 #~ msgid "Synonym for B<MAP_ANONYMOUS>. Deprecated."
18222 #~ msgstr "B<MAP_ANONYMOUS> の同義語。非推奨。"
18225 #~ "Used for stacks. Indicates to the kernel virtual memory system that the "
18226 #~ "mapping should extend downward in memory."
18228 #~ "スタック用に使用される。マッピングをメモリー内で逆向きに行うことを カーネ"
18229 #~ "ル仮想メモリーシステムに指示する。 (訳注:マッピングは通常はメモリーアドレ"
18230 #~ "スが増加する向きに行うが、 このオプションを指定すると逆向きにマッピングを"
18234 #~ "Lock the pages of the mapped region into memory in the manner of "
18235 #~ "B<mlock>(2). This flag is ignored in older kernels."
18237 #~ "マップされた領域のページを B<mlock>(2) の方法でメモリー内にロックする。 "
18238 #~ "それ以前のカーネルでは、このフラグは無視される。"
18241 #~ "Allocate the mapping at an address suitable for a process or thread "
18242 #~ "stack. This flag is currently a no-op, but is used in the glibc "
18243 #~ "threading implementation so that if some architectures require special "
18244 #~ "treatment for stack allocations, support can later be transparently "
18245 #~ "implemented for glibc."
18247 #~ "プロセスやスレッドのスタックに適したアドレスにマッピングを割り当てる。 現"
18248 #~ "在のところ、このフラグは何もしないが、 glibc のスレッド実装では使用されて"
18249 #~ "いる。 これは、いくつかのアーキテクチャーではスタックの割り当てに関して特"
18250 #~ "別な扱い が必要な場合に、glibc にそのサポートを後で透過的に実装できるよう"
18254 #~ "Some systems document the additional flags B<MAP_AUTOGROW>, "
18255 #~ "B<MAP_AUTORESRV>, B<MAP_COPY>, and B<MAP_LOCAL>."
18257 #~ "いくつかのシステムでは、上記以外にフラグとして B<MAP_AUTOGROW>, "
18258 #~ "B<MAP_AUTORESRV>, B<MAP_COPY>, B<MAP_LOCAL> が規定されている。"
18261 #~ "On success, B<mmap>() returns a pointer to the mapped area. On error, "
18262 #~ "the value B<MAP_FAILED> (that is, I<(void\\ *)\\ -1>) is returned, and "
18263 #~ "I<errno> is set appropriately. On success, B<munmap>() returns 0, on "
18264 #~ "failure -1, and I<errno> is set (probably to B<EINVAL>)."
18266 #~ "B<mmap>() は成功するとマップされた領域へのポインターを返す。 失敗すると"
18267 #~ "値 B<MAP_FAILED> (つまり I<(void\\ *)\\ -1>) を返し、 I<errno> がエラーの"
18268 #~ "内容にしたがってセットされる。 B<munmap>() は成功すると 0 を返す。失敗す"
18269 #~ "ると -1 を返し、 I<errno> がセットされる (多くの場合 B<EINVAL> になるだろ"
18272 #~ msgid "The system limit on the total number of open files has been reached."
18273 #~ msgstr "システム全体でオープンされているファイルの総数が上限に達した。"
18276 #~ "No memory is available, or the process's maximum number of mappings would "
18277 #~ "have been exceeded."
18279 #~ "メモリーに空きがない、または処理中のプロセスのマッピング数が最大数を超過し"
18283 #~ "Attempted access to a portion of the buffer that does not correspond to "
18284 #~ "the file (for example, beyond the end of the file, including the case "
18285 #~ "where another process has truncated the file)."
18287 #~ "バッファーのうち、ファイルに関連づけられていない部分 (例えばファイル末尾を"
18288 #~ "越えた部分など。これには 他のプロセスがファイルを切り詰めた場合なども含ま"
18289 #~ "れる) にアクセスしようとした。"
18291 #~ msgid "SVr4, 4.4BSD, POSIX.1-2001."
18292 #~ msgstr "SVr4, 4.4BSD, POSIX.1-2001."
18294 #~ msgid "2014-02-25"
18295 #~ msgstr "2014-02-25"
18297 #~ msgid "2014-01-05"
18298 #~ msgstr "2014-01-05"
18300 #~ msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
18301 #~ msgstr "B<#define _GNU_SOURCE> /* feature_test_macros(7) 参照 */\n"
18304 #~ "An invalid argument was given. Possible causes are: I<old_address> was "
18305 #~ "not page aligned; a value other than B<MREMAP_MAYMOVE> or B<MREMAP_FIXED> "
18306 #~ "was specified in I<flags>; I<new_size> was zero; I<new_size> or "
18307 #~ "I<new_address> was invalid; or the new address range specified by "
18308 #~ "I<new_address> and I<new_size> overlapped the old address range specified "
18309 #~ "by I<old_address> and I<old_size>; or B<MREMAP_FIXED> was specified "
18310 #~ "without also specifying B<MREMAP_MAYMOVE>."
18312 #~ "不正な引き数が与えられた。 可能性のある原因は以下の通りである: たいていは "
18313 #~ "I<old_address> がページ境界に 合ってない; I<flags> に B<MREMAP_MAYMOVE> ま"
18314 #~ "たは B<MREMAP_FIXED> 以外の値が指定されている; I<new_size> がゼロ; "
18315 #~ "I<new_size> または I<new_address> の値が不正; I<new_address> と "
18316 #~ "I<new_size> で指定される新しいアドレス範囲が I<old_address> と "
18317 #~ "I<old_size> で指定される古いアドレス範囲と重なっている; B<MREMAP_FIXED> が"
18318 #~ "指定されているが B<MREMAP_MAYMOVE> が指定されていない。"
18320 #~ msgid "2014-04-20"
18321 #~ msgstr "2014-04-20"
18324 #~ "The I<flags> argument may have the bits B<MS_ASYNC>, B<MS_SYNC>, and "
18325 #~ "B<MS_INVALIDATE> set, but not both B<MS_ASYNC> and B<MS_SYNC>. "
18326 #~ "B<MS_ASYNC> specifies that an update be scheduled, but the call returns "
18327 #~ "immediately. B<MS_SYNC> asks for an update and waits for it to "
18328 #~ "complete. B<MS_INVALIDATE> asks to invalidate other mappings of the same "
18329 #~ "file (so that they can be updated with the fresh values just written)."
18331 #~ "I<flags> 引数にはビット B<MS_ASYNC>, B<MS_SYNC>, B<MS_INVALIDATE> を設定す"
18332 #~ "ることができるが、 B<MS_ASYNC> と B<MS_SYNC> を同時に指定することはできな"
18333 #~ "い。 B<MS_ASYNC> は更新を予定に組み込むことを表し、呼び出しは直ちに返る。 "
18334 #~ "B<MS_SYNC> は更新を要求し、更新が完了するまで待つ。 B<MS_INVALIDATE> は"
18335 #~ "(たった今書き込んだ新しい値でマッピングを更新することができるように) 同じ"
18336 #~ "ファイルに対する他のマッピングを無効にすることを要求する。"
18338 #~ msgid " mtrace();\n"
18339 #~ msgstr " mtrace();\n"
18341 #~ msgid "The B<posix_fallocate>() function is thread-safe."
18342 #~ msgstr "B<posix_fallocate>() 関数はスレッドセーフである。"
18345 #~ "In the glibc implementation, B<posix_fallocate>() is implemented using "
18346 #~ "B<fallocate>(2)."
18348 #~ "glibc の実装では、 B<posix_fallocate>() は B<fallocate>() を使って実装され"
18351 #~ msgid "2013-09-02"
18352 #~ msgstr "2013-09-02"
18355 #~ "_BSD_SOURCE ||\n"
18356 #~ " (_XOPEN_SOURCE\\ E<gt>=\\ 500 ||\n"
18357 #~ " _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED) &&\n"
18358 #~ " !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600)\n"
18360 #~ "_BSD_SOURCE ||\n"
18361 #~ " (_XOPEN_SOURCE\\ E<gt>=\\ 500 ||\n"
18362 #~ " _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED) &&\n"
18363 #~ " !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600)\n"
18366 #~ "B<Note>: this system call is (since Linux 3.16) deprecated and will "
18367 #~ "eventually be replaced by a slower in-kernel emulation. Those few "
18368 #~ "applications that use this system call should consider migrating to "
18371 #~ "B<注意>: このシステムコールは (Linux 3.16 以降で) 非推奨となっており、 や"
18372 #~ "がてより低速なカーネル内でのエミュレーションに置き換えられる予定である。 "
18373 #~ "このシステムコールを使用しているアプリケーションは少ないが、こうしたアプリ"
18374 #~ "ケーションは代替手段への移行を検討すべきである。"
18376 #~ msgid "The process already has the maximum number of files open."
18377 #~ msgstr "プロセスがオープン可能なファイル数の上限にすでに達していた。"
18380 #~ "The limit on the total number of files open on the system has been "
18382 #~ msgstr "ファイルシステムでオープンできるファイル数の上限に達した。"
18384 #~ msgid "2014-02-07"
18385 #~ msgstr "2014-02-07"
18388 #~ "Write the values of some members of the I<shmid_ds> structure pointed to "
18389 #~ "by I<buf> to the kernel data structure associated with this shared memory "
18390 #~ "segment, updating also its I<shm_ctime> member. The following fields can "
18391 #~ "be changed: I<shm_perm.uid>, I<shm_perm.gid>, and (the least significant "
18392 #~ "9 bits of) I<shm_perm.mode>. The effective UID of the calling process "
18393 #~ "must match the owner (I<shm_perm.uid>) or creator (I<shm_perm.cuid>) of "
18394 #~ "the shared memory segment, or the caller must be privileged."
18396 #~ "I<buf> によって指される I<shmid_ds> 構造体のいくつかのメンバーの値を、 こ"
18397 #~ "の共有メモリーセグメントに関連づけられたカーネルデータ構造体に書き込み、 "
18398 #~ "I<shm_ctime> メンバーも更新する。 以下のフィールドは変更できる。 "
18399 #~ "I<shm_perm.uid>, I<shm_perm.gid>, I<shm_perm.mode> (の最下位 9 ビット)。 "
18400 #~ "呼び出したプロセスの実効 UID が所有者 (I<shm_perm.uid>) または作成者 "
18401 #~ "(I<shm_perm.cuid>) と一致するか、呼び出し元が特権を持たなければならない。"
18403 #~ msgid "SVr4, POSIX.1-2001."
18404 #~ msgstr "SVr4, POSIX.1-2001."
18406 #~ msgid "2015-01-10"
18407 #~ msgstr "2015-01-10"
18409 #~ msgid "2012-07-13"
18410 #~ msgstr "2012-07-13"
18412 #~ msgid "B<#include E<lt>sys/memfd.hE<gt>>"
18413 #~ msgstr "B<#include E<lt>sys/memfd.hE<gt>>"
18416 #~ "An unsupported value was specified in one of the arguments: I<flags> "
18417 #~ "included unknown bits, or I<name> was too long."
18419 #~ "サポートされていない値がいずれかの引き数で指定された。 I<flags> に未知の"
18420 #~ "ビットが含まれていたか、 I<name> が長過ぎた。"
18423 #~ "The B<memfd_create>() system call first appeared in Linux 3.17. Support "
18424 #~ "in the GNU C library is pending."
18426 #~ "B<memfd_create>() システムコールは Linux 3.17 で初めて登場した。 GNU C ラ"
18427 #~ "イブラリでのサポートは検討中である。"
18429 #~ msgid "2015-01-15"
18430 #~ msgstr "2015-01-15"
18433 #~ "B<int s390_pci_mmio_read(unsigned long >I<mmio_addr>B<,>\n"
18434 #~ "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
18436 #~ "B<int s390_pci_mmio_read(unsigned long >I<mmio_addr>B<,>\n"
18437 #~ "B< void *>I<user_buffer>B<, size_t >I<length>B<);>\n"
18439 #~ msgid "System-wide limit on the number of pages of shared memory."
18440 #~ msgstr "共有メモリーのページ数のシステム全体での上限値。"
18443 #~ "Segment low boundary address multiple. Must be page aligned. For the "
18444 #~ "current implementation, the B<SHMLBA> value is B<PAGE_SIZE>."
18446 #~ "セグメントの境界アドレスの最小倍数。ページ境界に合ってなければならない。 "
18447 #~ "現在の実装では B<SHMLBA> の値は B<PAGE_SIZE> である。"
18449 #~ msgid "B<IPC_CREAT | IPC_EXCL> was specified and the segment exists."
18451 #~ "B<IPC_CREAT | IPC_EXCL> が指定されていたが、そのセグメントが既に存在する。"
18454 #~ "Assuming a 4kB page size, this formula yields (since Linux 2.4) the value "
18455 #~ "2^20 (2,097,152)."
18457 #~ "4kB ページサイズと仮定すると、 (Linux 2.4 以降では) この式の結果は 2^20 "
18458 #~ "(2,097,152) になる。"
18461 #~ "Maximum size in bytes for a shared memory segment: policy dependent (on "
18462 #~ "Linux, this limit can be read and modified via I</proc/sys/kernel/"
18465 #~ "共有メモリーセグメントのバイト単位の大きさの上限: 方針依存 (Linux では、こ"
18466 #~ "の上限値は I</proc/sys/kernel/shmmax> 経由で参照したり、変更したりでき"
18470 #~ "System wide maximum number of shared memory segments: implementation "
18471 #~ "dependent (currently 4096, was 128 before Linux 2.3.99; on Linux, this "
18472 #~ "limit can be read and modified via I</proc/sys/kernel/shmmni>)."
18474 #~ "システム全体の共有メモリーの数の上限: 実装依存 (現在は 4096。Linux 2.3.99 "
18475 #~ "より前では 128。 Linux では、この上限値は I</proc/sys/kernel/shmmni> 経由"
18476 #~ "で参照したり、変更したりできる)。"
18479 #~ "A valid segment identifier, I<shmid>, is returned on success, -1 on error."
18481 #~ "成功した場合、有効なセグメント識別子 I<shmid> が返される。エラーの場合、 "
18485 #~ "The ARM architecture needs 64-bit arguments to be aligned in a suitable "
18486 #~ "pair of registers. On this architecture, the call signature of "
18487 #~ "B<posix_fadvise>() is flawed, since it forces a register to be wasted as "
18488 #~ "padding between the I<fd> and I<len> arguments. Therefore, since Linux "
18489 #~ "2.6.14, ARM defines a different system call that orders the arguments "
18492 #~ "ARM アーキテクチャーでは、64 ビットの引き数は適切なレジスターの組に割り当"
18494 #~ "る必要がある。このアーキテクチャーでは、B<posix_fadvise>() の呼び出し方"
18496 #~ "は欠陥があり、それはこのシステムコールでは引き数 I<fd> と I<len> の間の\n"
18497 #~ "パディング (詰めもの) でレジスターが一つ消費されてしまうというものであ"
18499 #~ "そのため、Linux 2.6.14 以降では、ARM では引き数が適切な順序になった別の\n"
18500 #~ "システムコールが定義されている。"
18503 #~ "The behavior of this system call is otherwise exactly the same as "
18504 #~ "B<posix_fadvise>(). No library support is provided for this system call "
18507 #~ "上記の点以外は、このシステムコールの動作は B<posix_fadvise>() と全く\n"
18508 #~ "同じである。このシステムコールに対するライブラリによるサポートは glibc\n"
18512 #~ "The I<mode> is not supported by the file system containing the file "
18513 #~ "referred to by I<fd>."
18515 #~ "I<fd> が参照するファイルを含むファイルシステムが I<mode> をサポートしてい"
18519 #~ "The function B<mtrace>() installs handlers for B<malloc>(3), "
18520 #~ "B<realloc>(3) and B<free>(3). The function B<muntrace>() disables "
18521 #~ "these handlers."
18523 #~ "関数 B<mtrace>() は、 B<malloc>(3), B<realloc>(3), B<free>(3) のハンド"
18524 #~ "ラーを組み込む。 関数 B<muntrace>() はこれらのハンドラーを解除する。"
18527 #~ "The environment variable B<MALLOC_TRACE> defines a file where "
18528 #~ "B<mtrace>() writes its output. This file must be writable to the user "
18529 #~ "or B<mtrace>() will do nothing. If the file is not empty it will be "
18532 #~ "環境変数 B<MALLOC_TRACE> は B<mtrace>() が出力を書き出すファイルを指定す"
18533 #~ "る。 ユーザーが書き込み権限を持つファイルを指定しなければならない。 書き込"
18534 #~ "み権限がない場合、 B<mtrace>() は何もしない。 ファイルが空でない場合、"
18535 #~ "ファイルの元の内容を上書きする。"
18538 #~ "The output of B<mtrace>() will be ASCII but not in a friendly format. "
18539 #~ "So glibc comes with a perl-script called mtrace to make sense of it."
18541 #~ "B<mtrace>() の出力は ASCII 形式だが、人が読みやすいフォーマットではな"
18542 #~ "い。 そこで、glibc には mtrace 出力を分かりやすい形式に変換する perl スク"
18546 #~ "This flag allocates and initializes to zero the disk space within the "
18547 #~ "range specified by I<offset> and I<len>. After a successful call, "
18548 #~ "subsequent writes into this range are guaranteed not to fail because of "
18549 #~ "lack of disk space. Preallocating zeroed blocks beyond the end of the "
18550 #~ "file is useful for optimizing append workloads. Preallocating blocks "
18551 #~ "does not change the file size (as reported by B<stat>(2)) even if it is "
18552 #~ "less than I<offset>+I<len>."
18554 #~ "このフラグは、 I<offset> と I<len> で指定された領域のディスク空間を割り当"
18555 #~ "て、その空間を 0 で初期化する。 呼び出しが成功すると、それに続いてこの領域"
18556 #~ "への書き込みが行われるが、 ディスク空間の不足による書き込み失敗が発生しな"
18557 #~ "いことが保証される。 ファイル末尾より後ろの領域について 0 で埋めたブロック"
18558 #~ "を前もって 割り当てておくことは、追記 (append) の作業負荷を最適化するのに "
18559 #~ "有用である。 ファイルサイズが I<offset>+I<len> よりも小さい場合であって"
18560 #~ "も、ブロックの前もっての割り当てにより (B<stat>(2) が返す) ファイルサイズ"