.\" and 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.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" Modified 1993-07-28, Rik Faith <faith@cs.unc.edu>
.\" Modified 1993-11-28, Giorgio Ciucci <giorgio@crcc.it>
.\" attaches to a segment that has already been marked for deletion.
.\" 2005-08-02, mtk: Added IPC_INFO, SHM_INFO, SHM_STAT descriptions.
.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated 1997-03-01, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated & Modified 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated & Modified 2005-10-08, Akihiro MOTOKI
.\" Updated 2006-07-21, Akihiro MOTOKI, LDP v2.36
+.\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
.\"
-.\"WORD: shared memory ¶¦Í¥á¥â¥ê
-.\"WORD: segment ¥»¥°¥á¥ó¥È
-.\"WORD: owner ½êͼÔ
-.\"WORD: group ¥°¥ë¡¼¥×
-.\"WORD: creator ºîÀ®¼Ô
-.\"WORD: super-user ¥¹¡¼¥Ñ¡¼¡¦¥æ¡¼¥¶¡¼
-.\"WORD: detach ʬΥ
-.\"WORD: attach ÉÕ²Ã
-.\"WORD: swap ¥¹¥ï¥Ã¥×
-.\"WORD: identifier ¼±ÊÌ»Ò
-.\"WORD: member ¥á¥ó¥Ð¡¼
-.\"WORD: feature test macro µ¡Ç½¸¡ºº¥Þ¥¯¥í
-.\"
-.TH SHMCTL 2 2008-08-07 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH ̾Á°
-.\"O shmctl \- shared memory control
-shmctl \- ¶¦Í¥á¥â¥ê (shared memory) ¤òÀ©¸æ¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH SHMCTL 2 2014\-02\-07 Linux "Linux Programmer's Manual"
+.SH 名前
+shmctl \- System V 共有メモリー (shared memory) を制御する
+.SH 書式
.ad l
-.B #include <sys/ipc.h>
+\fB#include <sys/ipc.h>\fP
.br
-.B #include <sys/shm.h>
+\fB#include <sys/shm.h>\fP
.sp
-.BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf );
+\fBint shmctl(int \fP\fIshmid\fP\fB, int \fP\fIcmd\fP\fB, struct shmid_ds *\fP\fIbuf\fP\fB);\fP
.ad b
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR shmctl ()
-.\"O performs the control operation specified by
-.\"O .I cmd
-.\"O on the shared memory segment whose identifier is given in
-.\"O .IR shmid .
-.BR shmctl ()
-¤Ï¡¢¼±Ê̻Ҥ¬
-.I shmid
-¤Î¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ËÂФ·¤Æ
-.I cmd
-¤Ç»Ø¼¨¤·¤¿À©¸æÌ¿Îá¤ò¼Â¹Ô¤¹¤ë¡£
+.SH 説明
+\fBshmctl\fP() は、識別子が \fIshmid\fP の System\ V 共有メモリーセグメントに対して \fIcmd\fP
+で指示した制御命令を実行する。
.PP
-.\"O The
-.\"O .I buf
-.\"O argument is a pointer to a \fIshmid_ds\fP structure,
-.\"O defined in \fI<sys/shm.h>\fP as follows:
-.I buf
-°ú¤¿ô¤Ï¡¢ \fIshmid_ds\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤Ç¤¢¤ë¡£
-¤³¤Î¹½Â¤ÂÎ¤Ï \fI<sys/shm.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë
+\fIbuf\fP 引き数は、 \fIshmid_ds\fP 構造体へのポインターである。 この構造体は \fI<sys/shm.h>\fP
+で以下のように定義されている
.PP
.in +4n
.nf
struct shmid_ds {
-.\"O struct ipc_perm shm_perm; /* Ownership and permissions */
- struct ipc_perm shm_perm; /* ½ê͸¢¤Èµö²Ä */
-.\"O size_t shm_segsz; /* Size of segment (bytes) */
- size_t shm_segsz; /* ¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º (¥Ð¥¤¥È) */
-.\"O time_t shm_atime; /* Last attach time */
- time_t shm_atime; /* ºÇ¸å¤ÎÉղà (attach) ¤Î»þ¹ï */
-.\"O time_t shm_dtime; /* Last detach time */
- time_t shm_dtime; /* ºÇ¸å¤ÎʬΥ (detach) ¤Î»þ¹ï */
-.\"O time_t shm_ctime; /* Last change time */
- time_t shm_ctime; /* ºÇ¸å¤ËÊѹ¹¤¬¹Ô¤ï¤ì¤¿»þ¹ï */
-.\"O pid_t shm_cpid; /* PID of creator */
- pid_t shm_cpid; /* ºîÀ®¼Ô (creator) ¤Î PID */
-.\"O pid_t shm_lpid; /* PID of last shmat(2)/shmdt(2) */
- pid_t shm_lpid; /* ºÇ¸å¤Î shmat(2)/shmdt(2) ¤Î PID */
-.\"O shmatt_t shm_nattch; /* No. of current attaches */
- shmatt_t shm_nattch; /* ¸½ºßÉղ䵤ì¤Æ¤¤¤ë¿ô */
+ struct ipc_perm shm_perm; /* 所有権と許可 */
+ size_t shm_segsz; /* セグメントのサイズ (バイト) */
+ time_t shm_atime; /* 最後の付加 (attach) の時刻 */
+ time_t shm_dtime; /* 最後の分離 (detach) の時刻 */
+ time_t shm_ctime; /* 最後に変更が行われた時刻 */
+ pid_t shm_cpid; /* 作成者 (creator) の PID */
+ pid_t shm_lpid; /* 最後の shmat(2)/shmdt(2) の PID */
+ shmatt_t shm_nattch; /* 現在付加されている数 */
...
};
.fi
.in
.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 構造体は以下のように定義されている (強調されたフィールドは \fBIPC_SET\fP を使って設定可能である):
.PP
.in +4n
.nf
struct ipc_perm {
-.\"O key_t __key; /* Key supplied to shmget(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 */
-.\"O unsigned short \fBmode\fP; /* \fBPermissions\fP + SHM_DEST and
-.\"O SHM_LOCKED flags */
-.\"O unsigned short __seq; /* Sequence number */
- key_t __key; /* shmget(2) ¤ËÍ¿¤¨¤é¤ì¤ë¥¡¼ */
- uid_t \fBuid\fP; /* ½êͼԤμ¸ú UID */
- gid_t \fBgid\fP; /* ½êͼԤμ¸ú GID */
- uid_t cuid; /* ºîÀ®¼Ô¤Î¼Â¸ú UID */
- gid_t cgid; /* ºîÀ®¼Ô¤Î¼Â¸ú GID */
- unsigned short \fBmode\fP; /* \fBµö²Ä\fP + SHM_DEST ¤È
- SHM_LOCKED ¥Õ¥é¥° */
- unsigned short __seq; /* ¥·¡¼¥±¥ó¥¹ÈÖ¹æ */
+ key_t __key; /* shmget(2) に与えられるキー */
+ uid_t \fBuid\fP; /* 所有者の実効 UID */
+ gid_t \fBgid\fP; /* 所有者の実効 GID */
+ uid_t cuid; /* 作成者の実効 UID */
+ gid_t cgid; /* 作成者の実効 GID */
+ unsigned short \fBmode\fP; /* \fB許可\fP + SHM_DEST と
+ SHM_LOCKED フラグ */
+ unsigned short __seq; /* シーケンス番号 */
};
.fi
.in
.PP
-.\"O Valid values for
-.\"O .I cmd
-.\"O are:
-.I cmd
-¤È¤·¤Æ͸ú¤ÊÃͤϰʲ¼¤ÎÄ̤ê:
+\fIcmd\fP として有効な値は以下の通り:
.br
-.TP 10
-.B IPC_STAT
-.\"O Copy information from the kernel data structure associated with
-.\"O .I shmid
-.\"O into the
-.\"O .I shmid_ds
-.\"O structure pointed to by \fIbuf\fP.
-.I shmid
-¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤξðÊó¤ò
-\fIbuf\fP ¤Ç»Ø¤µ¤ì¤¿
-.I shmid_ds
-¹½Â¤ÂΤ˥³¥Ô¡¼¤¹¤ë¡£
-.\"O The caller must have read permission on the
-.\"O shared memory segment.
-¸Æ¤Ó½Ð¤·¸µ¤Ï¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ËÂФ¹¤ë
-Æɤ߹þ¤ßµö²Ä¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.TP
-.B IPC_SET
-.\"O Write the values of some members of the
-.\"O .I shmid_ds
-.\"O structure pointed to by
-.\"O .I buf
-.\"O to the kernel data structure associated with this shared memory segment,
-.\"O updating also its
-.\"O .I shm_ctime
-.\"O member.
-.I buf
-¤Ë¤è¤Ã¤Æ»Ø¤µ¤ì¤ë
-.I shmid_ds
-¹½Â¤ÂΤΤ¤¤¯¤Ä¤«¤Î¥á¥ó¥Ð¡¼¤ÎÃͤò¡¢
-¤³¤Î¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Ë´ØÏ¢¤Å¤±¤é¤ì¤¿¥«¡¼¥Í¥ë¥Ç¡¼¥¿¹½Â¤ÂΤ˽ñ¤¹þ¤ß¡¢
-.I shm_ctime
-¥á¥ó¥Ð¡¼¤â¹¹¿·¤¹¤ë¡£
-.\"O The following fields can be changed:
-.\"O \fIshm_perm.uid\fP, \fIshm_perm.gid\fP,
-.\"O and (the least significant 9 bits of) \fIshm_perm.mode\fP.
-°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¤ÏÊѹ¹¤Ç¤¤ë¡£
-\fIshm_perm.uid\fP, \fIshm_perm.gid\fP,
-\fIshm_perm.mode\fP (¤ÎºÇ²¼°Ì 9 ¥Ó¥Ã¥È)¡£
-.\"O The effective UID of the calling process must match the owner
-.\"O .RI ( shm_perm.uid )
-.\"O or creator
-.\"O .RI ( shm_perm.cuid )
-.\"O of the shared memory segment, or the caller must be privileged.
-¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú UID ¤¬½êͼÔ
-.RI ( shm_perm.uid )
-¤Þ¤¿¤ÏºîÀ®¼Ô
-.RI ( shm_perm.cuid )
-¤È°ìÃפ¹¤ë¤«¡¢¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.TP
-.B IPC_RMID
-.\"O Mark the segment to be destroyed.
-.\"O The segment will only actually be destroyed
-.\"O after the last process detaches it (i.e., when the
-.\"O .I shm_nattch
-.\"O member of the associated structure
-.\"O .I shmid_ds
-.\"O is zero).
-¥»¥°¥á¥ó¥È¤ËÇË´þºÑ¤ß¤Î¥Þ¡¼¥¯¤òÉÕ¤±¤ë¡£
-¥»¥°¥á¥ó¥È¤Ï¡¢¼ÂºÝ¤Ë¤ÏºÇ¸å¥×¥í¥»¥¹¤¬¥»¥°¥á¥ó¥È¤òʬΥ¤·¤¿ (´ØÏ¢¤¹¤ë
-.I shmid_ds
-¹½Â¤ÂΤÎ
-.I shm_nattch
-¥á¥ó¥Ð¡¼¤¬ 0 ¤Ë¤Ê¤Ã¤¿) ¸å¤Ç¤Î¤ßÇË´þ¤µ¤ì¤ë¡£
-.\"O The caller must be the owner or creator, or be privileged.
-¸Æ¤Ó½Ð¤·¸µ¤Ï½êͼԤ«ºîÀ®¼Ô¤Ç¤¢¤ë¤«¡¢Æø¢¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O If a segment has been marked for destruction, then the (nonstandard)
-.\"O .B SHM_DEST
-.\"O flag of the
-.\"O .I shm_perm.mode
-.\"O field in the associated data structure retrieved by
-.\"O .B IPC_STAT
-.\"O will be set.
-¥»¥°¥á¥ó¥È¤ËÇË´þ¤Î¥Þ¡¼¥¯¤¬ÉÕ¤±¤é¤ì¤ë¤È¡¢
-´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂΤˤª¤¤¤Æ
-.I shm_perm.mode
-¥Õ¥£¡¼¥ë¥É¤Î (ɸ½à¤Ç¤Ï¤Ê¤¤)
-.B SHM_DEST
-¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£
-¤³¤Î¥Ç¡¼¥¿¹½Â¤ÂΤÏ
-.B IPC_STAT
-¤Ç¼èÆÀ¤µ¤ì¤ë¡£
-.PP
-.\"O The caller \fImust\fP ensure that a segment is eventually destroyed;
-.\"O otherwise its pages that were faulted in will remain in memory or swap.
-¸Æ¤Ó½Ð¤·¸µ¤ÏºÇ½ªÅª¤Ë¤Ï¥»¥°¥á¥ó¥È¤ò˺¤ì¤º¤ËÇË´þ\fI¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤\fP¡£
-¤½¤¦¤Ç¤Ê¤ì¤Ð¡¢¥Õ¥©¡¼¥ë¥È (fault) ¤µ¤ì¤¿¥Ú¡¼¥¸¤Ï
-¥á¥â¥ê¤«¥¹¥ï¥Ã¥× (swap) ¤Ë»Ä¤ê³¤±¤ë¡£
-.TP 10
-.\"O .BR IPC_INFO " (Linux-specific)"
-.BR IPC_INFO " (Linux ¸ÇÍ)"
-.\"O Returns information about system-wide shared memory limits and
-.\"O parameters in the structure pointed to by
-.\"O .IR buf .
-¥·¥¹¥Æ¥àÁ´ÂΤǤζ¦Í¥á¥â¥ê¤ÎÀ©¸Â¤È¥Ñ¥é¥á¡¼¥¿¤Ë´Ø¤¹¤ë¾ðÊó¤ò¡¢
-.I buf
-¤¬»Ø¤¹¹½Â¤ÂΤËÆþ¤ì¤ÆÊÖ¤¹¡£
-.\"O This structure is of type
-.\"O .I shminfo
-.\"O (thus, a cast is required),
-.\"O defined in
-.\"O .I <sys/shm.h>
-.\"O if the
-.\"O .B _GNU_SOURCE
-.\"O feature test macro is defined:
-¤³¤Î¹½Â¤ÂΤÏ
-.I shminfo
-·¿¤Ç¤¢¤ë (¤½¤Î¤¿¤á¥¥ã¥¹¥È¤¬É¬ÍפǤ¢¤ë)¡£
-.I shminfo
-¤Ï
-.B _GNU_SOURCE
-µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë
-.I <sys/shm.h>
-¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë:
+.TP 10
+\fBIPC_STAT\fP
+\fIshmid\fP に関連づけられたカーネルデータ構造体の情報を \fIbuf\fP で指された \fIshmid_ds\fP 構造体にコピーする。
+呼び出し元は共有メモリーセグメントに対する 読み込み許可を持たなければならない。
+.TP
+\fBIPC_SET\fP
+\fIbuf\fP によって指される \fIshmid_ds\fP 構造体のいくつかのメンバーの値を、
+この共有メモリーセグメントに関連づけられたカーネルデータ構造体に書き込み、 \fIshm_ctime\fP メンバーも更新する。
+以下のフィールドは変更できる。 \fIshm_perm.uid\fP, \fIshm_perm.gid\fP, \fIshm_perm.mode\fP (の最下位 9
+ビット)。 呼び出したプロセスの実効 UID が所有者 (\fIshm_perm.uid\fP) または作成者 (\fIshm_perm.cuid\fP)
+と一致するか、呼び出し元が特権を持たなければならない。
+.TP
+\fBIPC_RMID\fP
+セグメントに破棄済みのマークを付ける。 セグメントは、実際には最後プロセスがセグメントを分離した (関連する \fIshmid_ds\fP 構造体の
+\fIshm_nattch\fP メンバーが 0 になった) 後でのみ破棄される。
+呼び出し元はそのセグメントの所有者か作成者であるか、特権を持たなければならない。 \fIbuf\fP 引き数は無視される。
+.IP
+セグメントに破棄のマークが付けられると、 関連するデータ構造体において \fIshm_perm.mode\fP フィールドの (標準ではない)
+\fBSHM_DEST\fP フラグが設定される。 このデータ構造体は \fBIPC_STAT\fP で取得される。
+.IP
+呼び出し元は最終的にはセグメントを忘れずに破棄\fIしなければならない\fP。 そうでなれば、フォールト (fault) されたページは メモリーかスワップ
+(swap) に残り続ける。
+.IP
+\fBproc\fP(5) の \fI/proc/sys/kernel/shm_rmid_forced\fP の説明も参照のこと。
+.TP 10
+\fBIPC_INFO\fP (Linux 固有)
+システム全体での共有メモリーの制限とパラメーターに関する情報を、 \fIbuf\fP が指す構造体に入れて返す。 この構造体は \fIshminfo\fP 型である
+(そのためキャストが必要である)。 \fIshminfo\fP は \fB_GNU_SOURCE\fP 機能検査マクロが定義された場合に
+\fI<sys/shm.h>\fP で以下のように定義される:
.nf
.in +4n
struct shminfo {
-.\"O unsigned long shmmax; /* Maximum segment size */
- unsigned long shmmax; /* ºÇÂ祻¥°¥á¥ó¥È¥µ¥¤¥º */
-.\"O unsigned long shmmin; /* Minimum segment size;
-.\"O always 1 */
- unsigned long shmmin; /* ºÇ¾®¥»¥°¥á¥ó¥È¥µ¥¤¥º¡£
- ¾ï¤Ë 1 */
-.\"O unsigned long shmmni; /* Maximum number of segments */
- unsigned long shmmni; /* ºÇÂ祻¥°¥á¥ó¥È¿ô */
-.\"O unsigned long shmseg; /* Maximum number of segments
-.\"O that a process can attach;
-.\"O unused within kernel */
- unsigned long shmseg; /* ¥×¥í¥»¥¹¤¬ÉղäǤ¤ë
- ¥»¥°¥á¥ó¥È¤ÎºÇÂç¿ô¡£
- ¥«¡¼¥Í¥ëÆâ¤Ç¤Ï̤»ÈÍÑ */
-.\"O unsigned long shmall; /* Maximum number of pages of
-.\"O shared memory, system-wide */
- unsigned long shmall; /* ¶¦Í¥á¥â¥ê¤ÎºÇÂç¥Ú¡¼¥¸¿ô¡£
- ¥·¥¹¥Æ¥àÁ´ÂΤǤÎÃÍ */
+ unsigned long shmmax; /* 最大セグメントサイズ */
+ unsigned long shmmin; /* 最小セグメントサイズ。
+ 常に 1 */
+ unsigned long shmmni; /* 最大セグメント数 */
+ unsigned long shmseg; /* プロセスが付加できる
+ セグメントの最大数。
+ カーネル内では未使用 */
+ unsigned long shmall; /* 共有メモリーの最大ページ数。
+ システム全体での値 */
};
.in
.fi
-.\"O The
-.\"O .IR shmmni ,
-.\"O .IR shmmax ,
-.\"O and
-.\"O .I shmall
-.\"O settings can be changed via
-.\"O .I /proc
-.\"O files of the same name; see
-.\"O .BR proc (5)
-.\"O for details.
-ÀßÄê
-.IR shmmni ,
-.IR shmmax ,
-.I shmall
-¤Ï
-.I /proc
-¤Ë¤¢¤ëƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë·Ðͳ¤ÇÊѹ¹²Äǽ¤Ç¤¢¤ë¡£
-¾Ü¤·¤¯¤Ï
-.BR proc (5)
-¤ò»²¾È¡£
-.TP
-.\"O .BR SHM_INFO " (Linux-specific)"
-.BR SHM_INFO " (Linux ¸ÇÍ)"
-.\"O Returns a
-.\"O .I shm_info
-.\"O structure whose fields contain information
-.\"O about system resources consumed by shared memory.
-¶¦Í¥á¥â¥ê¤¬¾ÃÈñ¤·¤Æ¤¤¤ë¥·¥¹¥Æ¥à»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤ò
-³ÊǼ¤·¤¿
-.I shm_info
-¹½Â¤ÂΤòÊÖ¤¹¡£
-.\"O This structure is defined in
-.\"O .I <sys/shm.h>
-.\"O if the
-.\"O .B _GNU_SOURCE
-.\"O feature test macro is defined:
-¤³¤Î¹½Â¤ÂΤϡ¢
-.B _GNU_SOURCE
-µ¡Ç½¸¡ºº¥Þ¥¯¥í¤¬ÄêµÁ¤µ¤ì¤¿¾ì¹ç¤Ë
-.I <sys/shm.h>
-¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë:
+設定 \fIshmmni\fP, \fIshmmax\fP, \fIshmall\fP は \fI/proc\fP にある同じ名前のファイル経由で変更可能である。 詳しくは
+\fBproc\fP(5) を参照。
+.TP
+\fBSHM_INFO\fP (Linux 固有)
+共有メモリーが消費しているシステム資源に関する情報を 格納した \fIshm_info\fP 構造体を返す。 この構造体は、 \fB_GNU_SOURCE\fP
+機能検査マクロが定義された場合に \fI<sys/shm.h>\fP で以下のように定義される:
.nf
.in +4n
struct shm_info {
-.\"O int used_ids; /* # of currently existing
-.\"O segments */
- int used_ids; /* ¸½ºß¸ºß¤¹¤ë¥»¥°¥á¥ó¥È¿ô */
-.\"O unsigned long shm_tot; /* Total number of shared
-.\"O memory pages */
- unsigned long shm_tot; /* ¶¦Í¥á¥â¥ê¤Î¥Ú¡¼¥¸Áí¿ô */
-.\"O unsigned long shm_rss; /* # of resident shared
-.\"O memory pages */
- unsigned long shm_rss; /* ¥á¥â¥ê¾å¤Ë¤¢¤ë (¥¹¥ï¥Ã¥×¤µ¤ì¤Æ
- ¤¤¤Ê¤¤) ¶¦Í¥á¥â¥ê¥Ú¡¼¥¸¿ô */
-.\"O unsigned long shm_swp; /* # of swapped shared
-.\"O memory pages */
- unsigned long shm_swp; /* ¥¹¥ï¥Ã¥×¤µ¤ì¤Æ¤¤¤ë¶¦Í¥á¥â¥ê
- ¥Ú¡¼¥¸¿ô */
-.\"O unsigned long swap_attempts;
-.\"O /* Unused since Linux 2.4 */
-.\"O unsigned long swap_successes;
-.\"O /* Unused since Linux 2.4 */
+ int used_ids; /* 現在存在するセグメント数 */
+ unsigned long shm_tot; /* 共有メモリーのページ総数 */
+ unsigned long shm_rss; /* メモリー上にある (スワップされて
+ いない) 共有メモリーページ数 */
+ unsigned long shm_swp; /* スワップされている共有メモリー
+ ページ数 */
unsigned long swap_attempts;
- /* Linux 2.4 °Ê¹ß¤Ç¤Ï̤»ÈÍÑ */
+ /* Linux 2.4 以降では未使用 */
unsigned long swap_successes;
- /* Linux 2.4 °Ê¹ß¤Ç¤Ï̤»ÈÍÑ */
+ /* Linux 2.4 以降では未使用 */
};
.in
.fi
-.TP
-.\"O .BR SHM_STAT " (Linux-specific)"
-.BR SHM_STAT " (Linux ¸ÇÍ)"
-.\"O Returns a
-.\"O .I shmid_ds
-.\"O structure as for
-.\"O .BR IPC_STAT .
-.B IPC_STAT
-¤ÈƱ¤¸¤¯
-.I shmid_ds
-¹½Â¤ÂΤòÊÖ¤¹¡£
-.\"O However, the
-.\"O .I shmid
-.\"O argument is not a segment identifier, but instead an index into
-.\"O the kernel's internal array that maintains information about
-.\"O all shared memory segments on the system.
-⤷¡¢
-.I shmid
-°ú¤¿ô¤Ï¡¢¥»¥°¥á¥ó¥È¼±Ê̻ҤǤϤʤ¯¡¢¥·¥¹¥Æ¥à¾å¤ÎÁ´¤Æ¤Î¶¦Í¥á¥â¥ê
-¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Ø¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹
-¤Ç¤¢¤ë¡£
+.TP
+\fBSHM_STAT\fP (Linux 固有)
+\fBIPC_STAT\fP と同じく \fIshmid_ds\fP 構造体を返す。 但し、 \fIshmid\fP
+引き数は、セグメント識別子ではなく、システム上の全ての共有メモリー セグメントに関する情報を管理するカーネルの内部配列へのインデックス である。
.PP
-.\"O The caller can prevent or allow swapping of a shared
-.\"O memory segment with the following \fIcmd\fP values:
-¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢\fIcmd\fP ¤Ë°Ê²¼¤ÎÃͤò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤¬
-¥¹¥ï¥Ã¥×¤µ¤ì¤ë¤³¤È¤òËɻߤ·¤¿¤ê¡¢µö²Ä¤·¤¿¤ê¤Ç¤¤ë:
+呼び出し元は、\fIcmd\fP に以下の値を指定することで、共有メモリーセグメントが スワップされることを防止したり、許可したりできる:
.br
-.TP 10
-.\"O .BR SHM_LOCK " (Linux-specific)"
-.BR SHM_LOCK " (Linux ¸ÇÍ)"
-.\"O Prevent swapping of the shared memory segment.
-.\"O The caller must fault in
-.\"O any pages that are required to be present after locking is enabled.
-¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò¥¹¥ï¥Ã¥×¤¹¤ë¤³¤È¤òËɻߤ¹¤ë¡£
-¥í¥Ã¥¯¤¬Í¸ú¤Ë¤Ê¤Ã¤¿¸å¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢
-¸ºß¤¹¤ë¤³¤È¤¬Í׵ᤵ¤ì¤¿Á´¤Æ¤Î¥Ú¡¼¥¸¤ò¥Õ¥©¡¼¥ë¥È¤µ¤»¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
-.\"O If a segment has been locked, then the (nonstandard)
-.\"O .B SHM_LOCKED
-.\"O flag of the
-.\"O .I shm_perm.mode
-.\"O field in the associated data structure retrieved by
-.\"O .B IPC_STAT
-.\"O will be set.
-¥»¥°¥á¥ó¥È¤¬¥í¥Ã¥¯¤µ¤ì¤ë¤È¡¢
-´ØÏ¢¤¹¤ë¥Ç¡¼¥¿¹½Â¤ÂΤˤª¤¤¤Æ
-.I shm_perm.mode
-¥Õ¥£¡¼¥ë¥É¤Î (ɸ½àŪ¤Ç¤Ï¤Ê¤¤)
-.B SHM_LOCKED
-¥Õ¥é¥°¤¬ÀßÄꤵ¤ì¤ë¡£
-¤³¤Î¥Ç¡¼¥¿¹½Â¤ÂΤÏ
-.B IPC_STAT
-¤Ç¼èÆÀ¤µ¤ì¤ë¡£
-.TP
-.\"O .BR SHM_UNLOCK " (Linux-specific)"
-.BR SHM_UNLOCK " (Linux ¸ÇÍ)"
-.\"O Unlock the segment, allowing it to be swapped out.
-¥»¥°¥á¥ó¥È¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¡¢¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë¡£
+.TP 10
+\fBSHM_LOCK\fP (Linux 固有)
+共有メモリーセグメントをスワップすることを防止する。 ロックが有効になった後、呼び出し元は、
+存在することが要求された全てのページをフォールトさせなければならない。 セグメントがロックされると、 関連するデータ構造体において
+\fIshm_perm.mode\fP フィールドの (標準的ではない) \fBSHM_LOCKED\fP フラグが設定される。 このデータ構造体は
+\fBIPC_STAT\fP で取得される。
+.TP
+\fBSHM_UNLOCK\fP (Linux 固有)
+セグメントのロックを解除し、スワップアウトすることを可能にする。
.PP
-.\"O In kernels before 2.6.10, only a privileged process
-.\"O could employ
-.\"O .B SHM_LOCK
-.\"O and
-.\"O .BR SHM_UNLOCK .
-2.6.10 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢Æø¢¥×¥í¥»¥¹¤À¤±¤¬
-.B SHM_LOCK
-¤È
-.B SHM_UNLOCK
-¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤¿¡£
-.\"O Since kernel 2.6.10, an unprivileged process can employ these operations
-.\"O if its effective UID matches the owner or creator UID of the segment, and
-.\"O (for
-.\"O .BR SHM_LOCK )
-.\"O the amount of memory to be locked falls within the
-.\"O .B RLIMIT_MEMLOCK
-.\"O resource limit (see
-.\"O .BR setrlimit (2)).
-2.6.10 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢ÈóÆø¢¥×¥í¥»¥¹¤Ç¤¢¤Ã¤Æ¤â¼¡¤Î¾ò·ï¤òËþ¤¿¤»¤Ð
-¤³¤ì¤é¤ÎÁàºî¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤½¤Î¾ò·ï¤È¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â¸ú UID
-¤¬¤½¤Î¥»¥°¥á¥ó¥È¤Î½êͼԤ⤷¤¯¤ÏºîÀ®¼Ô¤Î UID ¤È°ìÃפ·¡¢
-.RB ( SHM_LOCK
-¤Î¾ì¹ç¤Ë¤Ï) ¥í¥Ã¥¯¤¹¤ë¥á¥â¥ê¤Î¹ç·×¤¬
-.B RLIMIT_MEMLOCK
-¥ê¥½¡¼¥¹¾å¸Â
-.RB ( setrlimit (2)
-»²¾È) ¤ÎÈÏ°ÏÆâ¤ËÆþ¤Ã¤Æ¤¤¤ë¤³¤È¤Ç¤¢¤ë¡£
.\" There was some weirdness in 2.6.9: SHM_LOCK and SHM_UNLOCK could
.\" be applied to a segment, regardless of ownership of the segment.
.\" This was a botch-up in the move to RLIMIT_MEMLOCK, and was fixed
.\" in 2.6.10. MTK, May 2005
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O A successful
-.\"O .B IPC_INFO
-.\"O or
-.\"O .B SHM_INFO
-.\"O operation returns the index of the highest used entry in the
-.\"O kernel's internal array recording information about all
-.\"O shared memory segments.
-.B IPC_INFO
-¤È
-.B SHM_INFO
-Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢Á´¤Æ¤Î¶¦Í¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò
-´ÉÍý¤·¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ÎÆâÉôÇÛÎó¤Î»ÈÍÑÃ楨¥ó¥È¥ê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î
-¤¦¤ÁºÇÂçÃͤòÊÖ¤¹
-.\"O (This information can be used with repeated
-.\"O .B SHM_STAT
-.\"O operations to obtain information about all shared memory segments
-.\"O on the system.)
-(¤³¤Î¾ðÊó¤Ï¡¢¥·¥¹¥Æ¥à¤ÎÁ´¤Æ¤Î¶¦Í¥á¥â¥ê¥»¥°¥á¥ó¥È¤Ë´Ø¤¹¤ë¾ðÊó¤ò
-¼èÆÀ¤¹¤ë¤¿¤á¤Ë¡¢
-.B SHM_STAT
-Áàºî¤ò·«¤êÊÖ¤·¼Â¹Ô¤¹¤ëºÝ¤Ë»ÈÍѤǤ¤ë)¡£
-.\"O A successful
-.\"O .B SHM_STAT
-.\"O operation returns the identifier of the shared memory segment
-.\"O whose index was given in
-.\"O .IR shmid .
-.B SHM_STAT
-Áàºî¤Ï¡¢À®¸ù¤¹¤ë¤È¡¢
-.I shmid
-¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¶¦Í¥á¥â¥ê¥»¥°¥á¥ó¥È¤Î¼±Ê̻ҤòÊÖ¤¹¡£
-.\"O Other operations return 0 on success.
-¾¤ÎÁàºî¤Ï¡¢À®¸ù¤Î¾ì¹ç 0 ¤òÊÖ¤¹¡£
+2.6.10 より前のカーネルでは、特権プロセスだけが \fBSHM_LOCK\fP と \fBSHM_UNLOCK\fP を利用することができた。 2.6.10
+以降のカーネルでは、非特権プロセスであっても次の条件を満たせば これらの操作を利用することができる。その条件とは、プロセスの実効 UID
+がそのセグメントの所有者もしくは作成者の UID と一致し、 (\fBSHM_LOCK\fP の場合には) ロックするメモリーの合計が
+\fBRLIMIT_MEMLOCK\fP リソース上限 (\fBsetrlimit\fP(2) 参照) の範囲内に入っていることである。
+.SH 返り値
+\fBIPC_INFO\fP と \fBSHM_INFO\fP 操作は、成功すると、全ての共有メモリーセグメントに関する情報を
+管理しているカーネルの内部配列の使用中エントリーのインデックスの うち最大値を返す (この情報は、システムの全ての共有メモリーセグメントに関する情報を
+取得するために、 \fBSHM_STAT\fP 操作を繰り返し実行する際に使用できる)。 \fBSHM_STAT\fP 操作は、成功すると、 \fIshmid\fP
+で指定されたインデックスを持つ共有メモリーセグメントの識別子を返す。 他の操作は、成功の場合 0 を返す。
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤òÊÖ¤·¡¢
-.I errno
-¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B EACCES
-.\"O \fBIPC_STAT\fP or \fBSHM_STAT\fP is requested and
+エラーの場合は \-1 を返し、 \fIerrno\fP を適切に設定する。
+.SH エラー
+.TP
+\fBEACCES\fP
+\fBIPC_STAT\fP または \fBSHM_STAT\fP が要求され、 \fIshm_perm.mode\fP が \fIshmid\fP
+への読み込みアクセスを許しておらず、 かつ呼び出したプロセスが \fBCAP_IPC_OWNER\fP ケーパビリティ (capability)
+を持っていない。
+.TP
+\fBEFAULT\fP
+\fIcmd\fP 引き数に \fBIPC_SET\fP か \fBIPC_STAT\fP が指定されたが \fIbuf\fP で指されているアドレスにアクセスできない。
+.TP
+\fBEIDRM\fP
+\fIshmid\fP が削除 (remove) された識別子 (identifier) を指している。
+.TP
+\fBEINVAL\fP
+\fIshmid\fP が有効な識別子でないか、 \fIcmd\fP が有効なコマンドでない。 もしくは、 \fBSHM_STAT\fP 操作の場合に、 \fIshmid\fP
+で指定されたインデックス値が現在未使用の配列のスロットを参照していた。
+.TP
+\fBENOMEM\fP
+(2.6.9 以降のカーネルにおいて) \fBSHM_LOCK\fP が指定され、 ロックされる予定のセグメントのサイズ
+(ロックされる共有メモリーセグメントの合計バイト数) が、 呼び出したプロセスの実ユーザー ID についての制限を超えた。 この制限は
+\fBRLIMIT_MEMLOCK\fP ソフト資源制限で定義される (\fBsetrlimit\fP(2) を参照)。
+.TP
+\fBEOVERFLOW\fP
+\fBIPC_STAT\fP が試みられ、GID や UID の値が \fIbuf\fP で指示される構造体に格納するには大き過ぎる。
+.TP
+\fBEPERM\fP
+\fBIPC_SET\fP か \fBIPC_RMID\fP が試みられ、 呼び出したプロセスの実効ユーザー ID が作成者 (\fIshm_perm.cuid\fP)
+でも所有者 (\fIshm_perm.uid\fP) でもなく、プロセスが特権を持たない (Linux では \fBCAP_SYS_ADMIN\fP
+ケーパビリティを持たない)。
-.\"O \fIshm_perm.mode\fP does not allow read access for
-.\"O .IR shmid ,
-.\"O and the calling process does not have the
-.\"O .B CAP_IPC_OWNER
-.\"O capability.
-\fBIPC_STAT\fP ¤Þ¤¿¤Ï \fBSHM_STAT\fP ¤¬Í׵ᤵ¤ì¡¢
-\fIshm_perm.mode\fP ¤¬
-.I shmid
-¤Ø¤ÎÆɤ߹þ¤ß¥¢¥¯¥»¥¹¤òµö¤·¤Æ¤ª¤é¤º¡¢
-¤«¤Ä¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤¬
-.B CAP_IPC_OWNER
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£ (capability) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
-.TP
-.B EFAULT
-.\"O The argument
-.\"O .I cmd
-.\"O has value
-.\"O .B IPC_SET
-.\"O or
-.\"O .B IPC_STAT
-.\"O but the address pointed to by
-.\"O .I buf
-.\"O isn't accessible.
-.I cmd
-°ú¤¿ô¤Ë
-.B IPC_SET
-¤«
-.B IPC_STAT
-¤¬»ØÄꤵ¤ì¤¿¤¬
-.I buf
-¤Ç»Ø¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¤Ë¥¢¥¯¥»¥¹¤Ç¤¤Ê¤¤¡£
-.TP
-.B EIDRM
-.\"O \fIshmid\fP points to a removed identifier.
-\fIshmid\fP ¤¬ºï½ü (remove) ¤µ¤ì¤¿¼±ÊÌ»Ò (identifier) ¤ò»Ø¤·¤Æ¤¤¤ë¡£
-.TP
-.B EINVAL
-.\"O \fIshmid\fP is not a valid identifier, or \fIcmd\fP
-.\"O is not a valid command.
-.\"O Or: for a
-.\"O .B SHM_STAT
-.\"O operation, the index value specified in
-.\"O .I shmid
-.\"O referred to an array slot that is currently unused.
-\fIshmid\fP ¤¬Í¸ú¤Ê¼±Ê̻ҤǤʤ¤¤«¡¢
-\fIcmd\fP ¤¬Í¸ú¤Ê¥³¥Þ¥ó¥É¤Ç¤Ê¤¤¡£
-¤â¤·¤¯¤Ï¡¢
-.B SHM_STAT
-Áàºî¤Î¾ì¹ç¤Ë¡¢
-.I shmid
-¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ¬¸½ºß̤»ÈÍѤÎÇÛÎó¤Î¥¹¥í¥Ã¥È¤ò»²¾È¤·¤Æ¤¤¤¿¡£
-.TP
-.B ENOMEM
-.\"O (In kernels since 2.6.9),
-.\"O .B SHM_LOCK
-.\"O was specified and the size of the to-be-locked segment would mean
-.\"O that the total bytes in locked shared memory segments would exceed
-.\"O the limit for the real user ID of the calling process.
-(2.6.9 °Ê¹ß¤Î¥«¡¼¥Í¥ë¤Ë¤ª¤¤¤Æ)
-.B SHM_LOCK
-¤¬»ØÄꤵ¤ì¡¢
-¥í¥Ã¥¯¤µ¤ì¤ëͽÄê¤Î¥»¥°¥á¥ó¥È¤Î¥µ¥¤¥º
-(¥í¥Ã¥¯¤µ¤ì¤ë¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤Î¹ç·×¥Ð¥¤¥È¿ô) ¤¬¡¢
-¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶¡¼ ID ¤Ë¤Ä¤¤¤Æ¤ÎÀ©¸Â¤òĶ¤¨¤¿¡£
-.\"O This limit is defined by the
-.\"O .B RLIMIT_MEMLOCK
-.\"O soft resource limit (see
-.\"O .BR setrlimit (2)).
-¤³¤ÎÀ©¸Â¤Ï
-.B RLIMIT_MEMLOCK
-¥½¥Õ¥È»ñ¸»À©¸Â¤ÇÄêµÁ¤µ¤ì¤ë
-.RB ( setrlimit (2)
-¤ò»²¾È)¡£
-.TP
-.B EOVERFLOW
-.\"O \fBIPC_STAT\fP is attempted, and the GID or UID value
-.\"O is too large to be stored in the structure pointed to by
-.\"O .IR buf .
-\fBIPC_STAT\fP ¤¬»î¤ß¤é¤ì¡¢GID ¤ä UID ¤ÎÃͤ¬
-.I buf
-¤Ç»Ø¼¨¤µ¤ì¤ë¹½Â¤ÂΤ˳ÊǼ¤¹¤ë¤Ë¤ÏÂ礲᤮¤ë¡£
-.TP
-.B EPERM
-.\"O \fBIPC_SET\fP or \fBIPC_RMID\fP is attempted, and the
-.\"O effective user ID of the calling process is not that of the creator
-.\"O (found in
-.\"O .IR shm_perm.cuid ),
-.\"O or the owner
-.\"O (found in
-.\"O .IR shm_perm.uid ),
-.\"O and the process was not privileged (Linux: did not have the
-.\"O .B CAP_SYS_ADMIN
-.\"O capability).
-\fBIPC_SET\fP ¤« \fBIPC_RMID\fP ¤¬»î¤ß¤é¤ì¡¢
-¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â¸ú¥æ¡¼¥¶¡¼ ID ¤¬ºîÀ®¼Ô
-.RI ( shm_perm.cuid )
-¤Ç¤â½êͼÔ
-.RI ( shm_perm.uid )
-¤Ç¤â¤Ê¤¯¡¢¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤ (Linux ¤Ç¤Ï
-.B CAP_SYS_ADMIN
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£
+または (2.6.9 より前のカーネルで) \fBSHM_LOCK\fP または \fBSHM_UNLOCK\fP が指定されているが、プロセスが特権を持たない
+(Linux では \fBCAP_IPC_LOCK\fP ケーパビリティを持たない)。 (Linux 2.6.9 以降では、
+\fBRLIMIT_MEMLOCK\fP が 0 で呼び出し元が特権を持たない場合にも、このエラーが起こる。)
+.SH 準拠
+.\" SVr4 documents additional error conditions EINVAL,
+.\" ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents
+.\" an EIDRM error condition.
+SVr4, POSIX.1\-2001.
+.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
+でもこれらのインクルードをするように記載されている。このような古いシステムへの移植性を意図したアプリケーションではこれらのファイルをインクルードする必要があるかもしれない。
-.\"O Or (in kernels before 2.6.9),
-.\"O .B SHM_LOCK
-.\"O or
-.\"O .B SHM_UNLOCK
-.\"O was specified, but the process was not privileged
-.\"O (Linux: did not have the
-.\"O .B CAP_IPC_LOCK
-.\"O capability).
-¤Þ¤¿¤Ï (2.6.9 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç)
-.B SHM_LOCK
-¤Þ¤¿¤Ï
-.B SHM_UNLOCK
-¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤¬¡¢¥×¥í¥»¥¹¤¬Æø¢¤ò»ý¤¿¤Ê¤¤
-(Linux ¤Ç¤Ï
-.B CAP_IPC_LOCK
-¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤¿¤Ê¤¤)¡£
-.\"O (Since Linux 2.6.9, this error can also occur if the
-.\"O .B RLIMIT_MEMLOCK
-.\"O is 0 and the caller is not privileged.)
-(Linux 2.6.9 °Ê¹ß¤Ç¤Ï¡¢
-.B RLIMIT_MEMLOCK
-¤¬ 0 ¤Ç¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤â¡¢¤³¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë¡£)
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-SVr4, POSIX.1-2001.
-.\"O .\" SVr4 documents additional error conditions EINVAL,
-.\"O .\" ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents
-.\"O .\" an EIDRM error condition.
-.\" SVr4 ¤Ë¤Ï¾¤Ë EINVAL, ENOENT, ENOSPC, ENOMEM,
-.\" EEXIST ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ½Ò¤¬¤¢¤ë¡£
-.\" SVr4 ¤ª¤è¤Ó SVID ¤Ë¤Ï EIDRM ¥¨¥é¡¼¤Ë¤Ä¤¤¤Æ¤Îµ½Ò¤Ï¤Ê¤¤¡£
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O The
-.\"O .BR IPC_INFO ,
-.\"O .B SHM_STAT
-.\"O and
-.\"O .B SHM_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 SHM_STAT ,
-.B SHM_INFO
-Áàºî¤Ï¡¢
-.BR ipcs (1)
-¥×¥í¥°¥é¥à¤Ç³ä¤êÅö¤ÆºÑ¤Î»ñ¸»¤Ë´Ø¤¹¤ë¾ðÊó¤òÄ󶡤¹¤ë¤¿¤á¤Ë
-»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£¾Íè¡¢¤³¤ì¤é¤ÎÁàºî¤ÏÊѹ¹¤µ¤ì¤¿¤ê¡¢
-/proc ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë°ÜÆ°¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
+\fBIPC_INFO\fP, \fBSHM_STAT\fP, \fBSHM_INFO\fP 操作は、 \fBipcs\fP(1)
+プログラムで割り当て済の資源に関する情報を提供するために 使用されている。将来、これらの操作は変更されたり、 \fI/proc\fP
+ファイルシステムのインターフェースに移動されるかもしれない。
-.\"O Linux permits a process to attach
-.\"O .RB ( shmat (2))
-.\"O a shared memory segment that has already been marked for deletion
-.\"O using
-.\"O .IR shmctl(IPC_RMID) .
-.\"O This feature is not available on other UNIX implementations;
-.\"O portable applications should avoid relying on it.
-Linux ¤Ç¤Ï¡¢
-.I shmctl(IPC_RMID)
-¤ò»È¤Ã¤Æ¤¹¤Ç¤Ëºï½ü¥Þ¡¼¥¯¤¬¤Ä¤±¤é¤ì¤Æ¤¤¤ë¶¦Í¥á¥â¥ê¡¦¥»¥°¥á¥ó¥È¤ò
-¤¢¤ë¥×¥í¥»¥¹¤¬Éղà (attach)
-.RB ( shmat (2))
-¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£
-¤³¤Îµ¡Ç½¤Ï¾¤Î UNIX ¤Î¼ÂÁõ¤Ç¤ÏÍøÍѤǤ¤Ê¤¤¡£
-°Ü¿¢À¤ò¹Íθ¤·¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Ï¤³¤ì¤Ë°Í¸¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤¤Ç¤¢¤ë¡£
+Linux では、 \fIshmctl(IPC_RMID)\fP を使ってすでに削除マークがつけられている共有メモリーセグメントを あるプロセスが付加
+(attach) (\fBshmat\fP(2)) することを許可している。 この機能は他の UNIX の実装では利用できない。
+移植性を考慮したアプリケーションではこれに依存しないようにすべきである。
-.\"O Various fields in a \fIstruct shmid_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¹½Â¤ÂÎ shmid_ds\fP Æâ¤Î¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤Ï¡¢
-Linux 2.2 ¤Ç¤Ï
-.I short
-·¿¤À¤Ã¤¿¤¬¡¢Linux 2.4 ¤Ç¤Ï
-.I long
-·¿¤Ë¤Ê¤Ã¤¿¡£
-¤³¤ÎÍøÅÀ¤òÀ¸¤«¤¹¤Ë¤Ï¡¢glibc-2.1.91 °Ê¹ß¤Î´Ä¶²¼¤Ç
-ºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð½½Ê¬¤Ç¤¢¤ë¡£
-¥«¡¼¥Í¥ë¤Ï¿·¤·¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤È¸Å¤¤·Á¼°¤Î¸Æ¤Ó½Ð¤·¤ò
-.I cmd
-Æâ¤Î
-.B IPC_64
-¥Õ¥é¥°¤Ç¶èÊ̤¹¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR mlock (2),
-.BR setrlimit (2),
-.BR shmget (2),
-.BR shmop (2),
-.BR capabilities (7),
-.BR shm_overview (7),
-.BR svipc (7)
+\fI構造体 shmid_ds\fP 内の多くのフィールドは、 Linux 2.2 では \fIshort\fP 型だったが、Linux 2.4 では
+\fIlong\fP 型になった。 この利点を生かすには、glibc\-2.1.91 以降の環境下で 再コンパイルすれば十分である。
+カーネルは新しい形式の呼び出しと古い形式の呼び出しを \fIcmd\fP 内の \fBIPC_64\fP フラグで区別する。
+.SH 関連項目
+\fBmlock\fP(2), \fBsetrlimit\fP(2), \fBshmget\fP(2), \fBshmop\fP(2), \fBcapabilities\fP(7),
+\fBshm_overview\fP(7), \fBsvipc\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。