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: 2015-02-04 23:31+0900\n"
10 "PO-Revision-Date: 2015-01-25 06:45+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: build/C/man3/sem_close.3:26
25 #: build/C/man3/sem_close.3:26 build/C/man3/sem_open.3:26
26 #: build/C/man7/sem_overview.7:26
32 #: build/C/man3/sem_close.3:26 build/C/man3/sem_destroy.3:26
33 #: build/C/man3/sem_getvalue.3:26 build/C/man3/sem_init.3:26
34 #: build/C/man3/sem_open.3:26 build/C/man7/sem_overview.7:26
35 #: build/C/man3/sem_post.3:26 build/C/man3/sem_unlink.3:26
36 #: build/C/man3/sem_wait.3:26 build/C/man2/semctl.2:41
37 #: build/C/man2/semget.2:36 build/C/man2/semop.2:35
43 #: build/C/man3/sem_close.3:26 build/C/man3/sem_destroy.3:26
44 #: build/C/man3/sem_getvalue.3:26 build/C/man3/sem_init.3:26
45 #: build/C/man3/sem_open.3:26 build/C/man7/sem_overview.7:26
46 #: build/C/man3/sem_post.3:26 build/C/man3/sem_unlink.3:26
47 #: build/C/man3/sem_wait.3:26 build/C/man2/semctl.2:41
48 #: build/C/man2/semget.2:36 build/C/man2/semop.2:35
50 msgid "Linux Programmer's Manual"
51 msgstr "Linux Programmer's Manual"
54 #: build/C/man3/sem_close.3:27 build/C/man3/sem_destroy.3:27
55 #: build/C/man3/sem_getvalue.3:27 build/C/man3/sem_init.3:27
56 #: build/C/man3/sem_open.3:27 build/C/man7/sem_overview.7:27
57 #: build/C/man3/sem_post.3:27 build/C/man3/sem_unlink.3:27
58 #: build/C/man3/sem_wait.3:27 build/C/man2/semctl.2:42
59 #: build/C/man2/semget.2:37 build/C/man2/semop.2:36
65 #: build/C/man3/sem_close.3:29
66 msgid "sem_close - close a named semaphore"
67 msgstr "sem_close - 名前付きセマフォをクローズする"
70 #: build/C/man3/sem_close.3:29 build/C/man3/sem_destroy.3:29
71 #: build/C/man3/sem_getvalue.3:29 build/C/man3/sem_init.3:29
72 #: build/C/man3/sem_open.3:29 build/C/man3/sem_post.3:29
73 #: build/C/man3/sem_unlink.3:29 build/C/man3/sem_wait.3:29
74 #: build/C/man2/semctl.2:44 build/C/man2/semget.2:39 build/C/man2/semop.2:38
80 #: build/C/man3/sem_close.3:32 build/C/man3/sem_destroy.3:32
81 #: build/C/man3/sem_getvalue.3:32 build/C/man3/sem_init.3:32
82 #: build/C/man3/sem_post.3:32 build/C/man3/sem_unlink.3:32
83 #: build/C/man3/sem_wait.3:32
85 msgid "B<#include E<lt>semaphore.hE<gt>>\n"
86 msgstr "B<#include E<lt>semaphore.hE<gt>>\n"
89 #: build/C/man3/sem_close.3:34
91 msgid "B<int sem_close(sem_t *>I<sem>B<);>\n"
92 msgstr "B<int sem_close(sem_t *>I<sem>B<);>\n"
95 #: build/C/man3/sem_close.3:37 build/C/man3/sem_destroy.3:37
96 #: build/C/man3/sem_getvalue.3:37 build/C/man3/sem_init.3:37
97 #: build/C/man3/sem_open.3:41 build/C/man3/sem_post.3:37
98 #: build/C/man3/sem_unlink.3:37 build/C/man3/sem_wait.3:41
99 msgid "Link with I<-pthread>."
100 msgstr "I<-pthread> とリンクする。"
103 #: build/C/man3/sem_close.3:37 build/C/man3/sem_destroy.3:37
104 #: build/C/man3/sem_getvalue.3:37 build/C/man3/sem_init.3:37
105 #: build/C/man3/sem_open.3:41 build/C/man7/sem_overview.7:29
106 #: build/C/man3/sem_post.3:37 build/C/man3/sem_unlink.3:37
107 #: build/C/man3/sem_wait.3:49 build/C/man2/semctl.2:52
108 #: build/C/man2/semget.2:49 build/C/man2/semop.2:57
114 #: build/C/man3/sem_close.3:43
116 "B<sem_close>() closes the named semaphore referred to by I<sem>, allowing "
117 "any resources that the system has allocated to the calling process for this "
118 "semaphore to be freed."
120 "B<sem_close>() は I<sem> が参照する名前付きセマフォをクローズし、 このセマ"
121 "フォ用に呼び出し元プロセスにシステムが割り当てていた リソースを解放できるよう"
125 #: build/C/man3/sem_close.3:43 build/C/man3/sem_destroy.3:55
126 #: build/C/man3/sem_getvalue.3:54 build/C/man3/sem_init.3:77
127 #: build/C/man3/sem_open.3:104 build/C/man3/sem_post.3:45
128 #: build/C/man3/sem_unlink.3:44 build/C/man3/sem_wait.3:108
129 #: build/C/man2/semctl.2:340 build/C/man2/semget.2:147
130 #: build/C/man2/semop.2:298
136 #: build/C/man3/sem_close.3:49
138 "On success B<sem_close>() returns 0; on error, -1 is returned, with "
139 "I<errno> set to indicate the error."
141 "成功すると、 B<sem_close>() は 0 を返す。エラーの場合、-1 を返し、 I<errno> "
145 #: build/C/man3/sem_close.3:49 build/C/man3/sem_destroy.3:61
146 #: build/C/man3/sem_getvalue.3:60 build/C/man3/sem_init.3:83
147 #: build/C/man3/sem_open.3:116 build/C/man3/sem_post.3:52
148 #: build/C/man3/sem_unlink.3:50 build/C/man3/sem_wait.3:114
149 #: build/C/man2/semctl.2:387 build/C/man2/semget.2:153
150 #: build/C/man2/semop.2:308
156 #: build/C/man3/sem_close.3:50 build/C/man3/sem_destroy.3:62
157 #: build/C/man3/sem_getvalue.3:61 build/C/man3/sem_init.3:84
158 #: build/C/man3/sem_open.3:132 build/C/man3/sem_open.3:137
159 #: build/C/man3/sem_post.3:53 build/C/man3/sem_wait.3:119
160 #: build/C/man3/sem_wait.3:133 build/C/man2/semctl.2:420
161 #: build/C/man2/semget.2:177 build/C/man2/semget.2:183
162 #: build/C/man2/semop.2:356
168 #: build/C/man3/sem_close.3:54 build/C/man3/sem_destroy.3:66
169 #: build/C/man3/sem_getvalue.3:65 build/C/man3/sem_post.3:57
170 #: build/C/man3/sem_wait.3:123
171 msgid "I<sem> is not a valid semaphore."
172 msgstr "I<sem> は有効なセマフォではない。"
175 #: build/C/man3/sem_close.3:54 build/C/man3/sem_destroy.3:71
176 #: build/C/man3/sem_getvalue.3:70 build/C/man3/sem_init.3:100
177 #: build/C/man3/sem_open.3:170 build/C/man7/sem_overview.7:138
178 #: build/C/man3/sem_post.3:66 build/C/man3/sem_unlink.3:67
179 #: build/C/man3/sem_wait.3:151 build/C/man2/semctl.2:462
180 #: build/C/man2/semget.2:210 build/C/man2/semop.2:386
182 msgid "CONFORMING TO"
186 #: build/C/man3/sem_close.3:56 build/C/man3/sem_destroy.3:73
187 #: build/C/man3/sem_getvalue.3:72 build/C/man3/sem_init.3:102
188 #: build/C/man3/sem_open.3:172 build/C/man7/sem_overview.7:140
189 #: build/C/man3/sem_post.3:68 build/C/man3/sem_unlink.3:69
190 #: build/C/man3/sem_wait.3:153
191 msgid "POSIX.1-2001."
192 msgstr "POSIX.1-2001."
195 #: build/C/man3/sem_close.3:56 build/C/man3/sem_destroy.3:73
196 #: build/C/man3/sem_getvalue.3:72 build/C/man3/sem_init.3:102
197 #: build/C/man7/sem_overview.7:140 build/C/man3/sem_post.3:68
198 #: build/C/man3/sem_wait.3:153 build/C/man2/semctl.2:476
199 #: build/C/man2/semget.2:214 build/C/man2/semop.2:389
205 #: build/C/man3/sem_close.3:60
207 "All open named semaphores are automatically closed on process termination, "
208 "or upon B<execve>(2)."
210 "オープンされたすべての名前付きセマフォは、プロセス終了時、もしくは "
211 "B<execve>(2) 実行時に自動的にクローズされる。"
214 #: build/C/man3/sem_close.3:60 build/C/man3/sem_destroy.3:79
215 #: build/C/man3/sem_getvalue.3:76 build/C/man3/sem_init.3:107
216 #: build/C/man3/sem_open.3:172 build/C/man7/sem_overview.7:152
217 #: build/C/man3/sem_post.3:75 build/C/man3/sem_unlink.3:69
218 #: build/C/man3/sem_wait.3:270 build/C/man2/semctl.2:536
219 #: build/C/man2/semget.2:296 build/C/man2/semop.2:533
225 #: build/C/man3/sem_close.3:67
227 "B<sem_getvalue>(3), B<sem_open>(3), B<sem_post>(3), B<sem_unlink>(3), "
228 "B<sem_wait>(3), B<sem_overview>(7)"
230 "B<sem_getvalue>(3), B<sem_open>(3), B<sem_post>(3), B<sem_unlink>(3), "
231 "B<sem_wait>(3), B<sem_overview>(7)"
234 #: build/C/man3/sem_close.3:67 build/C/man3/sem_destroy.3:84
235 #: build/C/man3/sem_getvalue.3:80 build/C/man3/sem_init.3:112
236 #: build/C/man3/sem_open.3:179 build/C/man7/sem_overview.7:162
237 #: build/C/man3/sem_post.3:79 build/C/man3/sem_unlink.3:75
238 #: build/C/man3/sem_wait.3:276 build/C/man2/semctl.2:543
239 #: build/C/man2/semget.2:303 build/C/man2/semop.2:542
245 #: build/C/man3/sem_close.3:75 build/C/man3/sem_destroy.3:92
246 #: build/C/man3/sem_getvalue.3:88 build/C/man3/sem_init.3:120
247 #: build/C/man3/sem_open.3:187 build/C/man7/sem_overview.7:170
248 #: build/C/man3/sem_post.3:87 build/C/man3/sem_unlink.3:83
249 #: build/C/man3/sem_wait.3:284 build/C/man2/semctl.2:551
250 #: build/C/man2/semget.2:311 build/C/man2/semop.2:550
253 #| "This page is part of release 3.78 of the Linux I<man-pages> project. A "
254 #| "description of the project, information about reporting bugs, and the "
255 #| "latest version of this page, can be found at \\%http://www.kernel.org/doc/"
258 "This page is part of release 3.79 of the Linux I<man-pages> project. A "
259 "description of the project, information about reporting bugs, and the latest "
260 "version of this page, can be found at \\%http://www.kernel.org/doc/man-"
263 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
264 "である。プロジェクトの説明とバグ報告に関する情報は\n"
265 "http://www.kernel.org/doc/man-pages/ に書かれている。"
268 #: build/C/man3/sem_destroy.3:26
274 #: build/C/man3/sem_destroy.3:26 build/C/man3/sem_getvalue.3:26
280 #: build/C/man3/sem_destroy.3:29
281 msgid "sem_destroy - destroy an unnamed semaphore"
282 msgstr "sem_destroy - 名前なしセマフォを破棄する"
285 #: build/C/man3/sem_destroy.3:34
287 msgid "B<int sem_destroy(sem_t *>I<sem>B<);>\n"
288 msgstr "B<int sem_destroy(sem_t *>I<sem>B<);>\n"
291 #: build/C/man3/sem_destroy.3:41
293 "B<sem_destroy>() destroys the unnamed semaphore at the address pointed to "
296 "B<sem_destroy>() は I<sem> が指すアドレスにある名前なしセマフォを破棄する。"
299 #: build/C/man3/sem_destroy.3:46
301 "Only a semaphore that has been initialized by B<sem_init>(3) should be "
302 "destroyed using B<sem_destroy>()."
304 "B<sem_destroy>() を使って破棄するのは、 B<sem_init>(3) で初期化したセマフォ"
308 #: build/C/man3/sem_destroy.3:51
310 "Destroying a semaphore that other processes or threads are currently blocked "
311 "on (in B<sem_wait>(3)) produces undefined behavior."
313 "他のプロセスやスレッドが (B<sem_wait>(3) で) 待ち状態になっているセマフォを"
314 "破棄した場合の挙動は定義されていない。"
317 #: build/C/man3/sem_destroy.3:55
319 "Using a semaphore that has been destroyed produces undefined results, until "
320 "the semaphore has been reinitialized using B<sem_init>(3)."
322 "すでに破棄されたセマフォを、 B<sem_init>(3) を使って再初期化される前に使用し"
326 #: build/C/man3/sem_destroy.3:61
328 "B<sem_destroy>() returns 0 on success; on error, -1 is returned, and "
329 "I<errno> is set to indicate the error."
331 "成功すると、 B<sem_destroy>() は 0 を返す。エラーの場合、-1 を返し、 "
332 "I<errno> にエラーを示す値をセットする。"
335 #: build/C/man3/sem_destroy.3:66 build/C/man3/sem_getvalue.3:65
336 #: build/C/man3/sem_init.3:95 build/C/man3/sem_post.3:61
337 #: build/C/man3/sem_unlink.3:62 build/C/man3/sem_wait.3:143
343 #: build/C/man3/sem_destroy.3:67 build/C/man3/sem_getvalue.3:66
344 #: build/C/man3/sem_init.3:96 build/C/man3/sem_post.3:62
345 #: build/C/man3/sem_unlink.3:63 build/C/man3/sem_wait.3:144
347 msgid "Multithreading (see pthreads(7))"
348 msgstr "マルチスレッディング (pthreads(7) 参照)"
351 #: build/C/man3/sem_destroy.3:71
352 msgid "The B<sem_destroy>() function is thread-safe."
353 msgstr "B<sem_destroy>() 関数はスレッドセーフである。"
355 #. But not on NPTL, where sem_destroy () is a no-op..
357 #: build/C/man3/sem_destroy.3:79
359 "An unnamed semaphore should be destroyed with B<sem_destroy>() before the "
360 "memory in which it is located is deallocated. Failure to do this can result "
361 "in resource leaks on some implementations."
363 "名前なしセマフォは、そのセマフォが置かれているメモリーが解放される前に、 "
364 "B<sem_destroy>() を使って破棄しておくべきである。これを行わなかった場合、実"
365 "装によっては リソースのリークが起こりえる。"
368 #: build/C/man3/sem_destroy.3:84
369 msgid "B<sem_init>(3), B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
370 msgstr "B<sem_init>(3), B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
373 #: build/C/man3/sem_getvalue.3:26
376 msgstr "SEM_GETVALUE"
379 #: build/C/man3/sem_getvalue.3:29
380 msgid "sem_getvalue - get the value of a semaphore"
381 msgstr "sem_getvalue - セマフォの値を取得する"
384 #: build/C/man3/sem_getvalue.3:34
386 msgid "B<int sem_getvalue(sem_t *>I<sem>B<, int *>I<sval>B<);>\n"
387 msgstr "B<int sem_getvalue(sem_t *>I<sem>B<, int *>I<sval>B<);>\n"
390 #: build/C/man3/sem_getvalue.3:43
392 "B<sem_getvalue>() places the current value of the semaphore pointed to "
393 "I<sem> into the integer pointed to by I<sval>."
395 "B<sem_getvalue>() は、 I<sem> が指すセマフォの現在の値を I<sval> で指す整数"
399 #: build/C/man3/sem_getvalue.3:54
401 "If one or more processes or threads are blocked waiting to lock the "
402 "semaphore with B<sem_wait>(3), POSIX.1-2001 permits two possibilities for "
403 "the value returned in I<sval>: either 0 is returned; or a negative number "
404 "whose absolute value is the count of the number of processes and threads "
405 "currently blocked in B<sem_wait>(3). Linux adopts the former behavior."
407 "POSIX.1-2001 によると、 1つ以上のプロセスかスレッドが B<sem_wait>(3) でセマ"
408 "フォのロック待ちで停止している場合、 I<sval> で返される値は 0 もしくは負の値"
409 "のいずれかとなる。 負の値の場合、その絶対値は B<sem_wait>(3) で現在停止して"
410 "いるプロセスかスレッドの合計数に等しい。 Linux は前者の動作 (0 を返す動作) を"
414 #: build/C/man3/sem_getvalue.3:60
416 "B<sem_getvalue>() returns 0 on success; on error, -1 is returned and "
417 "I<errno> is set to indicate the error."
419 "成功すると、 B<sem_getvalue>() は 0 を返す。エラーの場合、-1 を返し、 "
420 "I<errno> にエラーを示す値をセットする。"
423 #: build/C/man3/sem_getvalue.3:70
424 msgid "The B<sem_getvalue>() function is thread-safe."
425 msgstr "B<sem_getvalue>() 関数はスレッドセーフである。"
428 #: build/C/man3/sem_getvalue.3:76
430 "The value of the semaphore may already have changed by the time "
431 "B<sem_getvalue>() returns."
433 "B<sem_getvalue>() が返るときには、すでにセマフォの値は変化している可能性があ"
437 #: build/C/man3/sem_getvalue.3:80
438 msgid "B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
439 msgstr "B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
442 #: build/C/man3/sem_init.3:26
448 #: build/C/man3/sem_init.3:26
454 #: build/C/man3/sem_init.3:29
455 msgid "sem_init - initialize an unnamed semaphore"
456 msgstr "sem_init - 名前なしセマフォを初期化する"
459 #: build/C/man3/sem_init.3:34
461 msgid "B<int sem_init(sem_t *>I<sem>B<, int >I<pshared>B<, unsigned int >I<value>B<);>\n"
462 msgstr "B<int sem_init(sem_t *>I<sem>B<, int >I<pshared>B<, unsigned int >I<value>B<);>\n"
465 #: build/C/man3/sem_init.3:44
467 "B<sem_init>() initializes the unnamed semaphore at the address pointed to "
468 "by I<sem>. The I<value> argument specifies the initial value for the "
471 "B<sem_init>() は、 I<sem> が指すアドレスにある名前なしセマフォを初期化す"
472 "る。 I<value> 引き数はそのセマフォの初期値を指定する。"
475 #: build/C/man3/sem_init.3:49
477 "The I<pshared> argument indicates whether this semaphore is to be shared "
478 "between the threads of a process, or between processes."
480 "I<pshared> 引き数は、このセマフォがプロセス内のスレッド間で共有されるのか、 "
484 #: build/C/man3/sem_init.3:57
486 "If I<pshared> has the value 0, then the semaphore is shared between the "
487 "threads of a process, and should be located at some address that is visible "
488 "to all threads (e.g., a global variable, or a variable allocated dynamically "
491 "I<pshared> が 0 の場合、セマフォはプロセス内のスレッド間で共有される。 セマ"
492 "フォはすべてのスレッドから参照可能なアドレスに配置すべきである (例えば、大域"
493 "変数や、ヒープ上に動的に割り当てられた変数など)。"
496 #: build/C/man3/sem_init.3:74
498 "If I<pshared> is nonzero, then the semaphore is shared between processes, "
499 "and should be located in a region of shared memory (see B<shm_open>(3), "
500 "B<mmap>(2), and B<shmget>(2)). (Since a child created by B<fork>(2) "
501 "inherits its parent's memory mappings, it can also access the semaphore.) "
502 "Any process that can access the shared memory region can operate on the "
503 "semaphore using B<sem_post>(3), B<sem_wait>(3), and so on."
505 "I<pshared> が 0 以外の場合、セマフォはプロセス間で共有される。セマフォは 共有"
506 "メモリー領域に配置すべきである (B<shm_open>(3), B<mmap>(2), B<shmget>(2) 参"
507 "照)。 (B<fork>(2) で生成された子プロセスは親プロセスのメモリーマッピングを継"
508 "承するため、 子プロセスもセマフォにアクセスできる。) 共有メモリー領域にアク"
509 "セスできるプロセスならば、どのプロセスでも B<sem_post>(3) や "
510 "B<sem_wait>(3) などを使ってセマフォを操作できる。"
513 #: build/C/man3/sem_init.3:77
515 "Initializing a semaphore that has already been initialized results in "
516 "undefined behavior."
517 msgstr "すでに初期化済のセマフォを初期化した場合の挙動は定義されていない。"
520 #: build/C/man3/sem_init.3:83
522 "B<sem_init>() returns 0 on success; on error, -1 is returned, and I<errno> "
523 "is set to indicate the error."
525 "成功すると、 B<sem_init>() は 0 を返す。エラーの場合、-1 を返し、 I<errno> "
529 #: build/C/man3/sem_init.3:89
530 msgid "I<value> exceeds B<SEM_VALUE_MAX>."
531 msgstr "I<value> が B<SEM_VALUE_MAX> を超えている。"
534 #: build/C/man3/sem_init.3:89
540 #: build/C/man3/sem_init.3:95
542 "I<pshared> is nonzero, but the system does not support process-shared "
543 "semaphores (see B<sem_overview>(7))."
545 "I<pshared> が 0 以外だが、システムがプロセス共有セマフォをサポートしていない "
546 "(B<sem_overview>(7) 参照)。"
549 #: build/C/man3/sem_init.3:100
550 msgid "The B<sem_init>() function is thread-safe."
551 msgstr "B<sem_init>() 関数はスレッドセーフである。"
554 #: build/C/man3/sem_init.3:107
556 "Bizarrely, POSIX.1-2001 does not specify the value that should be returned "
557 "by a successful call to B<sem_init>(). POSIX.1-2008 rectifies this, "
558 "specifying the zero return on success."
560 "妙なことに、POSIX.1-2001 は B<sem_init>() が成功した場合に返すべき値を規定し"
561 "ていない。 POSIX.1-2008 ではこれが修正され、成功時には 0 を返すことが規定され"
565 #: build/C/man3/sem_init.3:112
566 msgid "B<sem_destroy>(3), B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
567 msgstr "B<sem_destroy>(3), B<sem_post>(3), B<sem_wait>(3), B<sem_overview>(7)"
570 #: build/C/man3/sem_open.3:26
576 #: build/C/man3/sem_open.3:29
577 msgid "sem_open - initialize and open a named semaphore"
578 msgstr "sem_open - 名前付きセマフォを初期化し、オープンする"
581 #: build/C/man3/sem_open.3:34
584 "B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n"
585 "B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n"
586 "B<#include E<lt>semaphore.hE<gt>>\n"
588 "B<#include E<lt>fcntl.hE<gt>> /* For O_* constants */\n"
589 "B<#include E<lt>sys/stat.hE<gt>> /* For mode constants */\n"
590 "B<#include E<lt>semaphore.hE<gt>>\n"
593 #: build/C/man3/sem_open.3:38
596 "B<sem_t *sem_open(const char *>I<name>B<, int >I<oflag>B<);>\n"
597 "B<sem_t *sem_open(const char *>I<name>B<, int >I<oflag>B<, >\n"
598 "B< mode_t >I<mode>B<, unsigned int >I<value>B<);>\n"
600 "B<sem_t *sem_open(const char *>I<name>B<, int >I<oflag>B<);>\n"
601 "B<sem_t *sem_open(const char *>I<name>B<, int >I<oflag>B<, >\n"
602 "B< mode_t >I<mode>B<, unsigned int >I<value>B<);>\n"
605 #: build/C/man3/sem_open.3:50
607 "B<sem_open>() creates a new POSIX semaphore or opens an existing "
608 "semaphore. The semaphore is identified by I<name>. For details of the "
609 "construction of I<name>, see B<sem_overview>(7)."
611 "B<sem_open>() は、新規の POSIX セマフォを作成するか、既存のセマフォのオープ"
612 "ンを行う。 セマフォは I<name> で識別される。 I<name> の構成の詳細は "
613 "B<sem_overview>(7) を参照。"
615 #. In reality the filesystem IDs are used on Linux.
617 #: build/C/man3/sem_open.3:76
619 "The I<oflag> argument specifies flags that control the operation of the "
620 "call. (Definitions of the flags values can be obtained by including "
621 "I<E<lt>fcntl.hE<gt>>.) If B<O_CREAT> is specified in I<oflag>, then the "
622 "semaphore is created if it does not already exist. The owner (user ID) of "
623 "the semaphore is set to the effective user ID of the calling process. The "
624 "group ownership (group ID) is set to the effective group ID of the calling "
625 "process. If both B<O_CREAT> and B<O_EXCL> are specified in I<oflag>, then "
626 "an error is returned if a semaphore with the given I<name> already exists."
628 "I<oflag> 引き数には、 B<sem_open>() の動作を制御するフラグを指定する (oflag "
629 "の値の定義は I<E<lt>fcntl.hE<gt>> のインクルードにより得られる)。 I<oflag> "
630 "に B<O_CREAT> が指定されると、まだ存在しない場合にはそのセマフォが作成され"
631 "る。 セマフォの所有者 (ユーザー ID)、グループ所有権 (グループ ID) には、 それ"
632 "ぞれ呼び出し元プロセスの実効 UID、実効 GID が設定される。 I<oflag> に "
633 "B<O_CREAT> と B<O_EXCL> の両方が指定された場合、指定された名前 I<name> のセマ"
634 "フォがすでに存在するとエラーが返される。"
637 #: build/C/man3/sem_open.3:104
639 "If B<O_CREAT> is specified in I<oflag>, then two additional arguments must "
640 "be supplied. The I<mode> argument specifies the permissions to be placed on "
641 "the new semaphore, as for B<open>(2). (Symbolic definitions for the "
642 "permissions bits can be obtained by including I<E<lt>sys/stat.hE<gt>>.) The "
643 "permissions settings are masked against the process umask. Both read and "
644 "write permission should be granted to each class of user that will access "
645 "the semaphore. The I<value> argument specifies the initial value for the "
646 "new semaphore. If B<O_CREAT> is specified, and a semaphore with the given "
647 "I<name> already exists, then I<mode> and I<value> are ignored."
649 "I<oflag> に B<O_CREAT> を指定する場合、さらに引き数が 2 つ必要である。 "
650 "I<mode> 引き数は、 B<open>(2) と同じように、新しいセマフォに設定されるアクセ"
651 "ス許可 (permission) を 指定する。許可設定はプロセスの umask でマスクされる "
652 "(許可ビットのシンボル定義は I<E<lt>sys/stat.hE<gt>> のインクルードにより得ら"
653 "れる)。 セマフォにアクセスしようとするユーザーは、読み出し許可と書き込み許可"
654 "の 両方を得る必要がある。 I<value> 引き数は新しいセマフォの初期値を指定す"
655 "る。 B<O_CREAT> が指定され、指定した名前 I<name> のセマフォがすでに存在する場"
656 "合、 I<mode> と I<value> は無視される。"
659 #: build/C/man3/sem_open.3:116
661 "On success, B<sem_open>() returns the address of the new semaphore; this "
662 "address is used when calling other semaphore-related functions. On error, "
663 "B<sem_open>() returns B<SEM_FAILED>, with I<errno> set to indicate the "
666 "成功すると、 B<sem_open>() は新しいセマフォのアドレスを返す。 このアドレスは"
667 "他のセマフォ関連の関数を呼び出す際に使用される。 エラーの場合、 "
668 "B<sem_open>() は B<SEM_FAILED> を返し、 I<errno> にエラーを示す値をセットす"
672 #: build/C/man3/sem_open.3:117 build/C/man3/sem_unlink.3:51
673 #: build/C/man2/semctl.2:391 build/C/man2/semget.2:157
674 #: build/C/man2/semop.2:320
680 #: build/C/man3/sem_open.3:121
682 "The semaphore exists, but the caller does not have permission to open it."
684 "そのセマフォが存在するが、呼び出し元にはそのセマフォをオープンする 許可がな"
688 #: build/C/man3/sem_open.3:121 build/C/man2/semget.2:165
694 #: build/C/man3/sem_open.3:132
696 "Both B<O_CREAT> and B<O_EXCL> were specified in I<oflag>, but a semaphore "
697 "with this I<name> already exists."
699 "I<oflag> に B<O_CREAT> と B<O_EXCL> の両方が指定されたが、 I<name> という名前"
703 #: build/C/man3/sem_open.3:137
704 msgid "I<value> was greater than B<SEM_VALUE_MAX>."
705 msgstr "I<value> が B<SEM_VALUE_MAX> よりも大きい。"
708 #: build/C/man3/sem_open.3:141
709 msgid "I<name> consists of just \"/\", followed by no other characters."
711 "I<name> が \"/\" だけで構成され、その後ろに他の文字が続いていなかった。"
714 #: build/C/man3/sem_open.3:141
720 #: build/C/man3/sem_open.3:144
721 msgid "The process already has the maximum number of files and open."
722 msgstr "オープンされたファイル数がすでにそのプロセスにおける上限に達している。"
725 #: build/C/man3/sem_open.3:144 build/C/man3/sem_unlink.3:54
727 msgid "B<ENAMETOOLONG>"
728 msgstr "B<ENAMETOOLONG>"
731 #: build/C/man3/sem_open.3:148 build/C/man3/sem_unlink.3:58
732 msgid "I<name> was too long."
733 msgstr "I<name> が長すぎる。"
736 #: build/C/man3/sem_open.3:148
742 #: build/C/man3/sem_open.3:151
743 msgid "The system limit on the total number of open files has been reached."
744 msgstr "オープンされたファイル総数がシステム全体での上限に達している。"
747 #: build/C/man3/sem_open.3:151 build/C/man3/sem_unlink.3:58
748 #: build/C/man2/semget.2:190
753 #. this error can occur if we have a name of the (nonportable) form
754 #. /dir/name, and the directory /dev/shm/dir does not exist.
756 #: build/C/man3/sem_open.3:167
758 "The B<O_CREAT> flag was not specified in I<oflag> and no semaphore with this "
759 "I<name> exists; or, B<O_CREAT> was specified, but I<name> wasn't well formed."
761 "I<oflag> に B<O_CREAT> フラグが指定されておらず、 I<name> という名前のセマ"
762 "フォも存在しない。 または、 B<O_CREAT> が指定されたが、 I<name> が適切な形式"
766 #: build/C/man3/sem_open.3:167 build/C/man2/semget.2:198
767 #: build/C/man2/semop.2:363
773 #: build/C/man3/sem_open.3:170
774 msgid "Insufficient memory."
778 #: build/C/man3/sem_open.3:179
780 "B<sem_close>(3), B<sem_getvalue>(3), B<sem_post>(3), B<sem_unlink>(3), "
781 "B<sem_wait>(3), B<sem_overview>(7)"
783 "B<sem_close>(3), B<sem_getvalue>(3), B<sem_post>(3), B<sem_unlink>(3), "
784 "B<sem_wait>(3), B<sem_overview>(7)"
787 #: build/C/man7/sem_overview.7:26
790 msgstr "SEM_OVERVIEW"
793 #: build/C/man7/sem_overview.7:29
794 msgid "sem_overview - overview of POSIX semaphores"
795 msgstr "sem_overview - POSIX セマフォの概要"
798 #: build/C/man7/sem_overview.7:31
800 "POSIX semaphores allow processes and threads to synchronize their actions."
802 "POSIX セマフォを使用すると、プロセスやスレッド間でその動作を 同期させることが"
806 #: build/C/man7/sem_overview.7:41
808 "A semaphore is an integer whose value is never allowed to fall below zero. "
809 "Two operations can be performed on semaphores: increment the semaphore value "
810 "by one (B<sem_post>(3)); and decrement the semaphore value by one "
811 "(B<sem_wait>(3)). If the value of a semaphore is currently zero, then a "
812 "B<sem_wait>(3) operation will block until the value becomes greater than "
815 "セマフォは整数であり、その値は決して 0 未満になることは許されない。 セマフォ"
816 "に対してできる操作は 2 つである: セマフォ値を 1 増やす (B<sem_post>(3)); セマ"
817 "フォ値を 1 減らす (B<sem_wait>(3))。 セマフォの値がすでに 0 の場合、セマフォ"
818 "値が 0 より大きくなるまで B<sem_wait>(3) 操作は停止 (block) する。"
821 #: build/C/man7/sem_overview.7:44
823 "POSIX semaphores come in two forms: named semaphores and unnamed semaphores."
825 "POSIX セマフォには、名前付きセマフォ (named semaphore) と 名前なしセマフォ "
826 "(unnamed semaphore) の 2つの形がある。"
829 #: build/C/man7/sem_overview.7:44
831 msgid "B<Named semaphores>"
834 #. glibc allows the initial slash to be omitted, and makes
835 #. multiple initial slashes equivalent to a single slash.
836 #. This differs from the implementation of POSIX message queues.
837 #. glibc allows subdirectory components in the name, in which
838 #. case the subdirectory tree must exist under /dev/shm, and
839 #. the fist subdirectory component must exist as the name
840 #. sem.name, and all of the subdirectory components must allow the
841 #. required permissions if a user wants to create a semaphore
842 #. object in a subdirectory.
844 #: build/C/man7/sem_overview.7:64
846 "A named semaphore is identified by a name of the form I</somename>; that is, "
847 "a null-terminated string of up to B<NAME_MAX>I<-4> (i.e., 251) characters "
848 "consisting of an initial slash, followed by one or more characters, none of "
849 "which are slashes. Two processes can operate on the same named semaphore by "
850 "passing the same name to B<sem_open>(3)."
852 "名前付きセマフォは I</somename> という形式の名前で識別される。 その名前は、最"
853 "大で B<NAME_MAX>I<-4> (すなわち 251) 文字のヌル終端された文字列で、 スラッ"
854 "シュで始まり、スラッシュ以外の文字が 1 文字以上続く形式である。 "
855 "B<sem_open>(3) に同じ名前を渡すことにより、2 つのプロセス間で同じ名前のセマ"
859 #: build/C/man7/sem_overview.7:79
861 "The B<sem_open>(3) function creates a new named semaphore or opens an "
862 "existing named semaphore. After the semaphore has been opened, it can be "
863 "operated on using B<sem_post>(3) and B<sem_wait>(3). When a process has "
864 "finished using the semaphore, it can use B<sem_close>(3) to close the "
865 "semaphore. When all processes have finished using the semaphore, it can be "
866 "removed from the system using B<sem_unlink>(3)."
868 "B<sem_open>(3) 関数は、新しい名前付きセマフォを作成するか、既に存在する名前"
869 "付き セマフォをオープンする。 セマフォをオープンした後は、 B<sem_post>(3) "
870 "と B<sem_wait>(3) を使ってセマフォを操作できる。 プロセスがセマフォの使用を"
871 "終えた際は、 B<sem_close>(3) を使ってセマフォをクローズできる。 あるセマフォ"
872 "をどのプロセスも使用しなくなると、 B<sem_unlink>(3) を使ってそのセマフォをシ"
876 #: build/C/man7/sem_overview.7:79
878 msgid "B<Unnamed semaphores (memory-based semaphores)>"
879 msgstr "B<名前なしセマフォ (メモリーベースセマフォ)>"
882 #: build/C/man7/sem_overview.7:94
884 "An unnamed semaphore does not have a name. Instead the semaphore is placed "
885 "in a region of memory that is shared between multiple threads (a I<thread-"
886 "shared semaphore>) or processes (a I<process-shared semaphore>). A thread-"
887 "shared semaphore is placed in an area of memory shared between the threads "
888 "of a process, for example, a global variable. A process-shared semaphore "
889 "must be placed in a shared memory region (e.g., a System V shared memory "
890 "segment created using B<shmget>(2), or a POSIX shared memory object built "
891 "created using B<shm_open>(3))."
893 "名前なしセマフォは名前を持たない。その代わり、セマフォは、 複数スレッド間で共"
894 "有されるメモリー領域、もしくは複数プロセス間で 共有されたメモリー領域に置かれ"
895 "る (前者を I<スレッド共有セマフォ (thread-shared semaphore)>、 後者を I<プロ"
896 "セス共有セマフォ (process-shared semaphore)> と呼ぶ)。スレッド共有セマフォ"
897 "は、同じプロセス内のスレッド間で共有される メモリー領域、例えば大域変数 "
898 "(global variable) に配置される。 プロセス共有セマフォは、共有メモリー領域 (例"
899 "えば、 B<shmget>(2) を使って作成できる System V 共有メモリーセグメントや "
900 "B<shm_open>(3) を使って作成できる POSIX 共有メモリーオブジェクト) 内に配置"
904 #: build/C/man7/sem_overview.7:105
906 "Before being used, an unnamed semaphore must be initialized using "
907 "B<sem_init>(3). It can then be operated on using B<sem_post>(3) and "
908 "B<sem_wait>(3). When the semaphore is no longer required, and before the "
909 "memory in which it is located is deallocated, the semaphore should be "
910 "destroyed using B<sem_destroy>(3)."
912 "名前なしセマフォは、使用する前に B<sem_init>(3) を使って初期化しなければなら"
913 "ない。 セマフォは B<sem_post>(3) と B<sem_wait>(3) を使って操作できる。 セ"
914 "マフォがもはや必要なくなったときや、 セマフォが置かれているメモリーを解放する"
915 "前には、 B<sem_destroy>(3) を使ってセマフォを破棄すべきである。"
918 #: build/C/man7/sem_overview.7:108
920 "The remainder of this section describes some specific details of the Linux "
921 "implementation of POSIX semaphores."
923 "この節の残りでは、POSIX セマフォの Linux の実装の詳細 について説明する。"
926 #: build/C/man7/sem_overview.7:108
932 #: build/C/man7/sem_overview.7:114
934 "Prior to kernel 2.6, Linux supported only unnamed, thread-shared "
935 "semaphores. On a system with Linux 2.6 and a glibc that provides the NPTL "
936 "threading implementation, a complete implementation of POSIX semaphores is "
939 "バージョン 2.6 より前のカーネルでは、Linux は 名前なしのスレッド共有セマフォ"
940 "のみをサポートしていた。 Linux 2.6 と NPTL スレッド実装を提供している glibc "
941 "が入った システムでは、POSIX セマフォの完全な実装が提供される。"
944 #: build/C/man7/sem_overview.7:114
950 #: build/C/man7/sem_overview.7:119
952 "POSIX named semaphores have kernel persistence: if not removed by "
953 "B<sem_unlink>(3), a semaphore will exist until the system is shut down."
955 "POSIX 名前付きセマフォはカーネル内で保持される。 B<sem_unlink>(3) で削除され"
956 "なければ、セマフォは システムがシャットダウンされるまで存在し続ける。"
959 #: build/C/man7/sem_overview.7:119
965 #: build/C/man7/sem_overview.7:124
967 "Programs using the POSIX semaphores API must be compiled with I<cc -pthread> "
968 "to link against the real-time library, I<librt>."
970 "POSIX セマフォ API を使用したプログラムは I<cc -pthread> でコンパイルし、リア"
971 "ルタイムライブラリ I<librt> とリンクしなければならない。"
974 #: build/C/man7/sem_overview.7:124
976 msgid "Accessing named semaphores via the filesystem"
977 msgstr "ファイルシステム経由での名前付きセマフォへのアクセス"
980 #: build/C/man7/sem_overview.7:135
982 "On Linux, named semaphores are created in a virtual filesystem, normally "
983 "mounted under I</dev/shm>, with names of the form B<sem.>I<somename>. (This "
984 "is the reason that semaphore names are limited to B<NAME_MAX>I<-4> rather "
985 "than B<NAME_MAX> characters.)"
987 "Linux では、名前付きセマフォは仮想ファイルシステム (virtual file system) 内"
988 "に B<sem.>I<somename> という形の名前で作成される。仮想ファイルシステムは通常 "
989 "I</dev/shm> 以下にマウントされる。 (これが、セマフォの名前の文字数の上限が "
990 "B<NAME_MAX> ではなく B<NAME_MAX>I<-4> となっている理由である。)"
993 #: build/C/man7/sem_overview.7:138
995 "Since Linux 2.6.19, ACLs can be placed on files under this directory, to "
996 "control object permissions on a per-user and per-group basis."
998 "Linux 2.6.19 以降では、このディレクトリ配下のファイルに対して ACL を 設定で"
999 "き、オブジェクトへの許可をユーザー単位、グループ単位で制御することが できる。"
1002 #: build/C/man7/sem_overview.7:149
1004 "System V semaphores (B<semget>(2), B<semop>(2), etc.) are an older semaphore "
1005 "API. POSIX semaphores provide a simpler, and better designed interface than "
1006 "System V semaphores; on the other hand POSIX semaphores are less widely "
1007 "available (especially on older systems) than System V semaphores."
1009 "System V セマフォ (B<semget>(2), B<semop>(2) など) は古いセマフォ API であ"
1010 "る。 POSIX セマフォは System V よりも 簡単で、うまく設計されたインターフェー"
1011 "スを提供している。 一方で、POSIX セマフォは System V セマフォと比べると 利用"
1012 "できるシステムが少ない (特に、古いシステムでは少ない)。"
1015 #: build/C/man7/sem_overview.7:149 build/C/man3/sem_post.3:72
1016 #: build/C/man3/sem_wait.3:161 build/C/man2/semop.2:508
1022 #: build/C/man7/sem_overview.7:152
1024 "An example of the use of various POSIX semaphore functions is shown in "
1027 "各種の POSIX セマフォ関数を使用した例が B<sem_wait>(3) に記載されている。"
1030 #: build/C/man7/sem_overview.7:162
1032 "B<sem_close>(3), B<sem_destroy>(3), B<sem_getvalue>(3), B<sem_init>(3), "
1033 "B<sem_open>(3), B<sem_post>(3), B<sem_unlink>(3), B<sem_wait>(3), "
1036 "B<sem_close>(3), B<sem_destroy>(3), B<sem_getvalue>(3), B<sem_init>(3), "
1037 "B<sem_open>(3), B<sem_post>(3), B<sem_unlink>(3), B<sem_wait>(3), "
1041 #: build/C/man3/sem_post.3:26
1047 #: build/C/man3/sem_post.3:26 build/C/man3/sem_unlink.3:26
1048 #: build/C/man3/sem_wait.3:26
1054 #: build/C/man3/sem_post.3:29
1055 msgid "sem_post - unlock a semaphore"
1056 msgstr "sem_post - セマフォのロックを解除する"
1059 #: build/C/man3/sem_post.3:34
1061 msgid "B<int sem_post(sem_t *>I<sem>B<);>\n"
1062 msgstr "B<int sem_post(sem_t *>I<sem>B<);>\n"
1065 #: build/C/man3/sem_post.3:45
1067 "B<sem_post>() increments (unlocks) the semaphore pointed to by I<sem>. If "
1068 "the semaphore's value consequently becomes greater than zero, then another "
1069 "process or thread blocked in a B<sem_wait>(3) call will be woken up and "
1070 "proceed to lock the semaphore."
1072 "B<sem_post>() は、 I<sem> が指すセマフォの値を 1 増やす (ロックを解除する)。"
1073 "その結果、 セマフォの値は 0 より大きな値に変化し、 B<sem_wait>(3) で停止して"
1074 "いる別のプロセスやスレッドが呼び起こされ、 セマフォをロックできるようになる。"
1077 #: build/C/man3/sem_post.3:52
1079 "B<sem_post>() returns 0 on success; on error, the value of the semaphore is "
1080 "left unchanged, -1 is returned, and I<errno> is set to indicate the error."
1082 "成功すると、 B<sem_post>() は 0 を返す。エラーの場合、セマフォの値は変更せず"
1083 "に、 -1 を返し、 I<errno> にエラーを示す値をセットする。"
1086 #: build/C/man3/sem_post.3:57
1088 msgid "B<EOVERFLOW>"
1089 msgstr "B<EOVERFLOW>"
1091 #. Added in POSIX.1-2008 TC1 (Austin Interpretation 213)
1093 #: build/C/man3/sem_post.3:61
1094 msgid "The maximum allowable value for a semaphore would be exceeded."
1095 msgstr "一つのセマフォで使用できる最大値を超えてしまうところであった。"
1098 #: build/C/man3/sem_post.3:66
1099 msgid "The B<sem_post>() function is thread-safe."
1100 msgstr "B<sem_post>() 関数はスレッドセーフである。"
1103 #: build/C/man3/sem_post.3:72
1105 "B<sem_post>() is async-signal-safe: it may be safely called within a signal "
1108 "B<sem_post>() は async-signal-safe である。 つまり、シグナルハンドラーの中で"
1112 #: build/C/man3/sem_post.3:75
1113 msgid "See B<sem_wait>(3)."
1114 msgstr "B<sem_wait>(3) 参照。"
1117 #: build/C/man3/sem_post.3:79
1118 msgid "B<sem_getvalue>(3), B<sem_wait>(3), B<sem_overview>(7)"
1119 msgstr "B<sem_getvalue>(3), B<sem_wait>(3), B<sem_overview>(7)"
1122 #: build/C/man3/sem_unlink.3:26
1128 #: build/C/man3/sem_unlink.3:29
1129 msgid "sem_unlink - remove a named semaphore"
1130 msgstr "sem_unlink - 名前付きセマフォを削除する"
1133 #: build/C/man3/sem_unlink.3:34
1135 msgid "B<int sem_unlink(const char *>I<name>B<);>\n"
1136 msgstr "B<int sem_unlink(const char *>I<name>B<);>\n"
1139 #: build/C/man3/sem_unlink.3:44
1141 "B<sem_unlink>() removes the named semaphore referred to by I<name>. The "
1142 "semaphore name is removed immediately. The semaphore is destroyed once all "
1143 "other processes that have the semaphore open close it."
1145 "B<sem_unlink>() は、 I<name> で参照される名前付きセマフォを削除する。 セマ"
1146 "フォの名前は直ちに削除される。 このセマフォをオープンしている他のすべてのプロ"
1147 "セスがセマフォを 閉じて初めてセマフォの削除が行われる。"
1150 #: build/C/man3/sem_unlink.3:50
1152 "On success B<sem_unlink>() returns 0; on error, -1 is returned, with "
1153 "I<errno> set to indicate the error."
1155 "成功すると、 B<sem_unlink>() は 0 を返す。エラーの場合、-1 を返し、 "
1156 "I<errno> にエラーを示す値をセットする。"
1159 #: build/C/man3/sem_unlink.3:54
1160 msgid "The caller does not have permission to unlink this semaphore."
1161 msgstr "呼び出し元にはこのセマフォを削除する許可がない。"
1164 #: build/C/man3/sem_unlink.3:62
1165 msgid "There is no semaphore with the given I<name>."
1166 msgstr "指定された名前 I<name> のセマフォが存在しない。"
1169 #: build/C/man3/sem_unlink.3:67
1170 msgid "The B<sem_unlink>() function is thread-safe."
1171 msgstr "B<sem_unlink>() 関数はスレッドセーフである。"
1174 #: build/C/man3/sem_unlink.3:75
1176 "B<sem_getvalue>(3), B<sem_open>(3), B<sem_post>(3), B<sem_wait>(3), "
1177 "B<sem_overview>(7)"
1179 "B<sem_getvalue>(3), B<sem_open>(3), B<sem_post>(3), B<sem_wait>(3), "
1180 "B<sem_overview>(7)"
1183 #: build/C/man3/sem_wait.3:26
1189 #: build/C/man3/sem_wait.3:29
1190 msgid "sem_wait, sem_timedwait, sem_trywait - lock a semaphore"
1191 msgstr "sem_wait, sem_timedwait, sem_trywait - セマフォをロックする"
1194 #: build/C/man3/sem_wait.3:34
1196 msgid "B<int sem_wait(sem_t *>I<sem>B<);>\n"
1197 msgstr "B<int sem_wait(sem_t *>I<sem>B<);>\n"
1200 #: build/C/man3/sem_wait.3:36
1202 msgid "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
1203 msgstr "B<int sem_trywait(sem_t *>I<sem>B<);>\n"
1206 #: build/C/man3/sem_wait.3:38
1208 msgid "B<int sem_timedwait(sem_t *>I<sem>B<, const struct timespec *>I<abs_timeout>B<);>\n"
1209 msgstr "B<int sem_timedwait(sem_t *>I<sem>B<, const struct timespec *>I<abs_timeout>B<);>\n"
1212 #: build/C/man3/sem_wait.3:45 build/C/man2/semop.2:53
1214 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
1215 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7) 参照):"
1218 #: build/C/man3/sem_wait.3:49
1220 "B<sem_timedwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
1223 "B<sem_timedwait>(): _POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ "
1227 #: build/C/man3/sem_wait.3:59
1229 "B<sem_wait>() decrements (locks) the semaphore pointed to by I<sem>. If "
1230 "the semaphore's value is greater than zero, then the decrement proceeds, and "
1231 "the function returns, immediately. If the semaphore currently has the value "
1232 "zero, then the call blocks until either it becomes possible to perform the "
1233 "decrement (i.e., the semaphore value rises above zero), or a signal handler "
1234 "interrupts the call."
1236 "B<sem_wait>() は I<sem> が指すセマフォの値を 1 減らす (ロックする)。 セマ"
1237 "フォの値が 0 より大きい場合、減算が実行され、関数は直ちに復帰する。 セマフォ"
1238 "の現在値が 0 の場合には、減算を実行できるようになる (つまり、セマフォの値が "
1239 "0 より大きな値になる) まで、もしくは シグナルハンドラーによって呼び出しが中断"
1240 "されるまで、 関数呼び出しは停止 (block) する。"
1243 #: build/C/man3/sem_wait.3:69
1245 "B<sem_trywait>() is the same as B<sem_wait>(), except that if the decrement "
1246 "cannot be immediately performed, then call returns an error (I<errno> set to "
1247 "B<EAGAIN>) instead of blocking."
1249 "B<sem_trywait>() は B<sem_wait>() と同じだが、セマフォ値の減算をすぐに実行"
1250 "できなかった場合に、 停止 (block) するのではなくエラーで復帰する (I<errno> "
1251 "に B<EAGAIN> がセットされる) 点が異なる。"
1254 #: build/C/man3/sem_wait.3:82
1256 "B<sem_timedwait>() is the same as B<sem_wait>(), except that I<abs_timeout> "
1257 "specifies a limit on the amount of time that the call should block if the "
1258 "decrement cannot be immediately performed. The I<abs_timeout> argument "
1259 "points to a structure that specifies an absolute timeout in seconds and "
1260 "nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). This "
1261 "structure is defined as follows:"
1263 "B<sem_timedwait>() は B<sem_wait>() と同じだが、セマフォ値の減算をすぐに実"
1264 "行できなかった場合に 関数呼び出しが停止する時間の上限を I<abs_timeout> で指定"
1265 "する点が異なる。 I<abs_timeout> 引き数は、タイムアウト時刻を指定する構造体へ"
1266 "のポインターである。 この構造体には、タイムアウト時刻を時刻紀元 (Epoch; "
1267 "1970-01-01 00:00:00 +0000 (UTC)) からの 経過時間 (秒+ナノ秒) で指定する。 構"
1271 #: build/C/man3/sem_wait.3:89
1274 "struct timespec {\n"
1275 " time_t tv_sec; /* Seconds */\n"
1276 " long tv_nsec; /* Nanoseconds [0 .. 999999999] */\n"
1279 "struct timespec {\n"
1280 " time_t tv_sec; /* Seconds */\n"
1281 " long tv_nsec; /* Nanoseconds [0 .. 999999999] */\n"
1285 #: build/C/man3/sem_wait.3:100
1287 "If the timeout has already expired by the time of the call, and the "
1288 "semaphore could not be locked immediately, then B<sem_timedwait>() fails "
1289 "with a timeout error (I<errno> set to B<ETIMEDOUT>)."
1291 "関数呼び出し時点ですでにタイムアウトに指定した時刻が過ぎており、 かつセマフォ"
1292 "をすぐにロックできなかった場合は、 B<sem_timedwait>() はタイムアウトエラー "
1293 "(I<errno> に B<ETIMEDOUT> がセットされる) で失敗する。"
1296 #: build/C/man3/sem_wait.3:108
1298 "If the operation can be performed immediately, then B<sem_timedwait>() "
1299 "never fails with a timeout error, regardless of the value of "
1300 "I<abs_timeout>. Furthermore, the validity of I<abs_timeout> is not checked "
1303 "セマフォ操作がすぐに実行できるときは、 I<abs_timeout> がどんな値であっても "
1304 "B<sem_timedwait>() が失敗することは決してない。さらにいうと、この場合には "
1305 "I<abs_timeout> の正当性の検査は行われない。"
1308 #: build/C/man3/sem_wait.3:114
1310 "All of these functions return 0 on success; on error, the value of the "
1311 "semaphore is left unchanged, -1 is returned, and I<errno> is set to indicate "
1314 "成功すると、これらの関数は 0 を返す。 エラーの場合、セマフォの値を変更せず"
1315 "に、-1 を返し、 I<errno> にエラーを示す値をセットする。"
1318 #: build/C/man3/sem_wait.3:115 build/C/man2/semop.2:352
1324 #: build/C/man3/sem_wait.3:119
1325 msgid "The call was interrupted by a signal handler; see B<signal>(7)."
1326 msgstr "呼び出しはシグナルハンドラーにより中断された。 B<signal>(7) 参照。"
1329 #: build/C/man3/sem_wait.3:126
1330 msgid "The following additional error can occur for B<sem_trywait>():"
1331 msgstr "B<sem_trywait>() の場合には、上記に加えて以下のエラーも起こる。"
1334 #: build/C/man3/sem_wait.3:126 build/C/man2/semop.2:327
1340 #: build/C/man3/sem_wait.3:130
1342 "The operation could not be performed without blocking (i.e., the semaphore "
1343 "currently has the value zero)."
1345 "停止 (block) せずにロック操作を完了できなかった (つまり、 セマフォの現在の値"
1349 #: build/C/man3/sem_wait.3:133
1350 msgid "The following additional errors can occur for B<sem_timedwait>():"
1351 msgstr "B<sem_timedwait>() の場合、以下のエラーも起こる。"
1354 #: build/C/man3/sem_wait.3:138
1356 "The value of I<abs_timeout.tv_nsecs> is less than 0, or greater than or "
1357 "equal to 1000 million."
1359 "I<abs_timeout.tv_nsecs> の値が 0 未満、もしくは 1,000,000,000 以上である。"
1362 #: build/C/man3/sem_wait.3:138
1364 msgid "B<ETIMEDOUT>"
1365 msgstr "B<ETIMEDOUT>"
1367 #. POSIX.1-2001 also allows EDEADLK -- "A deadlock condition
1368 #. was detected", but this does not occur on Linux(?).
1370 #: build/C/man3/sem_wait.3:143
1371 msgid "The call timed out before the semaphore could be locked."
1372 msgstr "セマフォのロックに成功する前に時間切れとなった。"
1375 #: build/C/man3/sem_wait.3:151
1377 "The B<sem_wait>(), B<sem_trywait>(), and B<sem_timedwait>() functions are "
1380 "関数 B<sem_wait>(), B<sem_trywait>(), B<sem_timedwait>() はスレッドセーフであ"
1383 #. sem_wait() is always interrupted on most other implementations,
1384 #. but on FreeBSD 5.4 SA_RESTART does cause restarting.
1386 #: build/C/man3/sem_wait.3:161
1388 "A signal handler always interrupts a blocked call to one of these functions, "
1389 "regardless of the use of the B<sigaction>(2) B<SA_RESTART> flag."
1391 "シグナルハンドラーは、 B<sigaction>(2) の B<SA_RESTART> フラグを使用している"
1392 "かどうかに関わらず、これらの関数の呼び出しが 停止している場合、シグナルハンド"
1396 #: build/C/man3/sem_wait.3:180
1398 "The (somewhat trivial) program shown below operates on an unnamed "
1399 "semaphore. The program expects two command-line arguments. The first "
1400 "argument specifies a seconds value that is used to set an alarm timer to "
1401 "generate a B<SIGALRM> signal. This handler performs a B<sem_post>(3) to "
1402 "increment the semaphore that is being waited on in I<main()> using "
1403 "B<sem_timedwait>(). The second command-line argument specifies the length "
1404 "of the timeout, in seconds, for B<sem_timedwait>(). The following shows "
1405 "what happens on two different runs of the program:"
1407 "以下に示す (ちょっとした) プログラムは名前なしセマフォの操作を行う。 プログラ"
1408 "ムはコマンドライン引き数を 2 つ取る。 最初の引き数には、 B<SIGALRM> シグナル"
1409 "を生成するためのアラームタイマーの設定に使われる値を 秒単位で指定する。このシ"
1410 "グナルハンドラーは、 I<main()> 内で B<sem_timedwait>() を使って待っているセ"
1411 "マフォを、 B<sem_post>(3) を使って加算する。 2番目の引き数には、 "
1412 "B<sem_timedwait>() に渡すタイムアウトまでの時間を秒単位で指定する。"
1415 #: build/C/man3/sem_wait.3:190
1418 "$B< ./a.out 2 3>\n"
1419 "About to call sem_timedwait()\n"
1420 "sem_post() from handler\n"
1421 "sem_timedwait() succeeded\n"
1422 "$B< ./a.out 2 1>\n"
1423 "About to call sem_timedwait()\n"
1424 "sem_timedwait() timed out\n"
1426 "$B< ./a.out 2 3>\n"
1427 "About to call sem_timedwait()\n"
1428 "sem_post() from handler\n"
1429 "sem_timedwait() succeeded\n"
1430 "$B< ./a.out 2 1>\n"
1431 "About to call sem_timedwait()\n"
1432 "sem_timedwait() timed out\n"
1435 #: build/C/man3/sem_wait.3:192
1437 msgid "Program source"
1441 #: build/C/man3/sem_wait.3:203
1444 "#include E<lt>unistd.hE<gt>\n"
1445 "#include E<lt>stdio.hE<gt>\n"
1446 "#include E<lt>stdlib.hE<gt>\n"
1447 "#include E<lt>semaphore.hE<gt>\n"
1448 "#include E<lt>time.hE<gt>\n"
1449 "#include E<lt>assert.hE<gt>\n"
1450 "#include E<lt>errno.hE<gt>\n"
1451 "#include E<lt>signal.hE<gt>\n"
1453 "#include E<lt>unistd.hE<gt>\n"
1454 "#include E<lt>stdio.hE<gt>\n"
1455 "#include E<lt>stdlib.hE<gt>\n"
1456 "#include E<lt>semaphore.hE<gt>\n"
1457 "#include E<lt>time.hE<gt>\n"
1458 "#include E<lt>assert.hE<gt>\n"
1459 "#include E<lt>errno.hE<gt>\n"
1460 "#include E<lt>signal.hE<gt>\n"
1463 #: build/C/man3/sem_wait.3:205
1465 msgid "sem_t sem;\n"
1466 msgstr "sem_t sem;\n"
1469 #: build/C/man3/sem_wait.3:208
1472 "#define handle_error(msg) \\e\n"
1473 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1475 "#define handle_error(msg) \\e\n"
1476 " do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1479 #: build/C/man3/sem_wait.3:218
1483 "handler(int sig)\n"
1485 " write(STDOUT_FILENO, \"sem_post() from handler\\en\", 24);\n"
1486 " if (sem_post(&sem) == -1) {\n"
1487 " write(STDERR_FILENO, \"sem_post() failed\\en\", 18);\n"
1488 " _exit(EXIT_FAILURE);\n"
1493 "handler(int sig)\n"
1495 " write(STDOUT_FILENO, \"sem_post() from handler\\en\", 24);\n"
1496 " if (sem_post(&sem) == -1) {\n"
1497 " write(STDERR_FILENO, \"sem_post() failed\\en\", 18);\n"
1498 " _exit(EXIT_FAILURE);\n"
1503 #: build/C/man3/sem_wait.3:225
1507 "main(int argc, char *argv[])\n"
1509 " struct sigaction sa;\n"
1510 " struct timespec ts;\n"
1514 "main(int argc, char *argv[])\n"
1516 " struct sigaction sa;\n"
1517 " struct timespec ts;\n"
1521 #: build/C/man3/sem_wait.3:231
1524 " if (argc != 3) {\n"
1525 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\en\",\n"
1527 " exit(EXIT_FAILURE);\n"
1530 " if (argc != 3) {\n"
1531 " fprintf(stderr, \"Usage: %s E<lt>alarm-secsE<gt> E<lt>wait-secsE<gt>\\en\",\n"
1533 " exit(EXIT_FAILURE);\n"
1537 #: build/C/man3/sem_wait.3:234
1540 " if (sem_init(&sem, 0, 0) == -1)\n"
1541 " handle_error(\"sem_init\");\n"
1543 " if (sem_init(&sem, 0, 0) == -1)\n"
1544 " handle_error(\"sem_init\");\n"
1547 #: build/C/man3/sem_wait.3:236
1549 msgid " /* Establish SIGALRM handler; set alarm timer using argv[1] */\n"
1550 msgstr " /* Establish SIGALRM handler; set alarm timer using argv[1] */\n"
1553 #: build/C/man3/sem_wait.3:242
1556 " sa.sa_handler = handler;\n"
1557 " sigemptyset(&sa.sa_mask);\n"
1558 " sa.sa_flags = 0;\n"
1559 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
1560 " handle_error(\"sigaction\");\n"
1562 " sa.sa_handler = handler;\n"
1563 " sigemptyset(&sa.sa_mask);\n"
1564 " sa.sa_flags = 0;\n"
1565 " if (sigaction(SIGALRM, &sa, NULL) == -1)\n"
1566 " handle_error(\"sigaction\");\n"
1569 #: build/C/man3/sem_wait.3:244
1571 msgid " alarm(atoi(argv[1]));\n"
1572 msgstr " alarm(atoi(argv[1]));\n"
1575 #: build/C/man3/sem_wait.3:247
1578 " /* Calculate relative interval as current time plus\n"
1579 " number of seconds given argv[2] */\n"
1581 " /* Calculate relative interval as current time plus\n"
1582 " number of seconds given argv[2] */\n"
1585 #: build/C/man3/sem_wait.3:250
1588 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
1589 " handle_error(\"clock_gettime\");\n"
1591 " if (clock_gettime(CLOCK_REALTIME, &ts) == -1)\n"
1592 " handle_error(\"clock_gettime\");\n"
1595 #: build/C/man3/sem_wait.3:252
1597 msgid " ts.tv_sec += atoi(argv[2]);\n"
1598 msgstr " ts.tv_sec += atoi(argv[2]);\n"
1601 #: build/C/man3/sem_wait.3:256
1604 " printf(\"main() about to call sem_timedwait()\\en\");\n"
1605 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
1606 " continue; /* Restart if interrupted by handler */\n"
1608 " printf(\"main() about to call sem_timedwait()\\en\");\n"
1609 " while ((s = sem_timedwait(&sem, &ts)) == -1 && errno == EINTR)\n"
1610 " continue; /* Restart if interrupted by handler */\n"
1613 #: build/C/man3/sem_wait.3:258
1615 msgid " /* Check what happened */\n"
1616 msgstr " /* Check what happened */\n"
1619 #: build/C/man3/sem_wait.3:266
1623 " if (errno == ETIMEDOUT)\n"
1624 " printf(\"sem_timedwait() timed out\\en\");\n"
1626 " perror(\"sem_timedwait\");\n"
1628 " printf(\"sem_timedwait() succeeded\\en\");\n"
1631 " if (errno == ETIMEDOUT)\n"
1632 " printf(\"sem_timedwait() timed out\\en\");\n"
1634 " perror(\"sem_timedwait\");\n"
1636 " printf(\"sem_timedwait() succeeded\\en\");\n"
1639 #: build/C/man3/sem_wait.3:269
1642 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
1645 " exit((s == 0) ? EXIT_SUCCESS : EXIT_FAILURE);\n"
1649 #: build/C/man3/sem_wait.3:276
1651 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<sem_overview>(7), "
1654 "B<clock_gettime>(2), B<sem_getvalue>(3), B<sem_post>(3), B<sem_overview>(7), "
1658 #: build/C/man2/semctl.2:41
1664 #: build/C/man2/semctl.2:41
1670 #: build/C/man2/semctl.2:44
1671 msgid "semctl - System V semaphore control operations"
1672 msgstr "semctl - System V セマフォの制御操作を行なう"
1675 #: build/C/man2/semctl.2:49 build/C/man2/semget.2:44 build/C/man2/semop.2:43
1678 "B<#include E<lt>sys/types.hE<gt>>\n"
1679 "B<#include E<lt>sys/ipc.hE<gt>>\n"
1680 "B<#include E<lt>sys/sem.hE<gt>>\n"
1682 "B<#include E<lt>sys/types.hE<gt>>\n"
1683 "B<#include E<lt>sys/ipc.hE<gt>>\n"
1684 "B<#include E<lt>sys/sem.hE<gt>>\n"
1687 #: build/C/man2/semctl.2:51
1689 msgid "B<int semctl(int >I<semid>B<, int >I<semnum>B<, int >I<cmd>B<, ...);>\n"
1690 msgstr "B<int semctl(int >I<semid>B<, int >I<semnum>B<, int >I<cmd>B<, ...);>\n"
1693 #: build/C/man2/semctl.2:62
1695 "B<semctl>() performs the control operation specified by I<cmd> on the System"
1696 "\\ V semaphore set identified by I<semid>, or on the I<semnum>-th semaphore "
1697 "of that set. (The semaphores in a set are numbered starting at 0.)"
1699 "B<semctl>() は、 I<semid> で指定された System\\ V セマフォ集合 (semaphore "
1700 "set) またはセマフォ集合の I<semnun> 番目のセマフォに対して、 I<cmd> で指定さ"
1701 "れた制御操作を行なう (集合内のセマフォの番号は 0 から始まる)。"
1704 #: build/C/man2/semctl.2:68
1706 "This function has three or four arguments, depending on I<cmd>. When there "
1707 "are four, the fourth has the type I<union semun>. The I<calling program> "
1708 "must define this union as follows:"
1710 "この関数は、 I<cmd> の値に依存して、3 個または 4 個の引き数を持つ。 引き数が "
1711 "4 個の場合、第 4 引き数の型は I<union semun> である。 I<呼び出し元プログラム>"
1712 "は、 この共用体 (union) を以下のように定義しなければならない。"
1715 #: build/C/man2/semctl.2:78
1719 " int val; /* Value for SETVAL */\n"
1720 " struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */\n"
1721 " unsigned short *array; /* Array for GETALL, SETALL */\n"
1722 " struct seminfo *__buf; /* Buffer for IPC_INFO\n"
1723 " (Linux-specific) */\n"
1727 " int val; /* SETVAL の値 */\n"
1728 " struct semid_ds *buf; /* IPC_STAT, IPC_SET 用のバッファー */\n"
1729 " unsigned short *array; /* GETALL, SETALL 用の配列 */\n"
1730 " struct seminfo *__buf; /* IPC_INFO 用のバッファー\n"
1735 #: build/C/man2/semctl.2:84
1737 "The I<semid_ds> data structure is defined in I<E<lt>sys/sem.hE<gt>> as "
1740 "I<semid_ds> データ構造体は I<E<lt>sys/sem.hE<gt>> で以下のように定義されてい"
1744 #: build/C/man2/semctl.2:93
1747 "struct semid_ds {\n"
1748 " struct ipc_perm sem_perm; /* Ownership and permissions */\n"
1749 " time_t sem_otime; /* Last semop time */\n"
1750 " time_t sem_ctime; /* Last change time */\n"
1751 " unsigned long sem_nsems; /* No. of semaphores in set */\n"
1754 "struct semid_ds {\n"
1755 " struct ipc_perm sem_perm; /* 所有権と許可 */\n"
1756 " time_t sem_otime; /* 最後の semop の時刻 */\n"
1757 " time_t sem_ctime; /* 最後に変更が行われた時刻 */\n"
1758 " unsigned long sem_nsems; /* 集合内のセマフォの数 */\n"
1762 #: build/C/man2/semctl.2:101
1764 "The I<ipc_perm> structure is defined as follows (the highlighted fields are "
1765 "settable using B<IPC_SET>):"
1767 "I<ipc_perm> 構造体は以下のように定義されている (強調されたフィールドは "
1768 "B<IPC_SET> を使って設定可能である):"
1771 #: build/C/man2/semctl.2:113
1774 "struct ipc_perm {\n"
1775 " key_t __key; /* Key supplied to semget(2) */\n"
1776 " uid_t B<uid>; /* Effective UID of owner */\n"
1777 " gid_t B<gid>; /* Effective GID of owner */\n"
1778 " uid_t cuid; /* Effective UID of creator */\n"
1779 " gid_t cgid; /* Effective GID of creator */\n"
1780 " unsigned short B<mode>; /* Permissions */\n"
1781 " unsigned short __seq; /* Sequence number */\n"
1784 "struct ipc_perm {\n"
1785 " key_t __key; /* semget(2) に与えられるキー */\n"
1786 " uid_t B<uid>; /* 所有者 (owner) の実効 UID */\n"
1787 " gid_t B<gid>; /* 所有者の実効 GID */\n"
1788 " uid_t cuid; /* 作成者 (creator) の実効 UID */\n"
1789 " gid_t cgid; /* 作成者の実効 GID */\n"
1790 " unsigned short B<mode>; /* 許可 */\n"
1791 " unsigned short __seq; /* シーケンス番号 */\n"
1795 #: build/C/man2/semctl.2:119
1796 msgid "Valid values for I<cmd> are:"
1797 msgstr "I<cmd> として有効な値は次の通りである。"
1800 #: build/C/man2/semctl.2:119
1803 msgstr "B<IPC_STAT>"
1806 #: build/C/man2/semctl.2:131
1808 "Copy information from the kernel data structure associated with I<semid> "
1809 "into the I<semid_ds> structure pointed to by I<arg.buf>. The argument "
1810 "I<semnum> is ignored. The calling process must have read permission on the "
1813 "I<semid> に関連づけられたカーネルデータ構造体の情報を I<arg.buf> で指された "
1814 "I<semid_ds> 構造体へコピーする。 I<semnum> 引き数は無視される。 呼び出したプ"
1815 "ロセスはそのセマフォ集合に対する 読み込み許可を持たなければならない。"
1818 #: build/C/man2/semctl.2:131
1824 #: build/C/man2/semctl.2:154
1826 "Write the values of some members of the I<semid_ds> structure pointed to by "
1827 "I<arg.buf> to the kernel data structure associated with this semaphore set, "
1828 "updating also its I<sem_ctime> member. The following members of the "
1829 "structure are updated: I<sem_perm.uid>, I<sem_perm.gid>, and (the least "
1830 "significant 9 bits of) I<sem_perm.mode>. The effective UID of the calling "
1831 "process must match the owner (I<sem_perm.uid>) or creator (I<sem_perm."
1832 "cuid>) of the semaphore set, or the caller must be privileged. The "
1833 "argument I<semnum> is ignored."
1835 "I<arg.buf> で指定された I<semid_ds> 構造体のメンバーのいくつかの値を、 このセ"
1836 "マフォに関連づけられたカーネルデータ構造体に書き込み、 I<sem_ctime> メンバー"
1837 "の値も更新する。 構造体の以下のメンバーが更新される: I<sem_perm.uid>, "
1838 "I<sem_perm.gid>, I<sem_perm.mode> (の最下位 9 ビット)。 呼び出したプロセスの"
1839 "実効 UID が所有者 (I<sem_perm.uid>) または作成者 (I<sem_perm.cuid>) と一致"
1840 "するか、呼び出した人が特権を持たなければならない。 I<semnum> 引き数は無視され"
1844 #: build/C/man2/semctl.2:154
1847 msgstr "B<IPC_RMID>"
1850 #: build/C/man2/semctl.2:169
1852 "Immediately remove the semaphore set, awakening all processes blocked in "
1853 "B<semop>(2) calls on the set (with an error return and I<errno> set to "
1854 "B<EIDRM>). The effective user ID of the calling process must match the "
1855 "creator or owner of the semaphore set, or the caller must be privileged. "
1856 "The argument I<semnum> is ignored."
1858 "セマフォ集合をただちに削除し、その集合上の B<semop>(2) コールでブロックされ"
1859 "ている全てのプロセスを目覚めさせる (エラー値が返されて、 I<errno> に "
1860 "B<EIDRM> が設定される)。 呼び出したプロセスの実効ユーザー ID が そのセマフォ"
1861 "集合の作成者または所有者と一致するか、 呼び出した人が特権を持たなければならな"
1862 "い。 I<semnum> 引き数は無視される。"
1865 #: build/C/man2/semctl.2:169
1867 msgid "B<IPC_INFO> (Linux-specific)"
1868 msgstr "B<IPC_INFO> (Linux 固有)"
1871 #: build/C/man2/semctl.2:181
1873 "Return information about system-wide semaphore limits and parameters in the "
1874 "structure pointed to by I<arg.__buf>. This structure is of type I<seminfo>, "
1875 "defined in I<E<lt>sys/sem.hE<gt>> if the B<_GNU_SOURCE> feature test macro "
1878 "システム全体でのセマフォの制限とパラメーターに関する情報を、 I<arg.__buf> が"
1879 "指す構造体に入れて返す。 この構造体は I<seminfo> 型である。 I<seminfo> は "
1880 "B<_GNU_SOURCE> 機能検査マクロが定義された場合に I<E<lt>sys/sem.hE<gt>> で以下"
1884 #: build/C/man2/semctl.2:203
1887 "struct seminfo {\n"
1888 " int semmap; /* Number of entries in semaphore\n"
1889 " map; unused within kernel */\n"
1890 " int semmni; /* Maximum number of semaphore sets */\n"
1891 " int semmns; /* Maximum number of semaphores in all\n"
1892 " semaphore sets */\n"
1893 " int semmnu; /* System-wide maximum number of undo\n"
1894 " structures; unused within kernel */\n"
1895 " int semmsl; /* Maximum number of semaphores in a\n"
1897 " int semopm; /* Maximum number of operations for\n"
1899 " int semume; /* Maximum number of undo entries per\n"
1900 " process; unused within kernel */\n"
1901 " int semusz; /* Size of struct sem_undo */\n"
1902 " int semvmx; /* Maximum semaphore value */\n"
1903 " int semaem; /* Max. value that can be recorded for\n"
1904 " semaphore adjustment (SEM_UNDO) */\n"
1907 "struct seminfo {\n"
1908 " int semmap; /* セマフォマップの最大エントリー数;\n"
1910 " int semmni; /* セマフォ集合の最大数 */\n"
1911 " int semmns; /* 全セマフォ集合中のセマフォの\n"
1913 " int semmnu; /* アンドゥ構造体のシステム全体での\n"
1914 " 最大数; カーネル内では未使用 */\n"
1915 " int semmsl; /* 一つのセマフォ集合の最大セマフォ数 */\n"
1916 " int semopm; /* semop(2) に渡す操作の最大数 */\n"
1917 " int semume; /* プロセスあたりのアンドゥエントリー\n"
1918 " の最大数; カーネル内では未使用 */\n"
1919 " int semusz; /* 構造体 sem_undo のサイズ */\n"
1920 " int semvmx; /* セマフォの最大値 */\n"
1921 " int semaem; /* セマフォの調整 (semaphore adjustment;\n"
1922 " SEM_UNDO) のために記録される最大値 */\n"
1926 #: build/C/man2/semctl.2:217
1928 "The I<semmsl>, I<semmns>, I<semopm>, and I<semmni> settings can be changed "
1929 "via I</proc/sys/kernel/sem>; see B<proc>(5) for details."
1931 "設定 I<semmsl>, I<semmns>, I<semopm>, I<semmni> は I</proc/sys/kernel/sem> 経"
1932 "由で変更可能である。 詳しくは B<proc>(5) を参照。"
1935 #: build/C/man2/semctl.2:217
1937 msgid "B<SEM_INFO> (Linux-specific)"
1938 msgstr "B<SEM_INFO> (Linux 固有)"
1941 #: build/C/man2/semctl.2:231
1943 "Return a I<seminfo> structure containing the same information as for "
1944 "B<IPC_INFO>, except that the following fields are returned with information "
1945 "about system resources consumed by semaphores: the I<semusz> field returns "
1946 "the number of semaphore sets that currently exist on the system; and the "
1947 "I<semaem> field returns the total number of semaphores in all semaphore sets "
1950 "B<IPC_INFO> のときと同じ情報を格納した I<seminfo> 構造体を返す。 但し、以下の"
1951 "フィールドにはセマフォが消費しているシステム資源に 関する情報が格納される点が"
1952 "異なる。 I<semusz> フィールドは現在システム上に存在するセマフォ集合の数を返"
1953 "す。 I<semaem> フィールドはシステム上の全てのセマフォ集合に含まれる セマフォ"
1957 #: build/C/man2/semctl.2:231
1959 msgid "B<SEM_STAT> (Linux-specific)"
1960 msgstr "B<SEM_STAT> (Linux 固有)"
1963 #: build/C/man2/semctl.2:242
1965 "Return a I<semid_ds> structure as for B<IPC_STAT>. However, the I<semid> "
1966 "argument is not a semaphore identifier, but instead an index into the "
1967 "kernel's internal array that maintains information about all semaphore sets "
1970 "B<IPC_STAT> と同じく I<semid_ds> 構造体を返す。 但し、 I<semid> 引き数は、セ"
1971 "マフォ識別子ではなく、システム上の全てのセマフォ集合 に関する情報を管理する"
1972 "カーネルの内部配列へのインデックスである。"
1975 #: build/C/man2/semctl.2:242
1981 #: build/C/man2/semctl.2:253
1983 "Return B<semval> (i.e., the current value) for all semaphores of the set "
1984 "into I<arg.array>. The argument I<semnum> is ignored. The calling process "
1985 "must have read permission on the semaphore set."
1987 "集合の全てのセマフォの B<semval> の値 (現在の値) を I<arg.array> に返す。 "
1988 "I<semnum> 引き数は無視される。 呼び出したプロセスはそのセマフォ集合に読み込み"
1992 #: build/C/man2/semctl.2:253 build/C/man2/semctl.2:351
1998 #: build/C/man2/semctl.2:266
2000 "Return the value of B<semncnt> for the I<semnum>-th semaphore of the set (i."
2001 "e., the number of processes waiting for an increase of B<semval> for the "
2002 "I<semnum>-th semaphore of the set). The calling process must have read "
2003 "permission on the semaphore set."
2005 "集合の I<semnum> 番目のセマフォの B<semncnt> の値を返す (集合の I<semnum> 番"
2006 "目のセマフォの B<semval> の増加を待っているプロセスの数を返す)。 呼び出したプ"
2007 "ロセスはそのセマフォ集合に読み込み許可を持たなければならない。"
2010 #: build/C/man2/semctl.2:266 build/C/man2/semctl.2:355
2016 #: build/C/man2/semctl.2:279
2018 "Return the value of B<sempid> for the I<semnum>-th semaphore of the set (i."
2019 "e., the PID of the process that executed the last B<semop>(2) call for the "
2020 "I<semnum>-th semaphore of the set). The calling process must have read "
2021 "permission on the semaphore set."
2023 "集合の I<semnum> 番目のセマフォの B<sempid> の値 (集合の I<semnum> 番目のセマ"
2024 "フォに最後に B<semop>(2) コールを実行したプロセスの PID) を返す。 呼び出した"
2025 "プロセスはそのセマフォ集合に読み込み許可を持たなければならない。"
2028 #: build/C/man2/semctl.2:279 build/C/man2/semctl.2:359
2034 #: build/C/man2/semctl.2:287
2036 "Return the value of B<semval> for the I<semnum>-th semaphore of the set. "
2037 "The calling process must have read permission on the semaphore set."
2039 "集合の I<semnum> 番目のセマフォの B<semval> の値を返す。 呼び出したプロセスは"
2040 "そのセマフォ集合に読み込み許可を持たなければならない。"
2043 #: build/C/man2/semctl.2:287 build/C/man2/semctl.2:363
2049 #: build/C/man2/semctl.2:300
2051 "Return the value of B<semzcnt> for the I<semnum>-th semaphore of the set (i."
2052 "e., the number of processes waiting for B<semval> of the I<semnum>-th "
2053 "semaphore of the set to become 0). The calling process must have read "
2054 "permission on the semaphore set."
2056 "集合の I<semnum> 番目のセマフォの B<semzcnt> の値を返す (集合の I<semnum> 番"
2057 "目のセマフォの B<semval> の値が 0 になるのを待っているプロセスの数を返す)。 "
2058 "呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。"
2061 #: build/C/man2/semctl.2:300
2067 #: build/C/man2/semctl.2:322
2069 "Set B<semval> for all semaphores of the set using I<arg.array>, updating "
2070 "also the I<sem_ctime> member of the I<semid_ds> structure associated with "
2071 "the set. Undo entries (see B<semop>(2)) are cleared for altered semaphores "
2072 "in all processes. If the changes to semaphore values would permit blocked "
2073 "B<semop>(2) calls in other processes to proceed, then those processes are "
2074 "woken up. The argument I<semnum> is ignored. The calling process must have "
2075 "alter (write) permission on the semaphore set."
2077 "集合の全てのセマフォの B<semval> に I<arg.array> で指定された値を設定する。 "
2078 "その集合に関連する I<semid_ds> 構造体の I<sem_ctime> メンバーの値も更新す"
2079 "る。 全てのプロセスのセマフォの変更についてのアンドゥエントリー "
2080 "(B<semop>(2) を参照) は消去 (clear) される。 セマフォの値の変更により、他の"
2081 "プロセス内でブロックされている B<semop>(2) コールの続行が許可されると、それ"
2082 "らのプロセスは起こされる (wake up)。 I<semnum> 引き数は無視される。 呼び出し"
2083 "たプロセスはそのセマフォ集合に 変更 (書き込み) 許可を持たなければならない。"
2086 #: build/C/man2/semctl.2:322
2092 #: build/C/man2/semctl.2:340
2094 "Set the value of B<semval> to I<arg.val> for the I<semnum>-th semaphore of "
2095 "the set, updating also the I<sem_ctime> member of the I<semid_ds> structure "
2096 "associated with the set. Undo entries are cleared for altered semaphores in "
2097 "all processes. If the changes to semaphore values would permit blocked "
2098 "B<semop>(2) calls in other processes to proceed, then those processes are "
2099 "woken up. The calling process must have alter permission on the semaphore "
2102 "集合の I<semnum> 番目のセマフォの B<semval> に I<arg.val> の値を設定する。そ"
2103 "の集合に関連する I<semid_ds> 構造体の I<sem_ctime> メンバーの値も更新する。 "
2104 "全てのプロセスのセマフォの変更についてのアンドゥエントリーは消去される。 セマ"
2105 "フォの値の変更により、他のプロセス内でブロックされている B<semop>(2) コール"
2106 "の続行が許可されると、それらのプロセスは起こされる (wake up)。 呼び出したプロ"
2107 "セスはそのセマフォ集合に 変更 (書き込み) 許可を持たなければならない。"
2110 #: build/C/man2/semctl.2:347
2111 msgid "On failure, B<semctl>() returns -1 with I<errno> indicating the error."
2113 "失敗した場合、 B<semctl>() は -1 を返し、 I<errno> にそのエラーを示す。"
2116 #: build/C/man2/semctl.2:351
2118 "Otherwise, the system call returns a nonnegative value depending on I<cmd> "
2120 msgstr "そうでなければシステムコールは I<cmd> によって以下の負でない値を返す:"
2123 #: build/C/man2/semctl.2:355
2124 msgid "the value of B<semncnt>."
2125 msgstr "B<semncnt> の値"
2128 #: build/C/man2/semctl.2:359
2129 msgid "the value of B<sempid>."
2130 msgstr "B<sempid> の値"
2133 #: build/C/man2/semctl.2:363
2134 msgid "the value of B<semval>."
2135 msgstr "B<semval> の値"
2138 #: build/C/man2/semctl.2:367
2139 msgid "the value of B<semzcnt>."
2140 msgstr "B<semzcnt> の値"
2143 #: build/C/man2/semctl.2:367
2146 msgstr "B<IPC_INFO>"
2149 #: build/C/man2/semctl.2:375
2151 "the index of the highest used entry in the kernel's internal array recording "
2152 "information about all semaphore sets. (This information can be used with "
2153 "repeated B<SEM_STAT> operations to obtain information about all semaphore "
2154 "sets on the system.)"
2156 "全てのセマフォ集合に関する情報を管理しているカーネルの内部配列の使用中 エント"
2157 "リーのインデックスの最大値 (この情報は、システムの全てのセマフォ集合に関する"
2158 "情報を取得するために B<SEM_STAT> 操作を繰り返し実行する際に使用できる)"
2161 #: build/C/man2/semctl.2:375
2164 msgstr "B<SEM_INFO>"
2167 #: build/C/man2/semctl.2:379
2168 msgid "as for B<IPC_INFO>."
2169 msgstr "B<IPC_INFO> と同じ"
2172 #: build/C/man2/semctl.2:379
2175 msgstr "B<SEM_STAT>"
2178 #: build/C/man2/semctl.2:383
2179 msgid "the identifier of the semaphore set whose index was given in I<semid>."
2180 msgstr "I<semid> で指定されたインデックスを持つセマフォ集合の識別子"
2183 #: build/C/man2/semctl.2:387
2184 msgid "All other I<cmd> values return 0 on success."
2185 msgstr "I<cmd> の値がそれ以外の場合、成功すると 0 が返される。"
2188 #: build/C/man2/semctl.2:391 build/C/man2/semget.2:157
2189 msgid "On failure, I<errno> will be set to one of the following:"
2190 msgstr "失敗した場合は I<errno> には以下の値のどれかが設定される:"
2193 #: build/C/man2/semctl.2:410
2195 "The argument I<cmd> has one of the values B<GETALL>, B<GETPID>, B<GETVAL>, "
2196 "B<GETNCNT>, B<GETZCNT>, B<IPC_STAT>, B<SEM_STAT>, B<SETALL>, or B<SETVAL> "
2197 "and the calling process does not have the required permissions on the "
2198 "semaphore set and does not have the B<CAP_IPC_OWNER> capability."
2200 "I<cmd> 引き数が B<GETALL>, B<GETPID>, B<GETVAL>, B<GETNCNT>, B<GETZCNT>, "
2201 "B<IPC_STAT>, B<SEM_STAT>, B<SETALL>, B<SETVAL> のうちの何れかの値を持ち、 呼"
2202 "び出したプロセスがセマフォに対して必要とされる許可と B<CAP_IPC_OWNER> ケーパ"
2203 "ビリティ (capability) を持っていない。"
2206 #: build/C/man2/semctl.2:410 build/C/man2/semop.2:336
2212 #: build/C/man2/semctl.2:417
2213 msgid "The address pointed to by I<arg.buf> or I<arg.array> isn't accessible."
2215 "I<arg.buf> または I<arg.array> で指されているアドレスにアクセスすることができ"
2219 #: build/C/man2/semctl.2:417 build/C/man2/semop.2:349
2225 #: build/C/man2/semctl.2:420 build/C/man2/semop.2:352
2226 msgid "The semaphore set was removed."
2227 msgstr "セマフォ集合が削除された。"
2230 #: build/C/man2/semctl.2:431
2232 "Invalid value for I<cmd> or I<semid>. Or: for a B<SEM_STAT> operation, the "
2233 "index value specified in I<semid> referred to an array slot that is "
2236 "I<cmd> または I<semid> に無効な値が指定された。 もしくは、 B<SEM_STAT> 操作の"
2237 "場合に、 I<semid> で指定されたインデックス値が現在未使用の配列のスロットを参"
2241 #: build/C/man2/semctl.2:431
2247 #: build/C/man2/semctl.2:449
2249 "The argument I<cmd> has the value B<IPC_SET> or B<IPC_RMID> but the "
2250 "effective user ID of the calling process is not the creator (as found in "
2251 "I<sem_perm.cuid>) or the owner (as found in I<sem_perm.uid>) of the "
2252 "semaphore set, and the process does not have the B<CAP_SYS_ADMIN> capability."
2254 "I<cmd> 引き数に B<IPC_SET> または B<IPC_RMID> が指定され、呼び出したプロセス"
2255 "の実効ユーザー ID がセマフォの (I<sem_perm.cuid> で見つかる) 作成者または "
2256 "(I<sem_perm.uid> で見つかる) 所有者でもなく、 プロセスが B<CAP_SYS_ADMIN> "
2260 #: build/C/man2/semctl.2:449 build/C/man2/semop.2:371
2266 #: build/C/man2/semctl.2:462
2268 "The argument I<cmd> has the value B<SETALL> or B<SETVAL> and the value to "
2269 "which B<semval> is to be set (for some semaphore of the set) is less than 0 "
2270 "or greater than the implementation limit B<SEMVMX>."
2272 "I<cmd> 引き数に B<SETALL> または B<SETVAL> が指定され、(集合のセマフォのどれ"
2273 "かの) B<semval> に設定される値が 0 より小さいか、実装の制限 B<SEMVMX> よりも"
2276 #. SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC.
2278 #: build/C/man2/semctl.2:465 build/C/man2/semget.2:214
2279 #: build/C/man2/semop.2:389
2280 msgid "SVr4, POSIX.1-2001."
2281 msgstr "SVr4, POSIX.1-2001."
2284 #: build/C/man2/semctl.2:476
2286 "POSIX.1-2001 specifies the I<sem_nsems> field of the I<semid_ds> structure "
2287 "as having the type I<unsigned\\ short>, and the field is so defined on most "
2288 "other systems. It was also so defined on Linux 2.2 and earlier, but, since "
2289 "Linux 2.4, the field has the type I<unsigned\\ long>."
2291 "POSIX.1-2001 では I<semid_ds> 構造体の I<sem_nsems> フィールドは I<unsigned"
2292 "\\ short> 型を持つと規定されており、 他のほとんどのシステムでこのフィールド"
2293 "は I<unsigned\\ short> 型になっている。 Linux 2.4 以前ではそうなっていたが、 "
2294 "Linux 2.4 以降ではこのフィールドは I<unsigned\\ long> 型である。"
2296 #. Like Linux, the FreeBSD man pages still document
2297 #. the inclusion of these header files.
2299 #: build/C/man2/semctl.2:489 build/C/man2/semget.2:227
2300 #: build/C/man2/semop.2:402
2302 "The inclusion of I<E<lt>sys/types.hE<gt>> and I<E<lt>sys/ipc.hE<gt>> isn't "
2303 "required on Linux or by any version of POSIX. However, some old "
2304 "implementations required the inclusion of these header files, and the SVID "
2305 "also documented their inclusion. Applications intended to be portable to "
2306 "such old systems may need to include these header files."
2308 "Linux や POSIX の全てのバージョンでは、 I<E<lt>sys/types.hE<gt>> と "
2309 "I<E<lt>sys/ipc.hE<gt>> のインクルードは必要ない。しかしながら、いくつかの古い"
2310 "実装ではこれらのヘッダーファイルのインクルードが必要であり、 SVID でもこれら"
2311 "のインクルードをするように記載されている。このような古いシステムへの移植性を"
2312 "意図したアプリケーションではこれらのファイルをインクルードする必要があるかも"
2316 #: build/C/man2/semctl.2:501
2318 "The B<IPC_INFO>, B<SEM_STAT> and B<SEM_INFO> operations are used by the "
2319 "B<ipcs>(1) program to provide information on allocated resources. In the "
2320 "future these may modified or moved to a I</proc> filesystem interface."
2322 "B<IPC_INFO>, B<SEM_STAT>, B<SEM_INFO> 操作は B<ipcs>(1) プログラムによって割"
2323 "当られた資源について情報を提供するために使用される。 将来的にはこれらは変更さ"
2324 "れるか、 I</proc> ファイルシステムインターフェースに移動されるかもしれない。"
2327 #: build/C/man2/semctl.2:514
2329 "Various fields in a I<struct semid_ds> were typed as I<short> under Linux "
2330 "2.2 and have become I<long> under Linux 2.4. To take advantage of this, a "
2331 "recompilation under glibc-2.1.91 or later should suffice. (The kernel "
2332 "distinguishes old and new calls by an B<IPC_64> flag in I<cmd>.)"
2334 "I<構造体 semid_ds> 内の多くのフィールドは、 Linux 2.2 では I<short> 型だった"
2335 "が、Linux 2.4 では I<long> 型になった。 この利点を生かすには、glibc-2.1.91 以"
2336 "降の環境下で 再コンパイルすれば十分である。 カーネルは新しい形式の呼び出しと"
2337 "古い形式の呼び出しを I<cmd> 内の B<IPC_64> フラグで区別する。"
2340 #: build/C/man2/semctl.2:523
2342 "In some earlier versions of glibc, the I<semun> union was defined in "
2343 "I<E<lt>sys/sem.hE<gt>>, but POSIX.1-2001 requires that the caller define "
2344 "this union. On versions of glibc where this union is I<not> defined, the "
2345 "macro B<_SEM_SEMUN_UNDEFINED> is defined in I<E<lt>sys/sem.hE<gt>>."
2347 "初期のバージョンの glibc では、 I<semun> 共用体は I<E<lt>sys/sem.hE<gt>> で定"
2348 "義されていたが、 POSIX.1-2001 では呼び出し側がこの共用体を定義する必要があ"
2349 "る。 この共用体が定義されてI<いない> glibc のバージョンでは、 マクロ "
2350 "B<_SEM_SEMUN_UNDEFINED> が I<E<lt>sys/sem.hE<gt>> で定義されている。"
2353 #: build/C/man2/semctl.2:527
2355 "The following system limit on semaphore sets affects a B<semctl>() call:"
2356 msgstr "以下は B<semctl>() コールに影響するセマフォ集合のシステム制限:"
2359 #: build/C/man2/semctl.2:527 build/C/man2/semop.2:466
2365 #: build/C/man2/semctl.2:532
2366 msgid "Maximum value for B<semval>: implementation dependent (32767)."
2367 msgstr "B<semval> の最大値 : 実装依存 (32767)。"
2370 #: build/C/man2/semctl.2:536
2372 "For greater portability, it is best to always call B<semctl>() with four "
2375 "移植性を高めるための一番良い方法は、常に 4 個の引き数で B<semctl>() を呼び出"
2379 #: build/C/man2/semctl.2:543
2381 "B<ipc>(2), B<semget>(2), B<semop>(2), B<capabilities>(7), "
2382 "B<sem_overview>(7), B<svipc>(7)"
2384 "B<ipc>(2), B<semget>(2), B<semop>(2), B<capabilities>(7), "
2385 "B<sem_overview>(7), B<svipc>(7)"
2388 #: build/C/man2/semget.2:36
2394 #: build/C/man2/semget.2:36
2400 #: build/C/man2/semget.2:39
2401 msgid "semget - get a System V semaphore set identifier"
2402 msgstr "semget - System V セマフォ集合の識別子を取得する"
2405 #: build/C/man2/semget.2:49
2407 "B<int semget(key_t >I<key>B<,> B<int >I<nsems>B<,> B<int >I<semflg>B<);>"
2409 "B<int semget(key_t >I<key>B<,> B<int >I<nsems>B<,> B<int >I<semflg>B<);>"
2412 #: build/C/man2/semget.2:67
2414 "The B<semget>() system call returns the System\\ V semaphore set identifier "
2415 "associated with the argument I<key>. A new set of I<nsems> semaphores is "
2416 "created if I<key> has the value B<IPC_PRIVATE> or if no existing semaphore "
2417 "set is associated with I<key> and B<IPC_CREAT> is specified in I<semflg>."
2419 "B<semget>() システムコールは、引き数 I<key> に対応する System\\ V セマフォ集"
2420 "合 (semaphore set) の 識別子 (identifier) を返す。 I<key> の値が "
2421 "B<IPC_PRIVATE> の場合、もしくは I<semflg> に B<IPC_CREAT> が指定されていて、 "
2422 "I<key> に対応するセマフォ集合が存在しない場合、 I<nsems> 個のセマフォからなる"
2426 #: build/C/man2/semget.2:86
2428 "If I<semflg> specifies both B<IPC_CREAT> and B<IPC_EXCL> and a semaphore set "
2429 "already exists for I<key>, then B<semget>() fails with I<errno> set to "
2430 "B<EEXIST>. (This is analogous to the effect of the combination B<O_CREAT | "
2431 "O_EXCL> for B<open>(2).)"
2433 "I<semflg> に B<IPC_CREAT> と B<IPC_EXCL> の両方が指定された場合、 I<key> に対"
2434 "応するセマフォ集合が既に存在すると、 B<semget>() は失敗し、 I<errno> に "
2435 "B<EEXIST> が設定される (これは B<open>(2) に B<O_CREAT | O_EXCL> が指定され"
2439 #: build/C/man2/semget.2:99
2441 "Upon creation, the least significant 9 bits of the argument I<semflg> define "
2442 "the permissions (for owner, group and others) for the semaphore set. These "
2443 "bits have the same format, and the same meaning, as the I<mode> argument of "
2444 "B<open>(2) (though the execute permissions are not meaningful for "
2445 "semaphores, and write permissions mean permission to alter semaphore values)."
2447 "セマフォ集合作成時に、引き数 I<semflg> の下位 9 ビットは、そのセマフォ集合の "
2448 "(所有者 (owner)、グループ (group)、 他人 (others) に対する) アクセス許可の定"
2449 "義として使用される。 これらのビットは B<open>(2) の引き数 I<mode> と同じ形式"
2450 "で同じ意味である (但し、実行 (execute) 許可はセマフォでは意味を持たず、 書き"
2451 "込み (write) 許可はセマフォ値の変更 (alter) 許可として機能する)。"
2454 #: build/C/man2/semget.2:107
2456 "When creating a new semaphore set, B<semget>() initializes the set's "
2457 "associated data structure, I<semid_ds> (see B<semctl>(2)), as follows:"
2459 "新規のセマフォ集合を作成する際、 B<semget>() はセマフォ集合の情報を保持する"
2460 "データ構造体 I<semid_ds> を次のように初期化する (I<semid_ds> については "
2461 "B<semctl>(2) を参照):"
2464 #: build/C/man2/semget.2:112
2466 "I<sem_perm.cuid> and I<sem_perm.uid> are set to the effective user ID of the "
2469 "I<sem_perm.cuid> と I<sem_perm.uid> に、呼び出し元のプロセスの実効 "
2470 "(effective) ユーザー ID を設定する。"
2473 #: build/C/man2/semget.2:117
2475 "I<sem_perm.cgid> and I<sem_perm.gid> are set to the effective group ID of "
2476 "the calling process."
2478 "I<sem_perm.cgid> と I<sem_perm.gid> に、呼び出し元のプロセスの実効 "
2479 "(effective) グループ ID を設定する。"
2482 #: build/C/man2/semget.2:122
2484 "The least significant 9 bits of I<sem_perm.mode> are set to the least "
2485 "significant 9 bits of I<semflg>."
2487 "I<sem_perm.mode> の下位 9 ビットに I<semflg> の下位 9 ビットを設定する。"
2490 #: build/C/man2/semget.2:126
2491 msgid "I<sem_nsems> is set to the value of I<nsems>."
2492 msgstr "I<sem_nsems> に I<nsems> の値を設定する。"
2495 #: build/C/man2/semget.2:129
2496 msgid "I<sem_otime> is set to 0."
2497 msgstr "I<sem_otime> に 0 を設定する。"
2500 #: build/C/man2/semget.2:132
2501 msgid "I<sem_ctime> is set to the current time."
2502 msgstr "I<sem_ctime> に現在の時刻を設定する。"
2505 #: build/C/man2/semget.2:143
2507 "The argument I<nsems> can be 0 (a don't care) when a semaphore set is not "
2508 "being created. Otherwise, I<nsems> must be greater than 0 and less than or "
2509 "equal to the maximum number of semaphores per semaphore set (B<SEMMSL>)."
2511 "セマフォ集合の作成を行わない場合は、引き数 I<nsems> に (don't care を意味す"
2512 "る) 0 を指定してもよい。 そうでない場合は、 I<nsems> は 0 より大きい値でなけ"
2513 "ればならず、セマフォ集合あたりのセマフォの最大数 (B<SEMMSL>) 以下でなければ"
2516 #. and a check is made to see if it is marked for destruction.
2518 #: build/C/man2/semget.2:147
2519 msgid "If the semaphore set already exists, the permissions are verified."
2520 msgstr "セマフォ集合が既に存在した場合は、アクセス許可の検査が行われる。"
2523 #: build/C/man2/semget.2:153
2525 "If successful, the return value will be the semaphore set identifier (a "
2526 "nonnegative integer), otherwise, -1 is returned, with I<errno> indicating "
2529 "成功した場合、セマフォ集合の識別子 (非負の整数) が返り値となる。 失敗した場合"
2530 "は -1 が返され、 I<errno> にエラーを示す値が設定される。"
2533 #: build/C/man2/semget.2:165
2535 "A semaphore set exists for I<key>, but the calling process does not have "
2536 "permission to access the set, and does not have the B<CAP_IPC_OWNER> "
2539 "I<key> に対応するセマフォ集合は存在するが、 呼び出し元のプロセスはその集合へ"
2540 "のアクセス許可がなく、 B<CAP_IPC_OWNER> ケーパビリティも持っていない。"
2544 #. The semaphore set is marked to be deleted.
2546 #: build/C/man2/semget.2:177
2548 "B<IPC_CREAT> and B<IPC_EXCL> were specified in I<semflg>, but a semaphore "
2549 "set already exists for I<key>."
2551 "I<semflg> に B<IPC_CREAT> と B<IPC_EXCL> が指定されたが、 I<key> に対応するセ"
2555 #: build/C/man2/semget.2:183
2557 "I<nsems> is less than 0 or greater than the limit on the number of "
2558 "semaphores per semaphore set (B<SEMMSL>)."
2560 "I<nsems> が 0 より小さいか、 セマフォ集合あたりのセマフォの最大数 "
2561 "(B<SEMMSL>) より大きい。"
2564 #: build/C/man2/semget.2:190
2566 "A semaphore set corresponding to I<key> already exists, but I<nsems> is "
2567 "larger than the number of semaphores in that set."
2569 "I<key> に対応するセマフォ集合が既に存在するが、 I<nsems> がその集合のセマフォ"
2573 #: build/C/man2/semget.2:198
2575 "No semaphore set exists for I<key> and I<semflg> did not specify "
2578 "I<key> に対応するセマフォ集合が存在せず、 I<semflg> に B<IPC_CREAT> が指定さ"
2582 #: build/C/man2/semget.2:202
2584 "A semaphore set has to be created but the system does not have enough memory "
2585 "for the new data structure."
2587 "セマフォ集合を作成しようとしたが、新しいデータ構造体を 作成するのに十分なメモ"
2591 #: build/C/man2/semget.2:202
2597 #: build/C/man2/semget.2:210
2599 "A semaphore set has to be created but the system limit for the maximum "
2600 "number of semaphore sets (B<SEMMNI>), or the system wide maximum number of "
2601 "semaphores (B<SEMMNS>), would be exceeded."
2603 "セマフォ集合を作成しようとすると、システムのセマフォ集合の 最大数 "
2604 "(B<SEMMNI>) か、システム全体のセマフォの最大数 (B<SEMMNS>) のいずれかを超え"
2608 #: build/C/man2/semget.2:238
2610 "B<IPC_PRIVATE> isn't a flag field but a I<key_t> type. If this special "
2611 "value is used for I<key>, the system call ignores all but the least "
2612 "significant 9 bits of I<semflg> and creates a new semaphore set (on success)."
2614 "B<IPC_PRIVATE> はフラグフィールドに指定するものではなく、 I<key_t> 型であ"
2615 "る。 この特別な値が I<key> に指定されると、 B<semget>() I<semflg> の下位 9 "
2616 "ビット以外は全て無視し、 (成功した場合は) 新しいセマフォ集合を作成する。"
2619 #: build/C/man2/semget.2:238
2621 msgid "Semaphore initialization"
2624 #. In truth, every one of the many implementations that I've tested sets
2625 #. the values to zero, but I suppose there is/was some obscure
2626 #. implementation out there that does not.
2628 #: build/C/man2/semget.2:250
2630 "The values of the semaphores in a newly created set are indeterminate. "
2631 "(POSIX.1-2001 and POSIX.1-2008 are explicit on this point, although "
2632 "POSIX.1-2008 notes that a future version of the standard may require an "
2633 "implementation to initialize the semaphores to 0.) Although Linux, like "
2634 "many other implementations, initializes the semaphore values to 0, a "
2635 "portable application cannot rely on this: it should explicitly initialize "
2636 "the semaphores to the desired values."
2638 "新しく作成されたセマフォ集合の各セマフォの値は不定である。 (この点は "
2639 "POSIX.1-2001 と POSIX.1-2008 に明記されている。ただし、POSIX.1-2008 では "
2640 "POSIX の将来のバージョンではセマフォを 0 に初期化するように実装に要求する可能"
2641 "性が注記されている。) Linux は他の多くの実装と同様にセマフォ値を 0 に初期化す"
2642 "るが、 移植性を考慮したアプリケーションではこの動作を前提にすべきではない。 "
2643 "アプリケーションは明示的にセマフォを希望の値で初期化すべきである。"
2646 #: build/C/man2/semget.2:265
2648 "Initialization can be done using B<semctl>(2) B<SETVAL> or B<SETALL> "
2649 "operation. Where multiple peers do not know who will be the first to "
2650 "initialize the set, checking for a nonzero I<sem_otime> in the associated "
2651 "data structure retrieved by a B<semctl>(2) B<IPC_STAT> operation can be "
2652 "used to avoid races."
2654 "B<semctl>(2) の B<SETVAL> か B<SETALL> 操作を使って初期化することができる。 "
2655 "複数箇所からセマフォ集合の操作が行われる場面では、 誰が最初に集合を初期化すれ"
2656 "ばよいか分からない。 この状況を避けるには、 B<semctl>(2) の B<IPC_STAT> 操作"
2657 "で取得できるセマフォのデータ構造体の I<sem_otime> が 0 以外になっているかを"
2661 #: build/C/man2/semget.2:265 build/C/man2/semop.2:454
2663 msgid "Semaphore limits"
2667 #: build/C/man2/semget.2:269
2669 "The following limits on semaphore set resources affect the B<semget>() call:"
2671 "セマフォ集合のリソースに関する上限のうち、 B<semget>() に影響を及ぼすものを"
2675 #: build/C/man2/semget.2:269
2680 #. This /proc file is not available in Linux 2.2 and earlier -- MTK
2682 #: build/C/man2/semget.2:275
2684 "System-wide limit on the number of semaphore sets: policy dependent (on "
2685 "Linux, this limit can be read and modified via the fourth field of I</proc/"
2688 "システム全体のセマフォ集合の上限数: 方針依存 (Linux では、この制限値は I</"
2689 "proc/sys/kernel/sem> の第4フィールドに対応し、読み出しも変更もできる)。"
2692 #: build/C/man2/semget.2:275
2698 #: build/C/man2/semget.2:280
2700 "Maximum number of semaphores per semaphore ID: implementation dependent (on "
2701 "Linux, this limit can be read and modified via the first field of I</proc/"
2704 "セマフォ ID あたりのセマフォの最大数: 実装依存 (Linux では、この制限値は I</"
2705 "proc/sys/kernel/sem> の第1フィールドに対応し、読み出しも変更もできる)。"
2708 #: build/C/man2/semget.2:280
2714 #: build/C/man2/semget.2:290
2717 #| "System-wide limit on the number of semaphores: policy dependent (on "
2718 #| "Linux, this limit can be read and modified via the second field of I</"
2719 #| "proc/sys/kernel/sem>). Note that number of semaphores system-wide is "
2720 #| "also limited by the product of B<SEMMSL> and B<SEMMNI>."
2722 "System-wide limit on the number of semaphores: policy dependent (on Linux, "
2723 "this limit can be read and modified via the second field of I</proc/sys/"
2724 "kernel/sem>). Note that the number of semaphores system-wide is also "
2725 "limited by the product of B<SEMMSL> and B<SEMMNI>."
2727 "システム全体のセマフォ数の上限値: 方針依存 (Linux では、この上限値は I</proc/"
2728 "sys/kernel/sem> の第 2 フィールドであり、読み出しも変更もできる)。 システム全"
2729 "体のセマフォ数には、 B<SEMMSL> と B<SEMMNI> の積という上限もある。"
2732 #: build/C/man2/semget.2:290 build/C/man2/semop.2:478
2738 #: build/C/man2/semget.2:296
2740 "The name choice B<IPC_PRIVATE> was perhaps unfortunate, B<IPC_NEW> would "
2741 "more clearly show its function."
2743 "B<IPC_PRIVATE> という名前を選んだのはおそらく失敗であろう。 B<IPC_NEW> の方が"
2744 "より明確にその機能を表しているだろう。"
2747 #: build/C/man2/semget.2:303
2749 "B<semctl>(2), B<semop>(2), B<ftok>(3), B<capabilities>(7), "
2750 "B<sem_overview>(7), B<svipc>(7)"
2752 "B<semctl>(2), B<semop>(2), B<ftok>(3), B<capabilities>(7), "
2753 "B<sem_overview>(7), B<svipc>(7)"
2756 #: build/C/man2/semop.2:35
2762 #: build/C/man2/semop.2:35
2768 #: build/C/man2/semop.2:38
2769 msgid "semop, semtimedop - System V semaphore operations"
2770 msgstr "semop, semtimedop - System V セマフォの操作"
2773 #: build/C/man2/semop.2:45
2775 msgid "B<int semop(int >I<semid>B<, struct sembuf *>I<sops>B<, size_t >I<nsops>B<);>\n"
2776 msgstr "B<int semop(int >I<semid>B<, struct sembuf *>I<sops>B<, size_t >I<nsops>B<);>\n"
2779 #: build/C/man2/semop.2:48
2782 "B<int semtimedop(int >I<semid>B<, struct sembuf *>I<sops>B<, size_t >I<nsops>B<,>\n"
2783 "B< const struct timespec *>I<timeout>B<);>\n"
2785 "B<int semtimedop(int >I<semid>B<, struct sembuf *>I<sops>B<, size_t >I<nsops>B<,>\n"
2786 "B< const struct timespec *>I<timeout>B<);>\n"
2789 #: build/C/man2/semop.2:57
2790 msgid "B<semtimedop>(): _GNU_SOURCE"
2791 msgstr "B<semtimedop>(): _GNU_SOURCE"
2794 #: build/C/man2/semop.2:60
2796 "Each semaphore in a System\\ V semaphore set has the following associated "
2799 "System\\ V セマフォ集合 (semaphore set) のメンバーの各セマフォは 以下の関連情"
2803 #: build/C/man2/semop.2:67
2806 "unsigned short semval; /* semaphore value */\n"
2807 "unsigned short semzcnt; /* # waiting for zero */\n"
2808 "unsigned short semncnt; /* # waiting for increase */\n"
2809 "pid_t sempid; /* ID of process that did last op */\n"
2811 "unsigned short semval; /* セマフォ値 */\n"
2812 "unsigned short semzcnt; /* ゼロを待つプロセス数 */\n"
2813 "unsigned short semncnt; /* 増加を待つプロセス数 */\n"
2814 "pid_t sempid; /* 最後に操作を行なったプロセスの ID */\n"
2817 #: build/C/man2/semop.2:82
2819 "B<semop>() performs operations on selected semaphores in the set indicated "
2820 "by I<semid>. Each of the I<nsops> elements in the array pointed to by "
2821 "I<sops> is a structure that specifies an operation to be performed on a "
2822 "single semaphore. The elements of this structure are of type I<struct "
2823 "sembuf>, containing the following members:"
2825 "B<semop>() は I<semid> で指定されたセマフォ集合の選択されたセマフォに対して"
2826 "操作を行う。 I<sops> は I<nsops> 個の要素の配列を指し、配列の各要素は個々のセ"
2827 "マフォに対する操作を示す構造体である。その型は I<struct sembuf> で、次のメン"
2831 #: build/C/man2/semop.2:88
2834 "unsigned short sem_num; /* semaphore number */\n"
2835 "short sem_op; /* semaphore operation */\n"
2836 "short sem_flg; /* operation flags */\n"
2838 "unsigned short sem_num; /* セマフォ番号 */\n"
2839 "short sem_op; /* セマフォ操作 */\n"
2840 "short sem_flg; /* 操作フラグ */\n"
2843 #: build/C/man2/semop.2:100
2845 "Flags recognized in I<sem_flg> are B<IPC_NOWAIT> and B<SEM_UNDO>. If an "
2846 "operation specifies B<SEM_UNDO>, it will be automatically undone when the "
2847 "process terminates."
2849 "I<sem_flg> には B<IPC_NOWAIT> と B<SEM_UNDO> が設定できる。 B<SEM_UNDO> が指"
2850 "定された操作は、そのプロセスが終了した時に自動的に取り消される。"
2853 #: build/C/man2/semop.2:115
2855 "The set of operations contained in I<sops> is performed in I<array order>, "
2856 "and I<atomically>, that is, the operations are performed either as a "
2857 "complete unit, or not at all. The behavior of the system call if not all "
2858 "operations can be performed immediately depends on the presence of the "
2859 "B<IPC_NOWAIT> flag in the individual I<sem_flg> fields, as noted below."
2861 "I<sops> に含まれる操作の集合は、 I<配列の順序> で、 I<アトミックに> 実行され"
2862 "る。 すなわち、全ての操作が完全に実行されるか、全く実行されないかの どちらか"
2863 "となる。 全ての操作が直ちに実行できない場合のこのシステムコールの振る舞いは "
2864 "個々の操作の I<sem_flg> フィールドに B<IPC_NOWAIT> が存在するかによって決ま"
2868 #: build/C/man2/semop.2:122
2870 "Each operation is performed on the I<sem_num>-th semaphore of the semaphore "
2871 "set, where the first semaphore of the set is numbered 0. There are three "
2872 "types of operation, distinguished by the value of I<sem_op>."
2874 "それぞれの操作はセマフォ集合の I<sem_num>番目 のセマフォに対して実行される。"
2875 "セマフォ集合の最初のセマフォには 番号 0 が振られる。 そして操作は三種類あ"
2876 "り、 I<sem_op> の値で区別される。"
2879 #: build/C/man2/semop.2:137
2881 "If I<sem_op> is a positive integer, the operation adds this value to the "
2882 "semaphore value (I<semval>). Furthermore, if B<SEM_UNDO> is specified for "
2883 "this operation, the system subtracts the value I<sem_op> from the semaphore "
2884 "adjustment (I<semadj>) value for this semaphore. This operation can always "
2885 "proceed\\(emit never forces a thread to wait. The calling process must have "
2886 "alter permission on the semaphore set."
2888 "I<sem_op> が正の整数の場合、その値をセマフォの値 (I<semval>) に加算する。 さ"
2889 "らに、この操作で B<SEM_UNDO> が指定されていた場合は、 システムはこのセマフォ"
2890 "のの調整値 (I<semadj>) から値 I<sem_op> を減算する。 この操作は必ず実行で"
2891 "き、 スレッドの停止は起こらない。 呼び出し元プロセスは対象のセマフォ集合を変"
2895 #: build/C/man2/semop.2:162
2897 "If I<sem_op> is zero, the process must have read permission on the semaphore "
2898 "set. This is a \"wait-for-zero\" operation: if I<semval> is zero, the "
2899 "operation can immediately proceed. Otherwise, if B<IPC_NOWAIT> is specified "
2900 "in I<sem_flg>, B<semop>() fails with I<errno> set to B<EAGAIN> (and none of "
2901 "the operations in I<sops> is performed). Otherwise, I<semzcnt> (the count "
2902 "of threads waiting until this semaphore's value becomes zero) is "
2903 "incremented by one and the thread sleeps until one of the following occurs:"
2905 "I<sem_op> が 0 の場合、「ゼロまで待つ」操作である。この場合、プロセスは その"
2906 "セマフォ集合に対する読み込み許可がなければならない。 I<semval> が 0 ならば、"
2907 "操作は直ちに行われる。 I<semval> が 0 でない場合、 I<sem_flg> に "
2908 "B<IPC_NOWAIT> が指定されていれば、 B<semop>() は失敗し、 B<errno> に "
2909 "B<EAGAIN> が設定される (このとき I<sops> に対する操作は全く実行されない)。 "
2910 "I<sem_flg> に B<IPC_NOWAIT> が指定されていない場合、 I<semzcnt> (セマフォ値"
2911 "が 0 になるのを待っているスレッドの数) を 1 増加させて、 以下のいずれかが起こ"
2912 "るまでスレッドを停止 (sleep) する。"
2915 #: build/C/man2/semop.2:162 build/C/man2/semop.2:167 build/C/man2/semop.2:175
2916 #: build/C/man2/semop.2:227 build/C/man2/semop.2:232 build/C/man2/semop.2:239
2922 #: build/C/man2/semop.2:167
2924 "I<semval> becomes 0, at which time the value of I<semzcnt> is decremented."
2925 msgstr "I<semval> が 0 になった: このとき I<semzcnt> の値は 1 減算される。"
2928 #: build/C/man2/semop.2:175
2930 "The semaphore set is removed: B<semop>() fails, with I<errno> set to "
2933 "セマフォ集合が削除された: このとき B<semop>() は失敗し、 I<errno> に "
2937 #: build/C/man2/semop.2:185
2939 "The calling thread catches a signal: the value of I<semzcnt> is decremented "
2940 "and B<semop>() fails, with I<errno> set to B<EINTR>."
2942 "呼び出し元スレッドがシグナルを捕獲した: このとき I<semzcnt> の値は 1 減算さ"
2943 "れ、 B<semop>() は失敗し I<errno> に B<EINTR> が設定される。"
2946 #: build/C/man2/semop.2:227
2948 "If I<sem_op> is less than zero, the process must have alter permission on "
2949 "the semaphore set. If I<semval> is greater than or equal to the absolute "
2950 "value of I<sem_op>, the operation can proceed immediately: the absolute "
2951 "value of I<sem_op> is subtracted from I<semval>, and, if B<SEM_UNDO> is "
2952 "specified for this operation, the system adds the absolute value of "
2953 "I<sem_op> to the semaphore adjustment (I<semadj>) value for this "
2954 "semaphore. If the absolute value of I<sem_op> is greater than I<semval>, "
2955 "and B<IPC_NOWAIT> is specified in I<sem_flg>, B<semop>() fails, with "
2956 "I<errno> set to B<EAGAIN> (and none of the operations in I<sops> is "
2957 "performed). Otherwise, I<semncnt> (the counter of threads waiting for this "
2958 "semaphore's value to increase) is incremented by one and the thread sleeps "
2959 "until one of the following occurs:"
2961 "I<sem_op> が 0 未満の場合、プロセスにはそのセマフォ集合を変更する許可がなけれ"
2962 "ば ならない。 I<semval> が I<sem_op> の絶対値以上の場合は、操作は直ちに実行さ"
2963 "れる: I<semval> から I<sem_op> の絶対値を減算し、さらに、この操作に "
2964 "B<SEM_UNDO> が指定されている場合は、このセマフォの調整値 (I<semadj>) に "
2965 "I<sem_op> の絶対値を加算する。 I<semval> が I<sem_op> の絶対値より小さく、 "
2966 "I<sem_flg> に B<IPC_NOWAIT> が指定された場合は、 B<semop>() は失敗し、 "
2967 "I<errno> に B<EAGAIN> が設定される (このとき I<sops> の操作は全く実行されな"
2968 "い)。 I<semval> が I<sem_op> の絶対値より小さく、 B<IPC_WAIT> が指定されてい"
2969 "ない場合は、 I<semncnt> (このセマフォの値が増加するのを待っているスレッド数の"
2970 "カウンター) を 1 増加させて、以下のいずれかが起こるまでスレッドを停止 "
2974 #: build/C/man2/semop.2:232
2976 "I<semval> becomes greater than or equal to the absolute value of I<sem_op>: "
2977 "the operation now proceeds, as described above."
2979 "I<semval> が I<sem_op> の絶対値以上になった。この時点で、操作は上述の通り実行"
2983 #: build/C/man2/semop.2:239
2985 "The semaphore set is removed from the system: B<semop>() fails, with "
2986 "I<errno> set to B<EIDRM>."
2988 "セマフォ集合がシステムから削除された: このとき B<semop>() は失敗し I<errno> "
2989 "に B<EIDRM> が設定される。"
2992 #: build/C/man2/semop.2:249
2994 "The calling thread catches a signal: the value of I<semncnt> is decremented "
2995 "and B<semop>() fails, with I<errno> set to B<EINTR>."
2997 "呼び出したスレッドがシグナルを捕獲した: このとき I<semncnt> が 1 減算され、 "
2998 "B<semop>() は失敗し I<errno> に B<EINTR> が設定される。"
3003 #: build/C/man2/semop.2:260
3005 "On successful completion, the I<sempid> value for each semaphore specified "
3006 "in the array pointed to by I<sops> is set to the caller's process ID. In "
3007 "addition, the I<sem_otime> is set to the current time."
3009 "操作が成功した場合、 I<sops> が指す配列によって操作対象となった各セマフォの "
3010 "I<sempid> メンバーには呼び出し元のプロセス ID が設定される。さらに "
3011 "I<sem_otime> に現在時刻が設定される。"
3014 #: build/C/man2/semop.2:260
3016 msgid "semtimedop()"
3017 msgstr "semtimedop()"
3020 #: build/C/man2/semop.2:290
3022 "B<semtimedop>() behaves identically to B<semop>() except that in those "
3023 "cases where the calling thread would sleep, the duration of that sleep is "
3024 "limited by the amount of elapsed time specified by the I<timespec> structure "
3025 "whose address is passed in the I<timeout> argument. (This sleep interval "
3026 "will be rounded up to the system clock granularity, and kernel scheduling "
3027 "delays mean that the interval may overrun by a small amount.) If the "
3028 "specified time limit has been reached, B<semtimedop>() fails with I<errno> "
3029 "set to B<EAGAIN> (and none of the operations in I<sops> is performed). If "
3030 "the I<timeout> argument is NULL, then B<semtimedop>() behaves exactly like "
3033 "B<semtimedop>() 関数の振る舞いは B<semop>() と全く同じだが、呼び出し元\n"
3034 "スレッドが停止する場合、停止期間の上限が I<timeout> 引き数の指す\n"
3035 "I<timespec> 構造体で指定された時間となる点だけが異なる (この停止期間は\n"
3036 "システムクロックの粒度に切り上げられ、カーネルのスケジューリング遅延に\n"
3037 "より、この停止期間は少しだけ長くなる可能性がある)。\n"
3038 "指定した制限時間に達した場合は、 B<semtimedop>() は失敗し、 I<errno> に\n"
3039 "B<EAGAIN> が設定される (このとき I<sops> の操作は実行されない)。\n"
3040 "I<timeout> 引き数が NULL の場合、 B<semtimedop>() 関数の振る舞いは\n"
3041 "B<semop>() 関数と全く同じになる。"
3044 #: build/C/man2/semop.2:298
3046 "Note that if B<semtimeop>() is interrupted by a signal, causing the call to "
3047 "fail with the error B<EINTR>, the contents of I<timeout> are left unchanged."
3049 "B<semtimeop>() がシグナルにより割り込まれた場合、呼び出しはエラー B<EINTR> で"
3050 "失敗し、 I<timeout> の内容は変更されないままとなる点に注意すること。"
3053 #: build/C/man2/semop.2:308
3055 "If successful, B<semop>() and B<semtimedop>() return 0; otherwise they "
3056 "return -1 with I<errno> indicating the error."
3058 "成功した場合、 B<semop>() と B<semtimedop>() は 0 を返す。そうでなければ "
3059 "-1 を返し、 エラーを示す I<errno> を設定する。"
3062 #: build/C/man2/semop.2:312
3063 msgid "On failure, I<errno> is set to one of the following:"
3064 msgstr "失敗した場合、 I<errno> に以下のどれかが設定される:"
3067 #: build/C/man2/semop.2:312
3073 #: build/C/man2/semop.2:320
3075 "The argument I<nsops> is greater than B<SEMOPM>, the maximum number of "
3076 "operations allowed per system call."
3078 "I<nsops> 引き数が B<SEMOPM> より大きい。 B<SEMOPM> は一回のシステムコールで許"
3082 #: build/C/man2/semop.2:327
3084 "The calling process does not have the permissions required to perform the "
3085 "specified semaphore operations, and does not have the B<CAP_IPC_OWNER> "
3088 "呼び出し元プロセスには指定されたセマフォ操作を行うのに 必要なアクセス許可がな"
3089 "く、 B<CAP_IPC_OWNER> ケーパビリティもない。"
3092 #: build/C/man2/semop.2:336
3094 "An operation could not proceed immediately and either B<IPC_NOWAIT> was "
3095 "specified in I<sem_flg> or the time limit specified in I<timeout> expired."
3097 "操作を直ちに処理することができず、かつ I<sem_flg> に B<IPC_NOWAIT> が指定され"
3098 "ているか I<timeout> で指定された制限時間が経過した。"
3101 #: build/C/man2/semop.2:343
3103 "An address specified in either the I<sops> or the I<timeout> argument isn't "
3105 msgstr "引き数 I<sops> か I<timeout> が指しているアドレスにアクセスできない。"
3108 #: build/C/man2/semop.2:343
3114 #: build/C/man2/semop.2:349
3116 "For some operation the value of I<sem_num> is less than 0 or greater than or "
3117 "equal to the number of semaphores in the set."
3119 "ある操作で、 I<sem_num> の値が 0 未満か、集合内のセマフォの数以上である。"
3122 #: build/C/man2/semop.2:356
3124 "While blocked in this system call, the thread caught a signal; see "
3127 "このシステムコールで停止している時にスレッドがシグナルを捕獲した。 "
3131 #: build/C/man2/semop.2:363
3133 "The semaphore set doesn't exist, or I<semid> is less than zero, or I<nsops> "
3134 "has a nonpositive value."
3136 "セマフォ集合が存在しないか、 I<semid> が 0 未満であるか、 I<nsops> が正の数で"
3140 #: build/C/man2/semop.2:371
3142 "The I<sem_flg> of some operation specified B<SEM_UNDO> and the system does "
3143 "not have enough memory to allocate the undo structure."
3145 "ある操作で I<sem_flg> に B<SEM_UNDO> が指定されたが、システムにアンドゥ構造体"
3149 #: build/C/man2/semop.2:379
3151 "For some operation I<sem_op+semval> is greater than B<SEMVMX>, the "
3152 "implementation dependent maximum value for I<semval>."
3154 "ある操作で I<sem_op+semval> が B<SEMVMX> より大きい。 B<SEMVMX> は I<semval> "
3155 "の最大値で、その値は実装依存である。"
3158 #: build/C/man2/semop.2:379
3164 #: build/C/man2/semop.2:386
3166 "B<semtimedop>() first appeared in Linux 2.5.52, and was subsequently "
3167 "backported into kernel 2.4.22. Glibc support for B<semtimedop>() first "
3168 "appeared in version 2.3.3."
3170 "B<semtimedop>() は Linux 2.5.52 で初めて登場し、 それからカーネル 2.4.22 に"
3171 "も移植された。 B<semtimedop>() の glibc でのサポートはバージョン 2.3.3 で初"
3175 #: build/C/man2/semop.2:410
3177 "The I<sem_undo> structures of a process aren't inherited by the child "
3178 "produced by B<fork>(2), but they are inherited across an B<execve>(2) "
3181 "あるプロセスの I<sem_undo> 構造体は B<fork>(2) で生成された子プロセスには継"
3182 "承されないが、 B<execve>(2) システムコールの場合は継承される。"
3185 #: build/C/man2/semop.2:416
3187 "B<semop>() is never automatically restarted after being interrupted by a "
3188 "signal handler, regardless of the setting of the B<SA_RESTART> flag when "
3189 "establishing a signal handler."
3191 "B<semop>() はシグナルハンドラーによって中断された後に、 決して自動的に再開す"
3192 "ることはない。 たとえシグナルハンドラーの設定時に B<SA_RESTART> フラグがセッ"
3196 #: build/C/man2/semop.2:449
3198 "A semaphore adjustment (I<semadj>) value is a per-process, per-semaphore "
3199 "integer that is the negated sum of all operations performed on a semaphore "
3200 "specifying the B<SEM_UNDO> flag. Each process has a list of I<semadj> values"
3201 "\\(emone value for each semaphore on which it has operated using "
3202 "B<SEM_UNDO>. When a process terminates, each of its per-semaphore I<semadj> "
3203 "values is added to the corresponding semaphore, thus undoing the effect of "
3204 "that process's operations on the semaphore (but see BUGS below). When a "
3205 "semaphore's value is directly set using the B<SETVAL> or B<SETALL> request "
3206 "to B<semctl>(2), the corresponding I<semadj> values in all processes are "
3207 "cleared. The B<clone>(2) B<CLONE_SYSVSEM> flag allows more than one "
3208 "process to share a I<semadj> list; see B<clone>(2) for details."
3210 "セマフォの調整値 (I<semadj>) は、プロセス毎のセマフォ毎の整数で、 "
3211 "B<SEM_UNDO> フラグを指定して行われた、セマフォに対するすべての操作の合計値を"
3212 "反転したものである。 各プロセスは I<semadj> の値のリストを保持する \\(em リス"
3213 "トのそれぞれの値は B<SEM_UNDO> を使って操作が行われた個々のセマフォに対応す"
3214 "る。 プロセスが終了する際、 セマフォ毎の I<semadj> の各々の値が対応するセマ"
3215 "フォに加算される。 これにより、そのプロセスがそのセマフォに対して行った操作の"
3216 "影響が取り消される (ただし、下記の「バグ」を参照)。 B<semctl>(2) の "
3217 "B<SETVAL> や B<SETALL> を使ってセマフォの値が直接設定された場合、 すべてのプ"
3218 "ロセスの対応する I<semadj> の値がクリアされる。 B<clone>(2) の "
3219 "B<CLONE_SYSVSEM> フラグを使うと、 複数のプロセスがひとつの I<semadj> リストを"
3220 "共有できる。 詳細は B<clone>(2) を参照。"
3223 #: build/C/man2/semop.2:454
3225 "The I<semval>, I<sempid>, I<semzcnt>, and I<semnct> values for a semaphore "
3226 "can all be retrieved using appropriate B<semctl>(2) calls."
3228 "あるセマフォの I<semval>, I<sempid>, I<semzcnt>, I<semnct> の値はいずれも、適"
3229 "切な操作を指定して B<semctl>(2) を呼び出すことで取得できる。"
3232 #: build/C/man2/semop.2:458
3234 "The following limits on semaphore set resources affect the B<semop>() call:"
3236 "セマフォ集合のリソースに関する制限のうち、 B<semop>() に影響を及ぼすものを以"
3240 #: build/C/man2/semop.2:458
3245 #. This /proc file is not available in Linux 2.2 and earlier -- MTK
3247 #: build/C/man2/semop.2:466
3249 "Maximum number of operations allowed for one B<semop>() call (32) (on "
3250 "Linux, this limit can be read and modified via the third field of I</proc/"
3253 "一回の B<semop>() で許される操作の最大数 (32)。 (Linux では、この制限値は "
3254 "I</proc/sys/kernel/sem> の第3フィールドに対応し、読み出しも変更もできる)。"
3257 #: build/C/man2/semop.2:471
3259 "Maximum allowable value for I<semval>: implementation dependent (32767)."
3260 msgstr "I<semval> が取り得る最大値: 実装依存 (32767)。"
3263 #: build/C/man2/semop.2:478
3265 "The implementation has no intrinsic limits for the adjust on exit maximum "
3266 "value (B<SEMAEM>), the system wide maximum number of undo structures "
3267 "(B<SEMMNU>) and the per-process maximum number of undo entries system "
3270 "以下の値に関しては実装依存の制限はない。 終了時の調整 (adjust on exit) の最大"
3271 "値 (B<SEMAEM>)、 システム全体のアンドゥ構造体の最大数 (B<SEMMNU>)、 プロセス"
3275 #: build/C/man2/semop.2:499
3277 "When a process terminates, its set of associated I<semadj> structures is "
3278 "used to undo the effect of all of the semaphore operations it performed with "
3279 "the B<SEM_UNDO> flag. This raises a difficulty: if one (or more) of these "
3280 "semaphore adjustments would result in an attempt to decrease a semaphore's "
3281 "value below zero, what should an implementation do? One possible approach "
3282 "would be to block until all the semaphore adjustments could be performed. "
3283 "This is however undesirable since it could force process termination to "
3284 "block for arbitrarily long periods. Another possibility is that such "
3285 "semaphore adjustments could be ignored altogether (somewhat analogously to "
3286 "failing when B<IPC_NOWAIT> is specified for a semaphore operation). Linux "
3287 "adopts a third approach: decreasing the semaphore value as far as possible "
3288 "(i.e., to zero) and allowing process termination to proceed immediately."
3290 "プロセスが終了する際、プロセスに対応する I<semadj> の集合を使って、 "
3291 "B<SEM_UNDO> フラグ付きで実行された全てのセマフォ操作の影響を取り消す。 これに"
3292 "よりある問題が発生する: これらのセマフォの調整を行っていると、 中にはセマフォ"
3293 "の値が 0 未満の値にしようとする場合が出てくる。 このような場合、どのように実"
3294 "装するべきか? ひとつの考えられる手法は、全てのセマフォ調整が実行されるまで 停"
3295 "止することである。しかし、この方法ではプロセスの終了が 長時間にわたって停止さ"
3296 "れることがあるので望ましくない。 しかもどれくらい長時間になるかは分からな"
3297 "い。 別の選択肢として、このようなセマフォ調整を完全に無視してしまう方法があ"
3298 "る (これはセマフォ操作として B<IPC_NOWAIT> が指定するのと少し似ている)。 "
3299 "Linux は第三の手法を採用している: セマフォの値を出来るだけ (つまり 0 まで) 減"
3300 "少させて、プロセスの終了を直ちに続行できるようにしている。"
3303 #. http://marc.theaimsgroup.com/?l=linux-kernel&m=110260821123863&w=2
3305 #. http://marc.theaimsgroup.com/?l=linux-kernel&m=110261701025794&w=2
3307 #: build/C/man2/semop.2:508
3309 "In kernels 2.6.x, x E<lt>= 10, there is a bug that in some circumstances "
3310 "prevents a thread that is waiting for a semaphore value to become zero from "
3311 "being woken up when the value does actually become zero. This bug is fixed "
3314 "カーネル 2.6.x (x E<lt>= 10) には、ある状況においてセマフォ値が 0 になるのを "
3315 "待っているスレッドが、セマフォ値が実際に 0 になったときに起床 (wake up) され"
3316 "ない、というバグがある。このバグはカーネル 2.6.11 で修正されている。"
3319 #: build/C/man2/semop.2:513
3321 "The following code segment uses B<semop>() to atomically wait for the value "
3322 "of semaphore 0 to become zero, and then increment the semaphore value by one."
3324 "以下の部分的なコードは、 セマフォ 0 の値が 0 になるのを待ってから、 セマフォ"
3325 "の値を 1 加算する処理を、 B<semop>() を使ってアトミック (atomically) に行"
3329 #: build/C/man2/semop.2:517
3332 " struct sembuf sops[2];\n"
3335 " struct sembuf sops[2];\n"
3339 #: build/C/man2/semop.2:519
3341 msgid " /* Code to set I<semid> omitted */\n"
3342 msgstr " /* Code to set I<semid> omitted */\n"
3345 #: build/C/man2/semop.2:523
3348 " sops[0].sem_num = 0; /* Operate on semaphore 0 */\n"
3349 " sops[0].sem_op = 0; /* Wait for value to equal 0 */\n"
3350 " sops[0].sem_flg = 0;\n"
3352 " sops[0].sem_num = 0; /* Operate on semaphore 0 */\n"
3353 " sops[0].sem_op = 0; /* Wait for value to equal 0 */\n"
3354 " sops[0].sem_flg = 0;\n"
3357 #: build/C/man2/semop.2:527
3360 " sops[1].sem_num = 0; /* Operate on semaphore 0 */\n"
3361 " sops[1].sem_op = 1; /* Increment value by one */\n"
3362 " sops[1].sem_flg = 0;\n"
3364 " sops[1].sem_num = 0; /* Operate on semaphore 0 */\n"
3365 " sops[1].sem_op = 1; /* Increment value by one */\n"
3366 " sops[1].sem_flg = 0;\n"
3369 #: build/C/man2/semop.2:532
3372 " if (semop(semid, sops, 2) == -1) {\n"
3373 " perror(\"semop\");\n"
3374 " exit(EXIT_FAILURE);\n"
3377 " if (semop(semid, sops, 2) == -1) {\n"
3378 " perror(\"semop\");\n"
3379 " exit(EXIT_FAILURE);\n"
3383 #: build/C/man2/semop.2:542
3385 "B<clone>(2), B<semctl>(2), B<semget>(2), B<sigaction>(2), "
3386 "B<capabilities>(7), B<sem_overview>(7), B<svipc>(7), B<time>(7)"
3388 "B<clone>(2), B<semctl>(2), B<semget>(2), B<sigaction>(2), "
3389 "B<capabilities>(7), B<sem_overview>(7), B<svipc>(7), B<time>(7)"