sigpending
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
sigpending, rt_sigpending - 処理待ちのシグナルの検査
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <signal.h>
int sigpending(sigset_t *set);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
sigpending():
_POSIX_C_SOURCE
説明
sigpending() は、呼び出し元のスレッドへの配送を待っている (pending) シグナル集合 (すなわち、禁止中に発生したシグナル)
を返す。 処理待ちのシグナルのマスクが set に格納される。
返り値
sigpending() returns 0 on success. On failure, -1 is returned and
errno is set to indicate the error.
エラー
- EFAULT
-
set が指しているメモリーが、プロセスのアドレス空間の有効な部分ではない。
標準規格
POSIX.1-2024.
歴史
POSIX.1-2001.
C ライブラリとカーネルの違い
The original Linux system call was named sigpending(). However, with the
addition of real-time signals in Linux 2.2, the fixed-size, 32-bit
sigset_t argument supported by that system call was no longer fit for
purpose. Consequently, a new system call, rt_sigpending(), was added to
support an enlarged sigset_t type. The new system call takes a second
argument, size_t sigsetsize, which specifies the size in bytes of the
signal set in set. The glibc sigpending() wrapper function hides
these details from us, transparently calling rt_sigpending() when the
kernel provides it.
注意
シグナル集合の操作に関する詳細は sigsetops(3) を参照のこと。
シグナルが禁止 (ブロック) されており、かつ配送方法が "ignored" (無視)
になっている場合、そのシグナルが発生した場合に処理待ちシグナルのマスクにそのシグナルは追加されない。
あるスレッドに対する処理待ちのシグナルの集合は、 そのスレッド自体への処理待ちのシグナル集合と、プロセス全体への処理待ちの
シグナル集合をあわせたものである。 signal(7) 参照。
fork(2) 経由で作成された子プロセスでは、処理待ちのシグナル集合は空の集合で初期化される。 execve(2)
の前後で、処理待ちのシグナル集合は保持される。
バグ
Up to and including glibc 2.2.1, there is a bug in the wrapper function for
sigpending() which means that information about pending real-time
signals is not correctly returned.
関連項目
kill(2), sigaction(2), signal(2), sigprocmask(2),
sigsuspend(2), sigsetops(3), signal(7)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- エラー
-
- 標準規格
-
- 歴史
-
- C ライブラリとカーネルの違い
-
- 注意
-
- バグ
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.