OSDN Git Service

(split) LDP: Update release pages
[linuxjm/LDP_man-pages.git] / release / man2 / semctl.2
index 7da4e91..755e15f 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>
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH SEMCTL 2 2009\-09\-27 Linux "Linux Programmer's Manual"
+.\"
+.\" Japanese Version Copyright (c) 1997,1998 HANATAKA Shinya
+.\"         all rights reserved.
+.\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Modified 1998-09-10, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
+.\" Updated & Modified 2001-06-03, Yuichi SATO <ysato@h4.dion.ne.jp>
+.\" Updated & Modified 2002-01-02, Yuichi SATO
+.\" Updated & Modified 2005-01-03, Yuichi SATO <ysato444@yahoo.co.jp>
+.\" Updated & Modified 2005-10-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
+.\" Updated 2013-07-24, Akihiro MOTOKI <amotoki@gmail.com>
+.\"
+.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 +67,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 +93,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 +114,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,9 +260,19 @@ struct  seminfo {
 .SH 準拠
 .\" SVr4 documents more error conditions EINVAL and EOVERFLOW.
 SVr4, POSIX.1\-2001.
+
+POSIX.1\-2001 では \fIsemid_ds\fP 構造体の \fIsem_nsems\fP フィールドは \fIunsigned\ short\fP
+型を持つと規定されており、 他のほとんどのシステムでこのフィールドは \fIunsigned\ short\fP 型になっている。 Linux 2.4
+以前ではそうなっていたが、 Linux 2.4 以降ではこのフィールドは \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
+プログラムによって割当られた資源について情報を提供するために使用される。 将来的にはこれらは変更されるか、 \fI/proc\fP
 ファイル・システム・インタフェースに移動されるかもしれない。
 .LP
 \fI構造体 semid_ds\fP 内の多くのフィールドは、 Linux 2.2 では \fIshort\fP 型だったが、Linux 2.4 では
@@ -270,6 +293,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.41 の一部
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
 である。プロジェクトの説明とバグ報告に関する情報は
 http://www.kernel.org/doc/man\-pages/ に書かれている。