JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... ct msqid_ds * buf ); 説明 msgctl () はメッセージキュー識別子 msqid で指定された System V メッセージキュー (message queue) に対して cmd で指定された制御操作を行なう。 msqid_ds データ構造体は < sys/msg.h > で以下のように定義されている: str ... 2) */ time_t msg_ctime; /* Time of creation or last modification by msgctl() */ unsigned long msg_cbytes; /* # of bytes in queue */ msgqnum_t msg_qnum; /* # number of messages in queue */ msglen_t msg_qbytes; /* Maximum # of bytes in queue */ pid_t ms ... ィールドは以下の通りである: msg_perm This is an ipc_perm structure (see below) that specifies the access permissions on the message queue. msg_stime 最後の msgsnd (2) システムコールの時刻。 msg_rtime 最後の msgrcv (2) システムコールの時刻。 msg_ctime Tim ... ... び出し元プロセスは以下に示す構造体を用意し、この構造体への ポインターを msgp 引数として渡す。 struct msgbuf { long mtype; /* message type, must be > 0 */ char mtext[1]; /* message data */ }; mtext フィールドは配列 (または他の構造体) で、その大きさは 非負の ... が失敗した場合、 errno に以下の値のいずれかが設定される: EACCES The calling process does not have write permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EAGAIN msg_qby ... く、 msgflg に MSG_NOERROR が設定されていなかった。 EACCES The calling process does not have read permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EFAULT msgp が指して ... ... び出し元プロセスは以下に示す構造体を用意し、この構造体への ポインターを msgp 引数として渡す。 struct msgbuf { long mtype; /* message type, must be > 0 */ char mtext[1]; /* message data */ }; mtext フィールドは配列 (または他の構造体) で、その大きさは 非負の ... が失敗した場合、 errno に以下の値のいずれかが設定される: EACCES The calling process does not have write permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EAGAIN msg_qby ... く、 msgflg に MSG_NOERROR が設定されていなかった。 EACCES The calling process does not have read permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EFAULT msgp が指して ... ... び出し元プロセスは以下に示す構造体を用意し、この構造体への ポインターを msgp 引数として渡す。 struct msgbuf { long mtype; /* message type, must be > 0 */ char mtext[1]; /* message data */ }; mtext フィールドは配列 (または他の構造体) で、その大きさは 非負の ... が失敗した場合、 errno に以下の値のいずれかが設定される: EACCES The calling process does not have write permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EAGAIN msg_qby ... く、 msgflg に MSG_NOERROR が設定されていなかった。 EACCES The calling process does not have read permission on the message queue, and does not have the CAP_IPC_OWNER capability in the user namespace that governs its IPC namespace. EFAULT msgp が指して ... ... だが、同様の機能を提供する。 メッセージキューの作成とオープンは mq_open (3) を使って行う。この関数は メッセージキュー記述子 (message queue descriptor) ( mqd_t ) を返す。これ以降のコールでは、オープンされたメッセージキューは メッセージキュー記述子 を使って ... のメッセージ到着を非同期で 通知するように要求することもできる。 メッセージキュー記述子は オープンメッセージキュー記述 (open message queue description) への参照である ( open (2) も参照)。 fork (2) 実行後は、子プロセスは親プロセスのメッセージキュー記述子の ... ートされている。 カーネルの設定 POSIX メッセージキューのサポートは、カーネルの設定 (configuration) オプション CONFIG_POSIX_MQUEUE で設定可能である。このオプションはデフォルトでは有効である。 持続性 POSIX メッセージキューはカーネル内で保持される。 mq_un ... ... int msgflg ); 説明 The msgget () system call returns the System V message queue identifier associated with the value of the key argument. It may be used either to obtain the identifier of a previo ... usly created message queue (when msgflg is zero and key does not have the value IPC_PRIVATE ), or to create a new set. key の値が IPC_PRIVATE の ... が返され、 errno にそのエラーが示される。 エラー 失敗した場合、 errno に以下の値のいずれか一つが設定される: EACCES A message queue exists for key , but the calling process does not have permission to access the queue, and does not have the CAP_IPC_OWNER ... ... eof(cpu)); Because all of the packets for a single stream (i.e., all packets for the same 4-tuple) arrive on the single RX queue that is associated with a particular CPU, the typical use case is to employ one listening process per RX queue, with the i ... ncoming flow being handled by a listener on the same CPU that is handling the RX queue. This provides optimal NUMA behavior and keeps CPU caches hot. SO_INCOMING_NAPI_ID (gettable since Linux 4.12) Returns a s ... to receive datagrams on the same socket. SO_RXQ_OVFL (Linux 2.6.33 以降) Indicates that an unsigned 32-bit value ancillary message (cmsg) should be attached to received skbs indicating the number of packets dropped by the socket since its creation. SO_S ... ... / long mq_curmsgs; /* キューに現在入っているメッセージ数 */ }; mq_flags フィールドには、オープンメッセージキュー記述 (open message queue description) に関連付けられているフラグが格納される。 このフィールドは mq_open (3) でキューが作成される際に初期化され ... るデフォルトの mq_maxmsg と mq_msgsize の値を表示できる。 このプログラムの実行例を以下に示す。 $ ./a.out /testq Maximum # of messages on queue: 10 Maximum message size: 8192 Linux 3.5 以降では、 ( mq_overview (7) に説明がある) 以下の /proc ファイルを使って ... デフォルト値を制御できる。 $ uname -sr Linux 3.8.0 $ cat /proc/sys/fs/mqueue/msg_default 10 $ cat /proc/sys/fs/mqueue/msgsize_default 8192 プログラムのソース #include < mqueue.h > #include < sys/stat ... ... / long mq_curmsgs; /* キューに現在入っているメッセージ数 */ }; mq_flags フィールドには、オープンメッセージキュー記述 (open message queue description) に関連付けられているフラグが格納される。 このフィールドは mq_open (3) でキューが作成される際に初期化され ... るデフォルトの mq_maxmsg と mq_msgsize の値を表示できる。 このプログラムの実行例を以下に示す。 $ ./a.out /testq Maximum # of messages on queue: 10 Maximum message size: 8192 Linux 3.5 以降では、 ( mq_overview (7) に説明がある) 以下の /proc ファイルを使って ... デフォルト値を制御できる。 $ uname -sr Linux 3.8.0 $ cat /proc/sys/fs/mqueue/msg_default 10 $ cat /proc/sys/fs/mqueue/msgsize_default 8192 プログラムのソース #include < mqueue.h > #include < sys/stat ... ... , size_t msg_len , unsigned int * msg_prio ); #include < time.h > #include < mqueue.h > ssize_t mq_timedreceive(mqd_t mqdes , char * msg_ptr , size_t msg_len , unsigned int * msg_prio , const struct timespe ... 、新しいメッセージが届くか、関数呼び出しがシグナルハンドラーにより 中断されるまで、停止 (block) する。 メッセージキュー記述 (message queue description) で O_NONBLOCK フラグが有効になっている場合は、 mq_receive () はエラー EAGAIN ですぐに失敗する。 mq_time ... dreceive () behaves just like mq_receive (), except that if the queue is empty and the O_NONBLOCK flag is not enabled for the message queue description, then abs_timeout points to a structure ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。