OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man3 / sem_init.3
index 471c942..17ed348 100644 (file)
@@ -1,4 +1,4 @@
-'\" t
+.\" t
 .\" Hey Emacs! This file is -*- nroff -*- source.
 .\"
 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
-.\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
-.\" Translated 2006-04-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"*******************************************************************
 .\"
-.TH SEM_INIT 3 2008-07-27 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH SEM_INIT 3 2008\-07\-27 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O sem_init \- initialize an unnamed semaphore
 sem_init \- 名前なしセマフォを初期化する
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <semaphore.h>
+\fB#include <semaphore.h>\fP
 .sp
-.BI "int sem_init(sem_t *" sem ", int " pshared ", unsigned int " value );
+\fBint sem_init(sem_t *\fP\fIsem\fP\fB, int \fP\fIpshared\fP\fB, unsigned int \fP\fIvalue\fP\fB);\fP
 .fi
 .sp
-.\"O Link with \fI\-lrt\fP or \fI\-pthread\fP.
 \fI\-lrt\fP または \fI\-pthread\fP でリンクする。
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O .BR sem_init ()
-.\"O initializes the unnamed semaphore at the address pointed to by
-.\"O .IR sem .
-.\"O The
-.\"O .I value
-.\"O argument specifies the initial value for the semaphore.
-.BR sem_init ()
-は、
-.I sem
-が指すアドレスにある名前なしセマフォを初期化する。
-.I value
+\fBsem_init\fP()  は、 \fIsem\fP が指すアドレスにある名前なしセマフォを初期化する。 \fIvalue\fP
 引き数はそのセマフォの初期値を指定する。
 
-.\"O The
-.\"O .I pshared
-.\"O argument indicates whether this semaphore is to be shared
-.\"O between the threads of a process, or between processes.
-.I pshared
-引き数は、このセマフォがプロセス内のスレッド間で共有されるのか、
-プロセス間で共有されるのか、を示す。
+\fIpshared\fP 引き数は、このセマフォがプロセス内のスレッド間で共有されるのか、 プロセス間で共有されるのか、を示す。
 
-.\"O If
-.\"O .I pshared
-.\"O has the value 0,
-.\"O then the semaphore is shared between the threads of a process,
-.\"O and should be located at some address that is visible to all threads
-.\"O (e.g., a global variable, or a variable allocated dynamically on
-.\"O the heap).
-.I pshared
-が 0 の場合、セマフォはプロセス内のスレッド間で共有される。
-セマフォはすべてのスレッドから参照可能なアドレスに配置すべきである
+\fIpshared\fP が 0 の場合、セマフォはプロセス内のスレッド間で共有される。 セマフォはすべてのスレッドから参照可能なアドレスに配置すべきである
 (例えば、大域変数や、ヒープ上に動的に割り当てられた変数など)。
 
-.\"O If
-.\"O .I pshared
-.\"O is nonzero, then the semaphore is shared between processes,
-.\"O and should be located in a region of shared memory (see
-.\"O .BR shm_open (3),
-.\"O .BR mmap (2),
-.\"O and
-.\"O .BR shmget (2)).
-.\"O (Since a child created by
-.\"O .BR fork (2)
-.\"O inherits its parent's memory mappings, it can also access the semaphore.)
-.\"O Any process that can access the shared memory region
-.\"O can operate on the semaphore using
-.\"O .BR sem_post (3),
-.\"O .BR sem_wait (3),
-.\"O etc.
-.I pshared
-が 0 以外の場合、セマフォはプロセス間で共有される。セマフォは
-共有メモリ領域に配置すべきである
-.RB ( shm_open (3),
-.BR mmap (2),
-.BR shmget (2)
-参照)。
-.RB ( fork (2)
-で生成された子プロセスは親プロセスのメモリマッピングを継承するため、
-子プロセスもセマフォにアクセスできる。)
-共有メモリ領域にアクセスできるプロセスならば、どのプロセスでも
-.BR sem_post (3)
-や
-.BR sem_wait (3)
+\fIpshared\fP が 0 以外の場合、セマフォはプロセス間で共有される。セマフォは 共有メモリ領域に配置すべきである
+(\fBshm_open\fP(3), \fBmmap\fP(2), \fBshmget\fP(2)  参照)。 (\fBfork\fP(2)
+で生成された子プロセスは親プロセスのメモリマッピングを継承するため、 子プロセスもセマフォにアクセスできる。)
+共有メモリ領域にアクセスできるプロセスならば、どのプロセスでも \fBsem_post\fP(3)  や \fBsem_wait\fP(3)
 などを使ってセマフォを操作できる。
 
-.\"O Initializing a semaphore that has already been initialized
-.\"O results in undefined behavior.
 すでに初期化済のセマフォを初期化した場合の挙動は定義されていない。
-.\"O .SH RETURN VALUE
 .SH 返り値
-.\"O .BR sem_init ()
-.\"O returns 0 on success;
-.\"O on error, \-1 is returned, and
-.\"O .I errno
-.\"O is set to indicate the error.
-成功すると、
-.BR sem_init ()
-は 0 を返す。エラーの場合、\-1 を返し、
-.I errno
-にエラーを示す値をセットする。
-.\"O .SH ERRORS
+成功すると、 \fBsem_init\fP()  は 0 を返す。エラーの場合、\-1 を返し、 \fIerrno\fP にエラーを示す値をセットする。
 .SH エラー
-.TP
-.B EINVAL
-.\"O .I value
-.\"O exceeds
-.\"O .BR SEM_VALUE_MAX .
-.I value
-が
-.B SEM_VALUE_MAX
-を超えている。
-.TP
-.B ENOSYS
-.\"O .I pshared
-.\"O is nonzero,
-.\"O but the system does not support process-shared semaphores (see
-.\"O .BR sem_overview (7)).
-.I pshared
-が 0 以外だが、システムがプロセス共有セマフォをサポートしていない
-.RB ( sem_overview (7)
-参照)。
-.\"O .SH CONFORMING TO
+.TP 
+\fBEINVAL\fP
+\fIvalue\fP が \fBSEM_VALUE_MAX\fP を超えている。
+.TP 
+\fBENOSYS\fP
+\fIpshared\fP が 0 以外だが、システムがプロセス共有セマフォをサポートしていない (\fBsem_overview\fP(7)  参照)。
 .SH 準拠
-POSIX.1-2001.
-.\"O .SH NOTES
+POSIX.1\-2001.
 .SH 注意
-.\"O Bizarrely, POSIX.1-2001 does not specify the value that should
-.\"O be returned by a successful call to
-.\"O .BR sem_init ().
-.\"O POSIX.1-2008 rectifies this, specifying the zero return on success.
-妙なことに、POSIX.1-2001 は
-.BR sem_init ()
-が成功した場合に返すべき値を規定していない。
-POSIX.1-2008 ではこれが修正され、成功時には 0 を返すことが規定された。
-.\"O .SH "SEE ALSO"
+妙なことに、POSIX.1\-2001 は \fBsem_init\fP()  が成功した場合に返すべき値を規定していない。 POSIX.1\-2008
+ではこれが修正され、成功時には 0 を返すことが規定された。
 .SH 関連項目
-.BR sem_destroy (3),
-.BR sem_post (3),
-.BR sem_wait (3),
-.BR sem_overview (7)
+\fBsem_destroy\fP(3), \fBsem_post\fP(3), \fBsem_wait\fP(3), \fBsem_overview\fP(7)