OSDN Git Service

(split) LDP: Update draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / semctl.2
index 3e00ea9..5769ef8 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it)
 .\" and Copyright 2004, 2005 Michael Kerrisk <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -20,6 +21,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Tue Oct 22 17:53:56 1996 by Eric S. Raymond <esr@thyrsus.com>
 .\" Modified Fri Jun 19 10:59:15 1998 by Andries Brouwer <aeb@cwi.nl>
@@ -41,9 +43,9 @@
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH SEMCTL 2 2009\-09\-27 Linux "Linux Programmer's Manual"
+.TH SEMCTL 2 2013\-06\-03 Linux "Linux Programmer's Manual"
 .SH 名前
-semctl \- セマフォの制御操作を行なう
+semctl \- System V セマフォの制御操作を行なう
 .SH 書式
 .nf
 \fB#include <sys/types.h>\fP
@@ -53,8 +55,8 @@ semctl \- セマフォの制御操作を行なう
 \fBint semctl(int \fP\fIsemid\fP\fB, int \fP\fIsemnum\fP\fB, int \fP\fIcmd\fP\fB, ...);\fP
 .fi
 .SH 説明
-\fBsemctl\fP()  は、 \fIsemid\fP で指定されたセマフォ集合 (semaphore set)  またはセマフォ集合の \fIsemnun\fP
-番目のセマフォに対して、 \fIcmd\fP で指定された制御操作を行なう (集合内のセマフォの番号は 0 から始まる)。
+\fBsemctl\fP()  は、 \fIsemid\fP で指定された System V セマフォ集合 (semaphore set)  またはセマフォ集合の
+\fIsemnun\fP 番目のセマフォに対して、 \fIcmd\fP で指定された制御操作を行なう (集合内のセマフォの番号は 0 から始まる)。
 .PP
 この関数は、 \fIcmd\fP の値に依存して、3 個または 4 個の引き数を持つ。 引き数が 4 個の場合、第 4 引き数の型は \fIunion
 semun\fP である。 \fI呼び出し元プログラム\fPは、 この共用体 (union) を以下のように定義しなければならない。
@@ -79,13 +81,12 @@ struct semid_ds {
     struct ipc_perm sem_perm;  /* 所有権と許可 */
     time_t          sem_otime; /* 最後の semop の時刻 */
     time_t          sem_ctime; /* 最後に変更が行われた時刻 */
-    unsigned short  sem_nsems; /* 集合内のセマフォの数 */
+    unsigned long   sem_nsems; /* 集合内のセマフォの数 */
 };
 .in
 .fi
 .PP
-\fIipc_perm\fP 構造体は \fI<sys/ipc.h>\fP で以下のように定義されている (強調されたフィールドは
-\fBIPC_SET\fP を使って設定可能である):
+\fIipc_perm\fP 構造体は以下のように定義されている (強調されたフィールドは \fBIPC_SET\fP を使って設定可能である):
 .PP
 .nf
 .in +4n
@@ -101,7 +102,7 @@ struct ipc_perm {
 .in
 .fi
 .PP
-\fIcmd\fP として有効な値は
+\fIcmd\fP として有効な値は次の通りである。
 .TP  10
 \fBIPC_STAT\fP
 \fIsemid\fP に関連づけられたカーネルデータ構造体の情報を \fIarg.buf\fP で指された \fIsemid_ds\fP 構造体へコピーする。
@@ -247,7 +248,18 @@ struct  seminfo {
 .SH 準拠
 .\" SVr4 documents more error conditions EINVAL and EOVERFLOW.
 SVr4, POSIX.1\-2001.
+
+POSIX.1\-2001 specifies the \fIsem_nsems\fP field of the \fIsemid_ds\fP structure
+as having the type \fIunsigned\ short\fP, and the field is so defined on most
+other systems.  It was also so defined on Linux 2.2 and earlier, but, since
+Linux 2.4, the field has the type \fIunsigned\ long\fP.
 .SH 注意
+.\" Like Linux, the FreeBSD man pages still document
+.\" the inclusion of these header files.
+Linux や POSIX の全てのバージョンでは、 \fI<sys/types.h>\fP と \fI<sys/ipc.h>\fP
+のインクルードは必要ない。しかしながら、いくつかの古い実装ではこれらのヘッダファイルのインクルードが必要であり、 SVID
+でもこれらのインクルードをするように記載されている。このような古いシステムへの移植性を意図したアプリケーションではこれらのファイルをインクルードする必要があるかもしれない。
+
 \fBIPC_INFO\fP, \fBSEM_STAT\fP, \fBSEM_INFO\fP 操作は \fBipcs\fP(1)
 プログラムによって割当られた資源について情報を提供するために使用される。 将来的にはこれらは変更されるか、 /proc
 ファイル・システム・インタフェースに移動されるかもしれない。
@@ -270,6 +282,6 @@ POSIX.1\-2001 では呼び出し側がこの共用体を定義する必要があ
 \fBipc\fP(2), \fBsemget\fP(2), \fBsemop\fP(2), \fBcapabilities\fP(7),
 \fBsem_overview\fP(7), \fBsvipc\fP(7)
 .SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。