OSDN Git Service

(split) LDP: Force update POT and ja.po
[linuxjm/LDP_man-pages.git] / draft / man7 / svipc.7
1 .\" Copyright 1993 Giorgio Ciucci (giorgio@crcc.it)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" FIXME There is now duplication of some of the information
24 .\" below in semctl.2, msgctl.2, and shmctl.2 -- MTK, Nov 04
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH SVIPC 7 2009\-01\-26 Linux "Linux Programmer's Manual"
31 .SH 名前
32 svipc \- System V プロセス間通信機構
33 .SH 書式
34 .nf
35 \fB#include <sys/types.h>\fP
36 \fB#include <sys/ipc.h>\fP
37 \fB#include <sys/msg.h>\fP
38 \fB#include <sys/sem.h>\fP
39 \fB#include <sys/shm.h>\fP
40 .fi
41 .SH 説明
42 このマニュアルページは System V プロセス間通信 (interprocess communication; IPC) 機構の Linux に
43 おける実装を説明する。 このプロセス間通信機構には、 メッセージキュー (message queue)、セマフォー集合 (semaphore set)、
44 共有メモリセグメント (shared memory segment) などがある。以下で \fI資源 (resource)\fP
45 という用語を使用した場合にはこれらの機構のどれかを意味する。
46 .SS 資源へのアクセス許可
47 システムのそれぞれの資源は、IPC への操作を許可するかどうかを決定する ための情報を共通の構造体 \fIstruct ipc_perm\fP
48 に格納して使用する。 \fIipc_perm\fP 構造体は、ヘッダーファイルの \fI<sys/ipc.h>\fP
49 に定義されており、以下のメンバーが含まれている:
50 .in +4n
51 .nf
52
53 struct ipc_perm {
54     uid_t          cuid;   /* 作成者のユーザーID */
55     gid_t          cgid;   /* 作成者のグループID */
56     uid_t          uid;    /* 所有者のユーザーID */
57     gid_t          gid;    /* 所有者のグループID */
58     unsigned short mode;   /* 読み書きの許可 */
59 };
60 .fi
61 .in
62 .PP
63 \fIipc_perm\fP 構造体の \fImode\fP メンバーは以下の 9 ビットで、プロセスの IPC システムコール
64 による資源へのアクセス許可を定義する。 許可は以下のように解釈される:
65 .sp
66 .nf
67     0400    ユーザーによる読み込み。
68     0200    ユーザーによる書き込み。
69 .sp .5
70     0040    グループによる読み込み。
71     0020    グループによる書き込み。
72 .sp .5
73     0004    他人による読み込み。
74     0002    他人による書き込み。
75 .fi
76 .PP
77 システムはビット 0100, 0010, 0001 (実行ビット) は使用しない。 さらに、セマフォーの場合には "書き込み(write)" は実際には
78 "変更(alter)" を意味する。
79 .PP
80 同じヘッダーファイルには以下のシンボルの定義が含まれている:
81 .TP  14
82 \fBIPC_CREAT\fP
83 キー(key)が存在しない場合には新たなエントリを作成する。
84 .TP 
85 \fBIPC_EXCL\fP
86 キー(key)が存在する場合には失敗する。
87 .TP 
88 \fBIPC_NOWAIT\fP
89 要求が待たされる場合にはエラーになる。
90 .TP 
91 \fBIPC_PRIVATE\fP
92 プライベートキー。
93 .TP 
94 \fBIPC_RMID\fP
95 資源を削除する。
96 .TP 
97 \fBIPC_SET\fP
98 資源にオプションを設定する。
99 .TP 
100 \fBIPC_STAT\fP
101 資源のオプションを取得する。
102 .PP
103 \fBIPC_PRIVATE\fP は \fIkey_t\fP 型である。その他の全てのシンボルはフラグフィールドとして \fIint\fP 変数に OR
104 演算で格納することができる。
105 .SS メッセージキュー
106 メッセージキューは正の整数 (\fImsqid\fP)  によって識別され、 \fI<sys/msg.h>\fP に定義されている構造体
107 \fIstruct msqid_ds\fP に結びつけられている。 この構造体は以下のメンバーを含んでいる:
108 .in +4n
109 .nf
110
111 struct msqid_ds {
112     struct ipc_perm msg_perm;
113     msgqnum_t       msg_qnum;    /* キューにあるメッセージの数 */
114     msglen_t        msg_qbytes;  /* キューの最大バイト数 */
115     pid_t           msg_lspid;   /* 最後に msgsnd(2) をした PID */
116     pid_t           msg_lrpid;   /* 最後に msgrcv(2) をした PID */
117     time_t          msg_stime;   /* 最後に msgsnd(2) をした時間 */
118     time_t          msg_rtime;   /* 最後に msgrcv(2) をした時間 */
119     time_t          msg_ctime;   /* 最後に変更された時間 */
120 };
121 .fi
122 .in
123 .TP  11
124 \fImsg_perm\fP
125 メッセージキューへのアクセス許可を指定する \fIipc_perm\fP 構造体。
126 .TP 
127 \fImsg_qnum\fP
128 現在、このメッセージキューにあるメッセージの数。
129 .TP 
130 \fImsg_qbytes\fP
131 メッセージキューに入れることができるメッセージの最大バイト数。
132 .TP 
133 \fImsg_lspid\fP
134 最後に \fBmsgsnd\fP(2)  システムコールを行なったプロセスの ID。
135 .TP 
136 \fImsg_lrpid\fP
137 最後に \fBmsgrcv\fP(2)  システムコールを行なったプロセスの ID。
138 .TP 
139 \fImsg_stime\fP
140 最後に \fBmsgsnd\fP(2)  システムコールを行なった時間。
141 .TP 
142 \fImsg_rtime\fP
143 最後に \fBmsgrcv\fP(2)  を行なった時間。
144 .TP 
145 \fImsg_ctime\fP
146 最後に \fImsqid_ds\fP 構造体のメンバーが変更された時間。
147 .SS セマフォー集合
148 セマフォー集合は正の整数 (\fIsemid\fP)  によって識別され、 \fI<sys/sem.h>\fP に定義されている構造体
149 \fIstruct semid_ds\fP に結びつけられている。 この構造体は以下のメンバーを含んでいる:
150 .in +4n
151 .nf
152
153 struct semid_ds {
154     struct ipc_perm sem_perm;
155     time_t          sem_otime;   /* 最後に操作した時間 */
156     time_t          sem_ctime;   /* 最後に変更した時間 */
157     unsigned long   sem_nsems;   /* 集合の中にあるセマフォー数 */
158 };
159 .fi
160 .in
161 .TP  11
162 \fIsem_perm\fP
163 セマフォー集合へのアクセス許可を指定する \fIipc_perm\fP 構造体。
164 .TP 
165 \fIsem_otime\fP
166 最後に \fBsemop\fP(2)  システムコールを行なった時間。
167 .TP 
168 \fIsem_ctime\fP
169 最後に \fBsemctl\fP(2)  を行なって上記の構造体のメンバーを変更するか、セマフォー集合に属する セマフォーを変更した時間。
170 .TP 
171 \fIsem_nsems\fP
172 セマフォー集合の中にあるセマフォーの数。 集合の中にあるそれぞれのセマフォーは負でない整数によって参照され、 \fB0\fP から
173 \fIsem_nsems\-1\fP までの番号を持つ。
174 .PP
175 セマフォーは \fIstruct sem\fP 型のデータ構造体であり、以下のメンバーを含んでいる:
176 .in +4n
177 .nf
178
179 .\"    unsigned short semncnt; /* nr awaiting semval to increase */
180 .\"    unsigned short semzcnt; /* nr awaiting semval = 0 */
181 struct sem {
182     int semval;  /* セマフォーの値 */
183     int sempid;  /* 最後に操作したプロセス ID */
184 };
185 .fi
186 .in
187 .TP  11
188 \fIsemval\fP
189 セマフォー値: 負でない整数。
190 .TP 
191 \fIsempid\fP
192 .\".TP
193 .\".I semncnt
194 .\"Number of processes suspended awaiting for
195 .\".I semval
196 .\"to increase.
197 .\".TP
198 .\".I semznt
199 .\"Number of processes suspended awaiting for
200 .\".I semval
201 .\"to become zero.
202 このセマフォーを最後に操作したプロセスの ID。
203 .SS 共有メモリセグメント
204 共有メモリセグメントは正の整数 (\fIshmid\fP)  によって識別され、 \fI<sys/shm.h>\fP に定義されている
205 \fIstruct shmid_ds\fP 構造体に結びつけられている。 この構造体は以下のメンバーを含んでいる:
206 .in +4n
207 .nf
208
209 struct shmid_ds {
210     struct ipc_perm shm_perm;
211     size_t          shm_segsz;   /* セグメントのサイズ */
212     pid_t           shm_cpid;    /* 作成者のプロセス ID */
213     pid_t           shm_lpid;    /* 最後に操作したプロセス ID */
214     shmatt_t        shm_nattch;  /* 現在、付加している数 */
215     time_t          shm_atime;   /* 最後に付加した時間 */
216     time_t          shm_dtime;   /* 最後に分離した時間 */
217     time_t          shm_ctime;   /* 最後に変更した時間 */
218 };
219 .fi
220 .in
221 .TP  11
222 \fIshm_perm\fP
223 共有メモリセグメントへのアクセス許可を指定した \fIipc_perm\fP 構造体。
224 .TP 
225 \fIshm_segsz\fP
226 共有メモリセグメントのバイト数。
227 .TP 
228 \fIshm_cpid\fP
229 共有メモリセグメントを作成したプロセスの ID。
230 .TP 
231 \fIshm_lpid\fP
232 最後に \fBshmat\fP(2)  または \fBshmdt\fP(2)  システムコールを実行したプロセスの ID。
233 .TP 
234 \fIshm_nattch\fP
235 この共有メモリセグメントをメモリに付加 (attach) しているプロセスの数。
236 .TP 
237 \fIshm_atime\fP
238 最後に \fBshmat\fP(2)  システムコールを行なった時間。
239 .TP 
240 \fIshm_dtime\fP
241 最後に \fBshmdt\fP(2)  システムコールを行なった時間。
242 .TP 
243 \fIshm_ctime\fP
244 最後に \fBshmctl\fP(2)  システムコールを行なって、 \fIshmid_ds\fP 構造体を変更した時間。
245 .SH 関連項目
246 \fBipc\fP(2), \fBmsgctl\fP(2), \fBmsgget\fP(2), \fBmsgrcv\fP(2), \fBmsgsnd\fP(2),
247 \fBsemctl\fP(2), \fBsemget\fP(2), \fBsemop\fP(2), \fBshmat\fP(2), \fBshmctl\fP(2),
248 \fBshmdt\fP(2), \fBshmget\fP(2), \fBftok\fP(3)
249 .SH この文書について
250 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部
251 である。プロジェクトの説明とバグ報告に関する情報は
252 http://www.kernel.org/doc/man\-pages/ に書かれている。