OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[linuxjm/LDP_man-pages.git] / draft / man2 / semctl.2
index 2811633..f501b63 100644 (file)
 .\"    Added semid_ds and ipc_perm structure definitions
 .\" 2005-08-02, mtk: Added IPC_INFO, SEM_INFO, SEM_STAT descriptions.
 .\"
-.\" 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>
+.\"*******************************************************************
 .\"
-.\"WORD:       semaphore               セマフォ
-.\"WORD:       semaphore set           セマフォ集合
-.\"WORD:       union                   共用体
-.\"WORD:       buffer                  バッファ
-.\"WORD:       member                  メンバー
-.\"WORD:       superuser               スーパー・ユーザ
-.\"WORD:       effective uid           実効ユーザ ID
-.\"WORD:       creator                 作成者
-.\"WORD:       owner                   所有者
-.\"WORD:       entry                   エントリ
-.\"WORD:       undo                    アンドゥ
-.\"WORD:       implement               実装
-.\"WORD:       feature test macro      機能検査マクロ
+.\" This file was generated with po4a. Translate the source file.
 .\"
-.TH SEMCTL 2 2009-09-27 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.\"*******************************************************************
+.TH SEMCTL 2 2009\-09\-27 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O semctl \- semaphore control operations
 semctl \- セマフォの制御操作を行なう
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <sys/types.h>
-.B #include <sys/ipc.h>
-.B #include <sys/sem.h>
+\fB#include <sys/types.h>\fP
+\fB#include <sys/ipc.h>\fP
+\fB#include <sys/sem.h>\fP
 .sp
-.BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);"
+\fBint semctl(int \fP\fIsemid\fP\fB, int \fP\fIsemnum\fP\fB, int \fP\fIcmd\fP\fB, ...);\fP
 .fi
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O .BR semctl ()
-.\"O performs the control operation specified by
-.\"O .I cmd
-.\"O on the semaphore set identified by
-.\"O .IR semid ,
-.\"O or on the
-.\"O .IR semnum -th
-.\"O semaphore of that set.
-.\"O (The semaphores in a set are numbered starting at 0.)
-.BR semctl ()
-は、
-.I semid
-で指定されたセマフォ集合 (semaphore set)
-またはセマフォ集合の
-.I semnun
-番目のセマフォに対して、
-.I cmd
-で指定された制御操作を行なう
-(集合内のセマフォの番号は 0 から始まる)。
+\fBsemctl\fP()  は、 \fIsemid\fP で指定されたセマフォ集合 (semaphore set)  またはセマフォ集合の \fIsemnun\fP
+番目のセマフォに対して、 \fIcmd\fP で指定された制御操作を行なう (集合内のセマフォの番号は 0 から始まる)。
 .PP
-.\"O This function has three or four arguments, depending on
-.\"O .IR cmd .
-.\"O When there are four, the fourth has the type
-.\"O .IR "union semun" .
-.\"O The \fIcalling program\fP must define this union as follows:
-この関数は、
-.I cmd
-の値に依存して、3 個または 4 個の引き数を持つ。
-引き数が 4 個の場合、第 4 引き数の型は
-.I "union semun"
-である。
-\fI呼び出し元プログラム\fPは、
-この共用体 (union) を以下のように定義しなければならない。
+この関数は、 \fIcmd\fP の値に依存して、3 個または 4 個の引き数を持つ。 引き数が 4 個の場合、第 4 引き数の型は \fIunion
+semun\fP である。 \fI呼び出し元プログラム\fPは、 この共用体 (union) を以下のように定義しなければならない。
 
 .nf
 .in +4n
 union semun {
-.\"O     int              val;    /* Value for SETVAL */
     int              val;    /* SETVAL の値 */
-.\"O     struct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */
     struct semid_ds *buf;    /* IPC_STAT, IPC_SET 用のバッファ */
-.\"O     unsigned short  *array;  /* Array for GETALL, SETALL */
     unsigned short  *array;  /* GETALL, SETALL 用の配列 */
-.\"O     struct seminfo  *__buf;  /* Buffer for IPC_INFO
-.\"O                                 (Linux-specific) */
     struct seminfo  *__buf;  /* IPC_INFO 用のバッファ
                                 (Linux 固有) */
 };
 .in
 .fi
 .PP
-.\"O The
-.\"O .I semid_ds
-.\"O data structure is defined in \fI<sys/sem.h>\fP as follows:
-.I semid_ds
-データ構造体は \fI<sys/sem.h>\fP で以下のように定義されている:
+\fIsemid_ds\fP データ構造体は \fI<sys/sem.h>\fP で以下のように定義されている:
 .nf
 .in +4n
 
 struct semid_ds {
-.\"O     struct ipc_perm sem_perm;  /* Ownership and permissions */
     struct ipc_perm sem_perm;  /* 所有権と許可 */
-.\"O     time_t          sem_otime; /* Last semop time */
     time_t          sem_otime; /* 最後の semop の時刻 */
-.\"O     time_t          sem_ctime; /* Last change time */
     time_t          sem_ctime; /* 最後に変更が行われた時刻 */
-.\"O     unsigned short  sem_nsems; /* No. of semaphores in set */
     unsigned short  sem_nsems; /* 集合内のセマフォの数 */
 };
