1 .\" Copyright 1993 Giorgio Ciucci <giorgio@crcc.it>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provflags the copyright notice and this permission notice are
5 .\" preserved on all copies.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Added correction due to Nick Duffek <nsd@bbc.com>, aeb, 960426
24 .\" Modified Wed Nov 6 04:00:31 1996 by Eric S. Raymond <esr@thyrsus.com>
25 .\" Modified, 8 Jan 2003, Michael Kerrisk, <mtk.manpages@gmail.com>
26 .\" Removed EIDRM from errors - that can't happen...
27 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
28 .\" Added notes on capability requirements
29 .\" Modified, 11 Nov 2004, Michael Kerrisk <mtk.manpages@gmail.com>
30 .\" Language and formatting clean-ups
31 .\" Added notes on /proc files
33 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
34 .\" all rights reserved.
35 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Modified 2003-07-03, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
37 .\" Updated 2005-03-04, Akihiro MOTOKI
39 .\"WORD: message メッセージ
41 .\"WORD: identifier 識別子
46 .\"WORD: initialize 初期化
47 .\"WORD: effective user ID 実効ユーザーID
48 .\"WORD: effective group ID 実効グループID
49 .\"WORD: current time 現在時刻
50 .\"WORD: destruction 破棄
53 .TH MSGGET 2 2004-05-27 "Linux" "Linux Programmer's Manual"
55 .\"O msgget \- get a message queue identifier
57 msgget \- メッセージ・キュー識別子を取得する
61 .B #include <sys/types.h>
62 .B #include <sys/ipc.h>
63 .B #include <sys/msg.h>
65 .BI "int msgget(key_t " key ", int " msgflg );
71 .\"O system call returns the message queue identifier associated
72 .\"O with the value of the
78 引き数の値に対応するメッセージ・キューの識別子を返す。
79 .\"O A new message queue is created if
86 .\"O .BR IPC_PRIVATE ,
87 .\"O no message queue with the given key
115 .\"O and a message queue already exists for
123 .\"O (This is analogous to the effect of the combination
124 .\"O .B O_CREAT | O_EXCL
134 に対応するメッセージ・キューが既に存在すると、
147 .\"O Upon creation, the least significant bits of the argument
149 .\"O define the permissions of the message queue.
150 .\"O These permission bits have the same format and semantics
151 .\"O as the permissions specified for the
155 .\"O (The execute permissions are not used.)
159 そのメッセージ・キューのアクセス許可の定義として使用される。
167 システム・コールのアクセス許可パラメータと同じ形式で、同じ意味を持つ。
168 (但し、実行 (execute) 許可は使用されない。)
170 .\"O If a new message queue is created,
171 .\"O then its associated data structure
175 .\"O is initialized as follows:
178 システム・コールはメッセージ・キューのデータ構造体
186 .\"O .I msg_perm.cuid
189 .\"O are set to the effective user ID of the calling process.
193 に呼び出し元プロセスの実効 (effective) ユーザーID を設定する。
195 .\"O .I msg_perm.cgid
198 .\"O are set to the effective group ID of the calling process.
202 に呼び出し元プロセスの実効 (effective) グループID を設定する。
204 .\"O The least significant 9 bits of
205 .\"O .I msg_perm.mode
206 .\"O are set to the least significant 9 bits of
228 .\"O is set to the current time.
233 .\"O is set to the system limit
236 に、システムで決められたメッセージ・キューの最大サイズ
240 .\"O If the message queue already exists the permissions are
241 .\"O verified, and a check is made to see if it is marked for
243 メッセージ・キューがすでに存在する場合は、アクセス許可の検査と、
244 破棄 (destruction) マークがないかの確認が行われる。
245 .\"O .SH "RETURN VALUE"
247 .\"O If successful, the return value will be the message queue identifier (a
248 .\"O nonnegative integer), otherwise \-1
251 .\"O indicating the error.
252 成功した場合、返り値はメッセージ・キュー識別子 (非負の整数) となる。
260 .\"O is set to one of the following values:
266 .\"O A message queue exists for
268 .\"O but the calling process does not have permission to access the queue,
269 .\"O and does not have the
270 .\"O .B CAP_IPC_OWNER
273 に対応するメッセージ・キューは存在するが、
274 呼び出し元プロセスはそのキューに対するアクセス許可がなく、
279 .\"O A message queue exists for
297 .\"O No message queue exists for
311 .\"O A message queue has to be created but the system does not have enough
312 .\"O memory for the new data structure.
313 メッセージ・キューを作成しようとしたが、新しいデータ構造体を作成
314 するのに十分なメモリがシステムに存在しない。
317 .\"O A message queue has to be created but the system limit for the maximum
318 .\"O number of message queues
320 .\"O would be exceeded.
321 メッセージ・キューを作成しようとしたが、作成すると
322 システム全体のメッセージ・キュー数の最大値
325 .\"O .SH "CONFORMING TO"
331 .\"O isn't a flag field but a
338 .\"O If this special value is used for
340 .\"O the system call ignores everything but the least significant 9 bits of
342 .\"O and creates a new message queue (on success).
350 (成功した場合は) 新しいメッセージ・キューを作成する。
352 .\"O The following is a system limit on message queue resources affecting a
356 システムコールに影響を及ぼすメッセージ・キューの資源の
360 .\"O System wide maximum number of message queues: policy
362 .\"O (on Linux, this limit can be read and modified via
363 .\"O .IR /proc/sys/kernel/msgmni ).
364 システム全体のメッセージ・キュー数の最大値: 方針依存
366 .I /proc/sys/kernel/msgmni
368 .\"O .SS "Linux Notes"
370 .\"O Until version 2.3.20 Linux would return
374 .\"O on a message queue scheduled for deletion.
375 Linux 2.3.20 までは、削除が予定されているメッセージ・キューに対して
384 .\"O was perhaps unfortunate,
386 .\"O would more clearly show its function.
388 という名前を選んだのはおそらく失敗であろう。
390 の方がより明確にその機能を表しているだろう。
397 .BR capabilities (7),