OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / draft / man3 / sigqueue.3
1 .\" Copyright (c) 2002 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" added note on self-signaling, aeb, 2002-06-07
26 .\" added note on CAP_KILL, mtk, 2004-06-16
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH SIGQUEUE 3 2012\-03\-25 Linux "Linux Programmer's Manual"
34 .SH 名前
35 sigqueue \- シグナルとデータをプロセスに送る
36 .SH 書式
37 \fB#include <signal.h>\fP
38 .sp
39 \fBint sigqueue(pid_t \fP\fIpid\fP\fB, int \fP\fIsig\fP\fB, const union sigval
40 \fP\fIvalue\fP\fB);\fP
41 .sp
42 .in -4n
43 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
44 .in
45 .sp
46 \fBsigqueue\fP(): _POSIX_C_SOURCE\ >=\ 199309L
47 .SH 説明
48 \fBsigqueue\fP()  は \fIsig\fP で指定されたシグナルを、PID が \fIpid\fP であるプロセスに送る。 シグナルを送るのに必要な権限は
49 \fBkill\fP(2)  と同じである。 \fBkill\fP(2)  と同様に、ヌル・シグナル (0) を使って 指定した PID
50 のプロセスが存在するかをチェックすることができる。
51 .PP
52 \fIvalue\fP 引き数はシグナルと一緒に送るデータの付属アイテムを指定する。 \fIvalue\fP は (整数またはポインタの値であり)
53 以下のような型である。
54 .sp
55 .in +4n
56 .nf
57 union sigval {
58     int   sival_int;
59     void *sival_ptr;
60 };
61 .fi
62 .in
63
64 受取先のプロセスに、このシグナルに対するハンドラを (\fBsigaction\fP(2)  に \fBSA_SIGINFO\fP を指定して)
65 インストールしておくと、 そのハンドラの第 2 引き数に渡される \fIsiginfo_t\fP 構造体の \fIsi_value\fP
66 フィールドによって、このデータを取得できる。 さらに、この構造体の \fIsi_code\fP フィールドは \fBSI_QUEUE\fP に設定される。
67 .SH 返り値
68 成功した場合、 \fBsigqueue\fP()  は 0 を返す。 これは受け取り側プロセスの待ち行列に シグナルが正しく入れられたことを示す。
69 失敗した場合は \-1 が返され、 \fIerrno\fP がエラーを表す値に設定される。
70 .SH エラー
71 .TP 
72 \fBEAGAIN\fP
73 待ち行列に入れられるシグナルの最大数に達した (より詳しい情報は \fBsignal\fP(7)  を参照すること)。
74 .TP 
75 \fBEINVAL\fP
76 \fIsig\fP が不正である。
77 .TP 
78 \fBEPERM\fP
79 このプロセスには、受け取り側プロセスにシグナルを送る権限がない。 必要な権限については、 \fBkill\fP(2)  を参照すること。
80 .TP 
81 \fBESRCH\fP
82 \fIpid\fP にマッチする PID のプロセスがない。
83 .SH バージョン
84 このシステムコールは Linux 2.2 で初めて登場した。
85 .SH 準拠
86 POSIX.1\-2001.
87 .SH 注意
88 この関数を呼び出したプロセスにこの関数がシグナルを送ったときに、 シグナルが呼び出し側スレッドにブロックされず、 かつ
89 (シグナルがブロックされなかった、または \fBsigwait\fP(3)  を使用するのを待っていることにより)
90 このシグナルを扱うスレッドが何もない場合は、 この関数がリターンする前に、少なくとも そのスレッドに対してシグナルが配送されていなければならない。
91
92 Linux では、この関数は \fBrt_sigqueueinfo\fP(2)  システムコールを使って実装されている。 両者には 3
93 番目の引き数に違いがあり、 \fBrt_sigqueueinfo\fP(2)  では 3 番目の引き数は \fIsiginfo_t\fP 構造体である。
94 \fIsiginfo_t\fP 構造体は、シグナルを受信するプロセスのシグナルハンドラに渡されたり、 シグナル受信プロセスの
95 \fBsigtimedwait\fP(2)  システムコールから返されたりする。 glibc の \fBsigqueue\fP()  ラッパー関数内部では、
96 この引き数 \fIuinfo\fP は以下のように初期化される。
97 .in +4n
98 .nf
99
100 uinfo.si_signo = sig;      /* argument supplied to sigqueue() */
101 uinfo.si_code = SI_QUEUE;
102 uinfo.si_pid = getpid();   /* Process ID of sender */
103 uinfo.si_uid = getuid();   /* Real UID of sender */
104 uinfo.si_value = val;      /* argument supplied to sigqueue() */
105 .fi
106 .in
107 .SH 関連項目
108 \fBkill\fP(2), \fBrt_sigqueueinfo\fP(2), \fBsigaction\fP(2), \fBsignal\fP(2),
109 \fBpthread_sigqueue\fP(3), \fBsigwait\fP(3), \fBsignal\fP(7)
110 .SH この文書について
111 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
112 である。プロジェクトの説明とバグ報告に関する情報は
113 http://www.kernel.org/doc/man\-pages/ に書かれている。