-.fi
-.PP
 .in
 .fi
 .PP
-.\"O The
-.\"O .I ipc_perm
-.\"O structure is defined in \fI<sys/ipc.h>\fP as follows
-.\"O (the highlighted fields are settable using
-.\"O .BR IPC_SET ):
-.I ipc_perm
-構造体は \fI<sys/ipc.h>\fP で以下のように定義されている
-(強調されたフィールドは
-.B IPC_SET
-を使って設定可能である):
+\fIipc_perm\fP 構造体は \fI<sys/ipc.h>\fP で以下のように定義されている (強調されたフィールドは
+\fBIPC_SET\fP を使って設定可能である):
 .PP
 .nf
 .in +4n
 struct ipc_perm {
-.\"O     key_t          __key; /* Key supplied to semget(2) */
-.\"O     uid_t          \fBuid\fP;   /* Effective UID of owner */
-.\"O     gid_t          \fBgid\fP;   /* Effective GID of owner */
-.\"O     uid_t          cuid;  /* Effective UID of creator */
-.\"O     gid_t          cgid;  /* Effective GID of creator */
     key_t          __key; /* semget(2) に与えられるキー */
     uid_t          \fBuid\fP;   /* 所有者 (owner) の実効 UID */
     gid_t          \fBgid\fP;   /* 所有者の実効 GID */
     uid_t          cuid;  /* 作成者 (creator) の実効 UID */
     gid_t          cgid;  /* 作成者の実効 GID */
-.\"O     unsigned short \fBmode\fP;  /* Permissions */
     unsigned short \fBmode\fP;  /* 許可 */
-.\"O     unsigned short __seq; /* Sequence number */
     unsigned short __seq; /* シーケンス番号 */
 };
 .in
 .fi
 .PP
