JM プロジェクトは、主に Linux 関連のマニュアルページの日本語ページを翻訳・公開しています。
... r value */ void *sival_ptr; /* Pointer value */ }; struct sigevent { int sigev_notify; /* Notification method */ int sigev_signo; /* Notification signal */ union sigval sigev_value; /* Data passed with notification */ void (*sigev_notify_function) (un ... ルドは、以下のいずれかの値である。 SIGEV_NONE 「空 (null)」の通知。 イベントが発生時には何もしないこと。 SIGEV_SIGNAL sigev_signo で指定されたシグナルを送信することで、プロセスへの通知を行う。 sigaction (2) の SA_SIGINFO フラグを使った登録されたシグナル ... fo_t 構造体の以下のフィールドが設定される。 si_code このフィールドには通知を配送した API に応じた決まる値が設定される。 si_signo このフィールドにはシグナル番号 (すなわち sigev_signo と同じ値) が設定される。 si_value このフィールドには sigev_value で指 ... ... : 呼び出し元のプロセスを通知の宛先として登録するが、 実際にはメッセージが到着した時に通知は送られない。 SIGEV_SIGNAL sigev_signo で指定されたシグナルを送って、プロセスに通知する。 一般的な詳細については sigevent (7) を参照。 siginfo_t 構造体の si_code ... る。 EINVAL sevp->sigev_notify が許可された値のいずれでもない。もしくは sevp->sigev_notify が SIGEV_SIGNAL だが sevp->sigev_signo が有効なシグナル番号ではない。 ENOMEM 十分なメモリーがない。 POSIX.1-2008 では、 sevp が NULL で、呼び出し元のプロセスがキ ... ... からの read (2) で返される signalfd_siginfo 構造体のフォーマットは以下の通りである。 struct signalfd_siginfo { uint32_t ssi_signo; /* シグナル番号 */ int32_t ssi_errno; /* エラー番号 (未使用) */ int32_t ssi_code; /* シグナルコード */ uint32_t ssi_pid; ... rror("signalfd"); for (;;) { s = read(sfd, &fdsi, sizeof(fdsi)); if (s != sizeof(fdsi)) handle_error("read"); if (fdsi.ssi_signo == SIGINT) { printf("Got SIGINT\n"); } else if (fdsi.ssi_signo == SIGQUIT) { printf("Got SIGQUIT\n"); exit(EXIT_SUCCESS); ... ... からの read (2) で返される signalfd_siginfo 構造体のフォーマットは以下の通りである。 struct signalfd_siginfo { uint32_t ssi_signo; /* シグナル番号 */ int32_t ssi_errno; /* エラー番号 (未使用) */ int32_t ssi_code; /* シグナルコード */ uint32_t ssi_pid; ... rror("signalfd"); for (;;) { s = read(sfd, &fdsi, sizeof(fdsi)); if (s != sizeof(fdsi)) handle_error("read"); if (fdsi.ssi_signo == SIGINT) { printf("Got SIGINT\n"); } else if (fdsi.ssi_signo == SIGQUIT) { printf("Got SIGQUIT\n"); exit(EXIT_SUCCESS); ... ... : 呼び出し元のプロセスを通知の宛先として登録するが、 実際にはメッセージが到着した時に通知は送られない。 SIGEV_SIGNAL sigev_signo で指定されたシグナルを送って、プロセスに通知する。 一般的な詳細については sigevent (7) を参照。 siginfo_t 構造体の si_code ... る。 EINVAL sevp->sigev_notify が許可された値のいずれでもない。もしくは sevp->sigev_notify が SIGEV_SIGNAL だが sevp->sigev_signo が有効なシグナル番号ではない。 ENOMEM 十分なメモリーがない。 POSIX.1-2008 では、 sevp が NULL で、呼び出し元のプロセスがキ ... ... ディレクトリ内の各ファイルの内容は 1行であり、 キューに関する情報が表示される。 $ cat /dev/mqueue/mymq QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260 各フィールドの詳細は以下の通りである: QSIZE キューに入っている全メッセージの合計バイト数 (ただし「バグ」 ... が行われるかは、以下のフィールドにより決定される。 NOTIFY 通知方法: 0 は SIGEV_SIGNAL ; 1 は SIGEV_NONE ; 2 は SIGEV_THREAD SIGNO SIGEV_SIGNAL に使用されるシグナル番号。 Linux でのメッセージキュー記述子の実装 On Linux, a message queue descriptor is act ... ... t make any use of the third argument. The siginfo_t data type is a structure with the following fields: siginfo_t { int si_signo; /* Signal number */ int si_errno; /* An errno value */ int si_code; /* Signal code */ int si_trapno; /* Trap number that ... system call (since Linux 3.5) */ unsigned int si_arch; /* Architecture of attempted system call (since Linux 3.5) */ } si_signo , si_errno , si_code は全てのシグナルに対して定義されている ( si_errno は Linux では一般的には使用されない)。 構造体の残り ... ... t make any use of the third argument. The siginfo_t data type is a structure with the following fields: siginfo_t { int si_signo; /* Signal number */ int si_errno; /* An errno value */ int si_code; /* Signal code */ int si_trapno; /* Trap number that ... system call (since Linux 3.5) */ unsigned int si_arch; /* Architecture of attempted system call (since Linux 3.5) */ } si_signo , si_errno , si_code は全てのシグナルに対して定義されている ( si_errno は Linux では一般的には使用されない)。 構造体の残り ... ... si_pid 子プロセスのプロセスID。 si_uid 子プロセスの実ユーザーID (このフィールドは他のほとんどの実装では設定されない)。 si_signo 常に SIGCHLD が設定される。 si_status _exit (2) (か exit (3)) に指定された子プロセスの終了ステータス、もしくは 子プロセスの ... G is specified in options and there were no children in a waitable state, then waitid () should zero out the si_pid and si_signo fields of the structure. On Linux and other implementations that adhere to this requirement, it is not necessary to zero o ... ... si_pid 子プロセスのプロセスID。 si_uid 子プロセスの実ユーザーID (このフィールドは他のほとんどの実装では設定されない)。 si_signo 常に SIGCHLD が設定される。 si_status _exit (2) (か exit (3)) に指定された子プロセスの終了ステータス、もしくは 子プロセスの ... G is specified in options and there were no children in a waitable state, then waitid () should zero out the si_pid and si_signo fields of the structure. On Linux and other implementations that adhere to this requirement, it is not necessary to zero o ... 日本語の文書やマニュアルを配布している個人/プロジェクトへのリンクです。