-.\"O Valid values for
-.\"O .I cmd
-.\"O are:
-.I cmd
-として有効な値は
-.TP 10
-.B IPC_STAT
-.\"O Copy information from the kernel data structure associated with
-.\"O .I semid
-.\"O into the
-.\"O .I semid_ds
-.\"O structure pointed to by
-.\"O .IR arg.buf .
-.I semid
-に関連づけられたカーネルデータ構造体の情報を
-.I arg.buf
-で指された
-.I semid_ds
-構造体へコピーする。
-.\"O The argument
-.\"O .I semnum
-.\"O is ignored.
-.\"O The calling process must have read permission on the semaphore set.
-.I semnum
-引き数は無視される。
-呼び出したプロセスはそのセマフォ集合に対する
-読み込み許可を持たなければならない。
-.TP
-.B IPC_SET
-.\"O Write the values of some members of the
-.\"O .I semid_ds
-.\"O structure pointed to by
-.\"O .I arg.buf
-.\"O to the kernel data structure associated with this semaphore set,
-.\"O updating also its
-.\"O .I sem_ctime
-.I arg.buf
-で指定された
-.I semid_ds
-構造体のメンバーのいくつかの値を、
-このセマフォに関連づけられたカーネルデータ構造体に書き込み、
-.I sem_ctime
-メンバーの値も更新する。
-.\"O The following members of the structure are updated:
-.\"O .IR sem_perm.uid ,
-.\"O .IR sem_perm.gid ,
-.\"O and (the least significant 9 bits of)
-.\"O .IR sem_perm.mode .
-構造体の以下のメンバーが更新される:
-.IR sem_perm.uid ,
-.IR sem_perm.gid ,
-.I sem_perm.mode
-(の最下位 9 ビット)。
-.\"O The effective UID of the calling process must match the owner
-.\"O .RI ( sem_perm.uid )
-.\"O or creator
-.\"O .RI ( sem_perm.cuid )
-.\"O of the semaphore set, or the caller must be privileged.
-呼び出したプロセスの実効 UID が所有者
-.RI ( sem_perm.uid )
-または作成者
-.RI ( sem_perm.cuid )
-と一致するか、呼び出した人が特権を持たなければならない。
-.\"O The argument
-.\"O .I semnum
-.\"O is ignored.
-.I semnum
-引き数は無視される。
-.TP
-.B IPC_RMID
-.\"O Immediately remove the semaphore set,
-.\"O awakening all processes blocked in
-.\"O .BR semop (2)
-.\"O calls on the set (with an error return and
-.\"O .I errno
-.\"O set to
-.\"O .BR EIDRM ).
-セマフォ集合をただちに削除し、その集合上の
-.BR semop (2)
-コールでブロックされている全てのプロセスを目覚めさせる
-(エラー値が返されて、
-.I errno
-に
-.B EIDRM
-が設定される)。
-.\"O The effective user ID of the calling process must
-.\"O match the creator or owner of the semaphore set,
-.\"O or the caller must be privileged.
-.\"O The argument
-.\"O .I semnum
-.\"O is ignored.
-呼び出したプロセスの実効ユーザ ID が
-そのセマフォ集合の作成者または所有者と一致するか、
-呼び出した人が特権を持たなければならない。
-.I semnum
-引き数は無視される。
-.TP
-.\"O .BR IPC_INFO " (Linux-specific)"
-.BR IPC_INFO " (Linux 固有)"
-.\"O Returns information about system-wide semaphore limits and
-.\"O parameters in the structure pointed to by
-.\"O .IR arg.__buf .
-システム全体でのセマフォの制限とパラメータに関する情報を、
-.I arg.__buf
-が指す構造体に入れて返す。
-.\"O This structure is of type
-.\"O .IR seminfo ,
-.\"O defined in
-.\"O .I <sys/sem.h>
-.\"O if the
-.\"O .B _GNU_SOURCE
-.\"O feature test macro is defined:
-この構造体は
-.I seminfo
-型である。
-.I seminfo
-は
-.B _GNU_SOURCE
-機能検査マクロが定義された場合に
-.I <sys/sem.h>
+\fIcmd\fP として有効な値は
+.TP  10
+\fBIPC_STAT\fP
+\fIsemid\fP に関連づけられたカーネルデータ構造体の情報を \fIarg.buf\fP で指された \fIsemid_ds\fP 構造体へコピーする。
+\fIsemnum\fP 引き数は無視される。 呼び出したプロセスはそのセマフォ集合に対する 読み込み許可を持たなければならない。
+.TP 
+\fBIPC_SET\fP
+\fIarg.buf\fP で指定された \fIsemid_ds\fP 構造体のメンバーのいくつかの値を、
+このセマフォに関連づけられたカーネルデータ構造体に書き込み、 \fIsem_ctime\fP メンバーの値も更新する。 構造体の以下のメンバーが更新される:
+\fIsem_perm.uid\fP, \fIsem_perm.gid\fP, \fIsem_perm.mode\fP (の最下位 9 ビット)。
+呼び出したプロセスの実効 UID が所有者 (\fIsem_perm.uid\fP)  または作成者 (\fIsem_perm.cuid\fP)
+と一致するか、呼び出した人が特権を持たなければならない。 \fIsemnum\fP 引き数は無視される。
+.TP 
+\fBIPC_RMID\fP
+セマフォ集合をただちに削除し、その集合上の \fBsemop\fP(2)  コールでブロックされている全てのプロセスを目覚めさせる (エラー値が返されて、
+\fIerrno\fP に \fBEIDRM\fP が設定される)。 呼び出したプロセスの実効ユーザ ID が そのセマフォ集合の作成者または所有者と一致するか、
+呼び出した人が特権を持たなければならない。 \fIsemnum\fP 引き数は無視される。
+.TP 
+\fBIPC_INFO\fP (Linux 固有)
+システム全体でのセマフォの制限とパラメータに関する情報を、 \fIarg.__buf\fP が指す構造体に入れて返す。 この構造体は \fIseminfo\fP
+型である。 \fIseminfo\fP は \fB_GNU_SOURCE\fP 機能検査マクロが定義された場合に \fI<sys/sem.h>\fP
 で以下のように定義される:
 .nf
 .in +4n
 
 struct  seminfo {
-.\"O     int semmap;  /* Number of entries in semaphore
-.\"O                     map; unused within kernel */
-.\"O     int semmni;  /* Maximum number of semaphore sets */
-.\"O     int semmns;  /* Maximum number of semaphores in all
-.\"O                     semaphore sets */
-.\"O     int semmnu;  /* System-wide maximum number of undo
-.\"O                     structures; unused within kernel */
-.\"O     int semmsl;  /* Maximum number of semaphores in a
-.\"O                     set */
-.\"O     int semopm;  /* Maximum number of operations for
-.\"O                     semop(2) */
-.\"O     int semume;  /* Maximum number of undo entries per
-.\"O                     process; unused within kernel */
-.\"O     int semusz;  /* Size of struct sem_undo */
-.\"O     int semvmx;  /* Maximum semaphore value */
-.\"O     int semaem;  /* Max. value that can be recorded for
-.\"O                     semaphore adjustment (SEM_UNDO) */
     int semmap;  /* セマフォ・マップの最大エントリ数;
                     カーネル内では未使用 */
     int semmni;  /* セマフォ集合の最大数 */
@@ -342,553 +146,126 @@ struct  seminfo {
 
 .in
 .fi
-.\"O The
-.\"O .IR semmsl ,
-.\"O .IR semmns ,
-.\"O .IR semopm ,
-.\"O and
-.\"O .I semmni
-.\"O settings can be changed via
-.\"O .IR /proc/sys/kernel/sem ;
-.\"O see
-.\"O .BR proc (5)
-.\"O for details.
-設定
-.IR semmsl ,
-.IR semmns ,
-.IR semopm ,
-.I semmni
-は
-.I /proc/sys/kernel/sem
-経由で変更可能である。
-詳しくは
-.BR proc (5)
-を参照。
-.TP
-.\"O .BR SEM_INFO " (Linux-specific)"
-.BR SEM_INFO " (Linux 固有)"
-.\"O Returns a
-.\"O .I seminfo
-.\"O structure containing the same information as for
-.\"O .BR IPC_INFO ,
-.\"O except that the following fields are returned with information
-.\"O about system resources consumed by semaphores: the
-.\"O .I semusz
-.\"O field returns the number of semaphore sets that currently exist
-.\"O on the system; and the
-.\"O .I semaem
-.\"O field returns the total number of semaphores in all semaphore sets
-.\"O on the system.
-.B IPC_INFO
-のときと同じ情報を格納した
-.I seminfo
-構造体を返す。
-但し、以下のフィールドにはセマフォが消費しているシステム資源に
-関する情報が格納される点が異なる。
-.I semusz
-フィールドは現在システム上に存在するセマフォ集合の数を返す。
-.I semaem
-フィールドはシステム上の全てのセマフォ集合に含まれる
-セマフォの総数を返す。
-.TP
-.\"O .BR SEM_STAT " (Linux-specific)"
-.BR SEM_STAT " (Linux 固有)"
-.\"O Returns a
-.\"O .I semid_ds
-.\"O structure as for
-.\"O .BR IPC_STAT .
-.B IPC_STAT
-と同じく
-.I semid_ds
-構造体を返す。
-.\"O However, the
-.\"O .I semid
-.\"O argument is not a semaphore identifier, but instead an index into
-.\"O the kernel's internal array that maintains information about
-.\"O all semaphore sets on the system.
-但し、
-.I semid
-引き数は、セマフォ識別子ではなく、システム上の全てのセマフォ集合
-に関する情報を管理するカーネルの内部配列へのインデックスである。
-.TP
-.B GETALL
-.\"O Return
-.\"O .B semval
-.\"O (i.e., the current value)
-.\"O for all semaphores of the set into
-.\"O .IR arg.array .
-.\"O The argument
-.\"O .I semnum
-.\"O is ignored.
-.\"O The calling process must have read permission on the semaphore set.
-集合の全てのセマフォの
-.B semval
-の値 (現在の値) を
-.I arg.array
-に返す。
-.I semnum
-引き数は無視される。
-呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
-.TP
-.B GETNCNT
-.\"O The system call returns the value of
-.\"O .B semncnt
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set
-.\"O (i.e., the number of processes waiting for an increase of
-.\"O .B semval
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set).
-.\"O The calling process must have read permission on the semaphore set.
-システムコールは集合の
-.I semnum
-番目のセマフォの
-.B semncnt
-の値を返す (集合の
-.I semnum
-番目のセマフォの
-.B semval
-の増加を待っているプロセスの数を返す)。
-呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
-.TP
-.B GETPID
-.\"O The system call returns the value of
-.\"O .B sempid
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set
-.\"O (i.e., the PID of the process that executed the last
-.\"O .BR semop (2)
-.\"O call for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set).
-.\"O The calling process must have read permission on the semaphore set.
-システムコールは集合の
-.I semnum
-番目のセマフォの
-.B sempid
-の値 (集合の
-.I semnum
-番目のセマフォに最後に
-.BR semop (2)
-コールを実行したプロセスの PID) を返す。
-呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
-.TP
-.B GETVAL
-.\"O The system call returns the value of
-.\"O .B semval
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set.
-.\"O The calling process must have read permission on the semaphore set.
-システムコールは集合の
-.I semnum
-番目のセマフォの
-.B semval
-の値を返す。
+設定 \fIsemmsl\fP, \fIsemmns\fP, \fIsemopm\fP, \fIsemmni\fP は \fI/proc/sys/kernel/sem\fP
+経由で変更可能である。 詳しくは \fBproc\fP(5)  を参照。
+.TP 
+\fBSEM_INFO\fP (Linux 固有)
+\fBIPC_INFO\fP のときと同じ情報を格納した \fIseminfo\fP 構造体を返す。 但し、以下のフィールドにはセマフォが消費しているシステム資源に
+関する情報が格納される点が異なる。 \fIsemusz\fP フィールドは現在システム上に存在するセマフォ集合の数を返す。 \fIsemaem\fP
+フィールドはシステム上の全てのセマフォ集合に含まれる セマフォの総数を返す。
+.TP 
+\fBSEM_STAT\fP (Linux 固有)
+\fBIPC_STAT\fP と同じく \fIsemid_ds\fP 構造体を返す。 但し、 \fIsemid\fP
+引き数は、セマフォ識別子ではなく、システム上の全てのセマフォ集合 に関する情報を管理するカーネルの内部配列へのインデックスである。
+.TP 
+\fBGETALL\fP
+集合の全てのセマフォの \fBsemval\fP の値 (現在の値) を \fIarg.array\fP に返す。 \fIsemnum\fP 引き数は無視される。
 呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
-.TP
-.B GETZCNT
-.\"O The system call returns the value of
-.\"O .B semzcnt
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set
-.\"O (i.e., the number of processes waiting for
-.\"O .B semval
-.\"O of the
-.\"O .IR semnum \-th
-.\"O semaphore of the set to become 0).
-.\"O The calling process must have read permission on the semaphore set.
-システムコールは集合の
-.I semnum
-番目のセマフォの
-.B semzcnt
-の値を返す (集合の
-.I semnum
-番目のセマフォの
-.B semval
-の値が 0 になるのを待っているプロセスの数を返す)。
+.TP 
+\fBGETNCNT\fP
+システムコールは集合の \fIsemnum\fP 番目のセマフォの \fBsemncnt\fP の値を返す (集合の \fIsemnum\fP 番目のセマフォの
+\fBsemval\fP の増加を待っているプロセスの数を返す)。 呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
+.TP 
+\fBGETPID\fP
+システムコールは集合の \fIsemnum\fP 番目のセマフォの \fBsempid\fP の値 (集合の \fIsemnum\fP 番目のセマフォに最後に
+\fBsemop\fP(2)  コールを実行したプロセスの PID) を返す。 呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
+.TP 
+\fBGETVAL\fP
+システムコールは集合の \fIsemnum\fP 番目のセマフォの \fBsemval\fP の値を返す。
 呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
-.TP
-.B SETALL
-.\"O Set
-.\"O .B semval
-.\"O for all semaphores of the set using
-.\"O .IR arg.array ,
-.\"O updating also the
-.\"O .I sem_ctime
-.\"O member of the
-.\"O .I semid_ds
-.\"O structure associated with the set.
-集合の全てのセマフォの
-.B semval
-に
-.I arg.array
-で指定された値を設定する。
-その集合に関連する
-.I semid_ds
-構造体の
-.I sem_ctime
-メンバーの値も更新する。
-.\"O Undo entries (see
-.\"O .BR semop (2))
-.\"O are cleared for altered semaphores in all processes.
-.\"O If the changes to semaphore values would permit blocked
-.\"O .BR semop (2)
-.\"O calls in other processes to proceed, then those processes are woken up.
-全てのプロセスのセマフォの変更についてのアンドゥ・エントリ
-.RB ( semop (2)
-を参照) は消去 (clear) される。
-セマフォの値の変更により、他のプロセス内でブロックされている
-.BR semop (2)
-コールの続行が許可されると、それらのプロセスは起こされる (wake up)。
-.\"O The argument
-.\"O .I semnum
-.\"O is ignored.
-.\"O The calling process must have alter (write) permission on
-.\"O the semaphore set.
-.I semnum
-引き数は無視される。
-呼び出したプロセスはそのセマフォ集合に
-変更 (書き込み) 許可を持たなければならない。
-.TP
-.B SETVAL
-.\"O Set the value of
-.\"O .B semval
-.\"O to
-.\"O .I arg.val
-.\"O for the
-.\"O .IR semnum \-th
-.\"O semaphore of the set, updating also the
-.\"O .I sem_ctime
-.\"O member of the
-.\"O .I semid_ds
-.\"O structure associated with the set.
-集合の
-.I semnum
-番目のセマフォの
-.B semval
-に
-.I arg.val
-の値を設定する。その集合に関連する
-.I semid_ds
-構造体の
-.I sem_ctime
-メンバーの値も更新する。
-.\"O Undo entries are cleared for altered semaphores in all processes.
-.\"O If the changes to semaphore values would permit blocked
-.\"O .BR semop (2)
-.\"O calls in other processes to proceed, then those processes are woken up.
-.\"O The calling process must have alter permission on the semaphore set.
-全てのプロセスのセマフォの変更についてのアンドゥ・エントリは消去される。
-セマフォの値の変更により、他のプロセス内でブロックされている
-.BR semop (2)
-コールの続行が許可されると、それらのプロセスは起こされる (wake up)。
-呼び出したプロセスはそのセマフォ集合に
-変更 (書き込み) 許可を持たなければならない。
-.\"O .SH "RETURN VALUE"
+.TP 
+\fBGETZCNT\fP
+システムコールは集合の \fIsemnum\fP 番目のセマフォの \fBsemzcnt\fP の値を返す (集合の \fIsemnum\fP 番目のセマフォの
+\fBsemval\fP の値が 0 になるのを待っているプロセスの数を返す)。 呼び出したプロセスはそのセマフォ集合に読み込み許可を持たなければならない。
+.TP 
+\fBSETALL\fP
+集合の全てのセマフォの \fBsemval\fP に \fIarg.array\fP で指定された値を設定する。 その集合に関連する \fIsemid_ds\fP
+構造体の \fIsem_ctime\fP メンバーの値も更新する。 全てのプロセスのセマフォの変更についてのアンドゥ・エントリ (\fBsemop\fP(2)
+を参照) は消去 (clear) される。 セマフォの値の変更により、他のプロセス内でブロックされている \fBsemop\fP(2)
+コールの続行が許可されると、それらのプロセスは起こされる (wake up)。 \fIsemnum\fP 引き数は無視される。
+呼び出したプロセスはそのセマフォ集合に 変更 (書き込み) 許可を持たなければならない。
+.TP 
+\fBSETVAL\fP
+集合の \fIsemnum\fP 番目のセマフォの \fBsemval\fP に \fIarg.val\fP の値を設定する。その集合に関連する \fIsemid_ds\fP
+構造体の \fIsem_ctime\fP メンバーの値も更新する。 全てのプロセスのセマフォの変更についてのアンドゥ・エントリは消去される。
+セマフォの値の変更により、他のプロセス内でブロックされている \fBsemop\fP(2)  コールの続行が許可されると、それらのプロセスは起こされる
+(wake up)。 呼び出したプロセスはそのセマフォ集合に 変更 (書き込み) 許可を持たなければならない。
 .SH 返り値
-.\"O On failure
-.\"O .BR semctl ()
-.\"O returns \-1
-.\"O with
-.\"O .I errno
-.\"O indicating the error.
-失敗した場合、
-.BR semctl ()
-は \-1 を返し、
-.I errno
-にそのエラーを示す。
+失敗した場合、 \fBsemctl\fP()  は \-1 を返し、 \fIerrno\fP にそのエラーを示す。
 
-.\"O Otherwise the system call returns a nonnegative value depending on
-.\"O .I cmd
-.\"O as follows:
-そうでなければシステムコールは
-.I cmd
-によって以下の負でない値を返す:
-.TP 12
-.B GETNCNT
-.\"O the value of
-.\"O .BR semncnt .
-.B semncnt
-の値
-.TP
-.B GETPID
-.\"O the value of
-.\"O .BR sempid .
-.B sempid
-の値
-.TP
-.B GETVAL
-.\"O the value of
-.\"O .BR semval .
-.B semval
-の値
-.TP
-.B GETZCNT
-.\"O the value of
-.\"O .BR semzcnt .
-.B semzcnt
-の値
-.TP
-.B IPC_INFO
-.\"O the index of the highest used entry in the
-.\"O kernel's internal array recording information about all
-.\"O semaphore sets.
-.\"O (This information can be used with repeated
-.\"O .B SEM_STAT
-.\"O operations to obtain information about all semaphore sets on the system.)
-全てのセマフォ集合に関する情報を管理しているカーネルの内部配列の使用中
-エントリのインデックスの最大値
-(この情報は、システムの全てのセマフォ集合に関する情報を取得するために
-.B SEM_STAT
-操作を繰り返し実行する際に使用できる)
-.TP
-.B SEM_INFO
-.\"O As for
-.\"O .BR IPC_INFO .
-.B IPC_INFO
-と同じ
-.TP
-.B SEM_STAT
-.\"O the identifier of the semaphore set whose index was given in
-.\"O .IR semid .
-.I semid
-で指定されたインデックスを持つセマフォ集合の識別子
+そうでなければシステムコールは \fIcmd\fP によって以下の負でない値を返す:
+.TP  12
+\fBGETNCNT\fP
+\fBsemncnt\fP の値
+.TP 
+\fBGETPID\fP
+\fBsempid\fP の値
+.TP 
+\fBGETVAL\fP
+\fBsemval\fP の値
+.TP 
+\fBGETZCNT\fP
+\fBsemzcnt\fP の値
+.TP 
+\fBIPC_INFO\fP
+全てのセマフォ集合に関する情報を管理しているカーネルの内部配列の使用中 エントリのインデックスの最大値
+(この情報は、システムの全てのセマフォ集合に関する情報を取得するために \fBSEM_STAT\fP 操作を繰り返し実行する際に使用できる)
+.TP 
+\fBSEM_INFO\fP
+\fBIPC_INFO\fP と同じ
+.TP 
+\fBSEM_STAT\fP
+\fIsemid\fP で指定されたインデックスを持つセマフォ集合の識別子
 .LP
-.\"O All other
-.\"O .I cmd
-.\"O values return 0 on success.
-.I cmd
-の値がそれ以外の場合、成功すると 0 が返される。
-.\"O .SH ERRORS
+\fIcmd\fP の値がそれ以外の場合、成功すると 0 が返される。
 .SH エラー
-.\"O On failure,
-.\"O .I errno
-.\"O will be set to one of the following:
-失敗した場合は
-.I errno
-には以下の値のどれかが設定される:
-.TP
-.B EACCES
-.\"O The argument
-.\"O .I cmd
-.\"O has one of the values
-.\"O .BR GETALL ,
-.\"O .BR GETPID ,
-.\"O .BR GETVAL ,
-.\"O .BR GETNCNT ,
-.\"O .BR GETZCNT ,
-.\"O .BR IPC_STAT ,
-.\"O .BR SEM_STAT ,
-.\"O .BR SETALL ,
-.\"O or
-.\"O .B SETVAL
-.\"O and the calling process does not have the required
-.\"O permissions on the semaphore set and does not have the
-.\"O .B CAP_IPC_OWNER
-.\"O capability.
-.I cmd
-引き数が
-.BR GETALL ,
-.BR GETPID ,
-.BR GETVAL ,
-.BR GETNCNT ,
-.BR GETZCNT ,
-.BR IPC_STAT ,
-.BR SEM_STAT ,
-.BR SETALL ,
-.B SETVAL
-のうちの何れかの値を持ち、
-呼び出したプロセスがセマフォに対して必要とされる許可と
-.B CAP_IPC_OWNER
-ケーパビリティ (capability) を持っていない。
-.TP
-.B EFAULT
-.\"O The address pointed to by
-.\"O .I arg.buf
-.\"O or
-.\"O .I arg.array
-.\"O isn't accessible.
-.I arg.buf
-または
-.I arg.array
-で指されているアドレスにアクセスすることができない。
-.TP
-.B EIDRM
-.\"O The semaphore set was removed.
+失敗した場合は \fIerrno\fP には以下の値のどれかが設定される:
+.TP 
+\fBEACCES\fP
+\fIcmd\fP 引き数が \fBGETALL\fP, \fBGETPID\fP, \fBGETVAL\fP, \fBGETNCNT\fP, \fBGETZCNT\fP,
+\fBIPC_STAT\fP, \fBSEM_STAT\fP, \fBSETALL\fP, \fBSETVAL\fP のうちの何れかの値を持ち、
+呼び出したプロセスがセマフォに対して必要とされる許可と \fBCAP_IPC_OWNER\fP ケーパビリティ (capability) を持っていない。
+.TP 
+\fBEFAULT\fP
+\fIarg.buf\fP または \fIarg.array\fP で指されているアドレスにアクセスすることができない。
+.TP 
+\fBEIDRM\fP
 セマフォ集合が削除された。
-.TP
-.B EINVAL
-.\"O Invalid value for
-.\"O .I cmd
-.\"O or
-.\"O .IR semid .
-.\"O Or: for a
-.\"O .B SEM_STAT
-.\"O operation, the index value specified in
-.\"O .I semid
-.\"O referred to an array slot that is currently unused.
-.I cmd
-または
-.I semid
-に無効な値が指定された。
-もしくは、
-.B SEM_STAT
-操作の場合に、
-.I semid
+.TP 
+\fBEINVAL\fP
+\fIcmd\fP または \fIsemid\fP に無効な値が指定された。 もしくは、 \fBSEM_STAT\fP 操作の場合に、 \fIsemid\fP
 で指定されたインデックス値が現在未使用の配列のスロットを参照いていた。
-.TP
-.B EPERM
-.\"O The argument
-.\"O .I cmd
-.\"O has the value
-.\"O .B IPC_SET
-.\"O or
-.\"O .B IPC_RMID
-.\"O but the effective user ID of the calling process is not the creator
-.\"O (as found in
-.\"O .IR sem_perm.cuid )
-.\"O or the owner
-.\"O (as found in
-.\"O .IR sem_perm.uid )
-.\"O of the semaphore set,
-.\"O and the process does not have the
-.\"O .B CAP_SYS_ADMIN
-.\"O capability.
-.I cmd
-引き数に
-.B IPC_SET
-または
-.B IPC_RMID
-が指定され、呼び出したプロセスの実効ユーザ ID がセマフォの
-.RI ( sem_perm.cuid
-で見つかる) 作成者または
-.RI ( sem_perm.uid
-で見つかる) 所有者でもなく、
-プロセスが
-.B CAP_SYS_ADMIN
-ケーパビリティを持たない。
-.TP
-.B ERANGE
-.\"O The argument
-.\"O .I cmd
-.\"O has the value
-.\"O .B SETALL
-.\"O or
-.\"O .B SETVAL
-.\"O and the value to which
-.\"O .B semval
-.\"O is to be set (for some semaphore of the set) is less than 0
-.\"O or greater than the implementation limit
-.\"O .BR SEMVMX .
-.I cmd
-引き数に
-.B SETALL
-または
-.B SETVAL
-が指定され、(集合のセマフォのどれかの)
-.B semval
-に設定される値が 0 より小さいか、実装の制限
-.B SEMVMX
-よりも大きい。
-.\"O .SH "CONFORMING TO"
+.TP 
+\fBEPERM\fP
+\fIcmd\fP 引き数に \fBIPC_SET\fP または \fBIPC_RMID\fP が指定され、呼び出したプロセスの実効ユーザ ID がセマフォの
+(\fIsem_perm.cuid\fP で見つかる) 作成者または (\fIsem_perm.uid\fP で見つかる) 所有者でもなく、 プロセスが
+\fBCAP_SYS_ADMIN\fP ケーパビリティを持たない。
+.TP 
+\fBERANGE\fP
+\fIcmd\fP 引き数に \fBSETALL\fP または \fBSETVAL\fP が指定され、(集合のセマフォのどれかの)  \fBsemval\fP に設定される値が
+0 より小さいか、実装の制限 \fBSEMVMX\fP よりも大きい。
 .SH 準拠
-SVr4, POSIX.1-2001.
-.\"O .\" SVr4 documents more error conditions EINVAL and EOVERFLOW.
-.\" SVr4 には、他に EINVAL, EOVERFLOW エラーについての記述がある。
-.\"O .SH NOTES
+.\" SVr4 documents more error conditions EINVAL and EOVERFLOW.
+SVr4, POSIX.1\-2001.
 .SH 注意
-.\"O The
-.\"O .BR IPC_INFO ,
-.\"O .B SEM_STAT
-.\"O and
-.\"O .B SEM_INFO
-.\"O operations are used by the
-.\"O .BR ipcs (1)
-.\"O program to provide information on allocated resources.
-.\"O In the future these may modified or moved to a /proc file system
-.\"O interface.
-.BR IPC_INFO ,
-.BR SEM_STAT ,
-.B SEM_INFO
-操作は
-.BR ipcs (1)
-プログラムによって割当られた資源について情報を提供するために使用される。
-将来的にはこれらは変更されるか、
-/proc ファイル・システム・インタフェースに移動されるかもしれない。
+\fBIPC_INFO\fP, \fBSEM_STAT\fP, \fBSEM_INFO\fP 操作は \fBipcs\fP(1)
+プログラムによって割当られた資源について情報を提供するために使用される。 将来的にはこれらは変更されるか、 /proc
+ファイル・システム・インタフェースに移動されるかもしれない。
 .LP
-.\"O Various fields in a \fIstruct semid_ds\fP were typed as
-.\"O .I short
-.\"O under Linux 2.2
-.\"O and have become
-.\"O .I long
-.\"O under Linux 2.4.
-.\"O To take advantage of this,
-.\"O a recompilation under glibc-2.1.91 or later should suffice.
-.\"O (The kernel distinguishes old and new calls by an
-.\"O .B IPC_64
-.\"O flag in
-.\"O .IR cmd .)
-\fI構造体 semid_ds\fP 内の多くのフィールドは、
-Linux 2.2 では
-.I short
-型だったが、Linux 2.4 では
-.I long
-型になった。
-この利点を生かすには、glibc-2.1.91 以降の環境下で
-再コンパイルすれば十分である。
-カーネルは新しい形式の呼び出しと古い形式の呼び出しを
-.I cmd
-内の
-.B IPC_64
-フラグで区別する。
+\fI構造体 semid_ds\fP 内の多くのフィールドは、 Linux 2.2 では \fIshort\fP 型だったが、Linux 2.4 では
+\fIlong\fP 型になった。 この利点を生かすには、glibc\-2.1.91 以降の環境下で 再コンパイルすれば十分である。
+カーネルは新しい形式の呼び出しと古い形式の呼び出しを \fIcmd\fP 内の \fBIPC_64\fP フラグで区別する。
 .PP
-.\"O In some earlier versions of glibc, the
-.\"O .I semun
-.\"O union was defined in \fI<sys/sem.h>\fP, but POSIX.1-2001 requires
-.\"O that the caller define this union.
-初期のバージョンの glibc では、
-.I semun
-共用体は \fI<sys/sem.h>\fP で定義されていたが、
-POSIX.1-2001 では呼び出し側がこの共用体を定義する必要がある。
-.\"O On versions of glibc where this union is \fInot\fP defined,
-.\"O the macro
-.\"O .B _SEM_SEMUN_UNDEFINED
-.\"O is defined in \fI<sys/sem.h>\fP.
-この共用体が定義されて\fIいない\fP glibc のバージョンでは、
-マクロ
-.B _SEM_SEMUN_UNDEFINED
-が \fI<sys/sem.h>\fP で定義されている。
+初期のバージョンの glibc では、 \fIsemun\fP 共用体は \fI<sys/sem.h>\fP で定義されていたが、
+POSIX.1\-2001 では呼び出し側がこの共用体を定義する必要がある。 この共用体が定義されて\fIいない\fP glibc のバージョンでは、 マクロ
+\fB_SEM_SEMUN_UNDEFINED\fP が \fI<sys/sem.h>\fP で定義されている。
 .PP
-.\"O The following system limit on semaphore sets affects a
-.\"O .BR semctl ()
-.\"O call:
-以下は
-.BR semctl ()
-コールに影響するセマフォ集合のシステム制限:
-.TP
-.B SEMVMX
-.\"O Maximum value for
-.\"O .BR semval :
-.\"O implementation dependent (32767).
-.B semval
-の最大値 : 実装依存 (32767)。
+以下は \fBsemctl\fP()  コールに影響するセマフォ集合のシステム制限:
+.TP 
+\fBSEMVMX\fP
+\fBsemval\fP の最大値 : 実装依存 (32767)。
 .LP
-.\"O For greater portability it is best to always call
-.\"O .BR semctl ()
-.\"O with four arguments.
-移植性を高めるための一番良い方法は、常に 4 個の引き数で
-.BR semctl ()
-を呼び出すことである。
-.\"O .SH "SEE ALSO"
+移植性を高めるための一番良い方法は、常に 4 個の引き数で \fBsemctl\fP()  を呼び出すことである。
 .SH 関連項目
-.BR ipc (2),
-.BR semget (2),
-.BR semop (2),
-.BR capabilities (7),
-.BR sem_overview (7),
-.BR svipc (7)
+\fBipc\fP(2), \fBsemget\fP(2), \fBsemop\fP(2), \fBcapabilities\fP(7),
+\fBsem_overview\fP(7), \fBsvipc\fP(7)