sigwait

Section: C Library Functions (3)
Updated: 2025-05-17
Index JM Home Page roff page
 

名前

sigwait - シグナルを待つ  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <signal.h>

int sigwait(const sigset_t *restrict set, int *restrict sig);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

sigwait():

    Since glibc 2.26:
        _POSIX_C_SOURCE >= 199506L
    glibc 2.25 and earlier:
        _POSIX_C_SOURCE
 

説明

The sigwait() function suspends execution of the calling thread until one of the signals specified in the signal set set becomes pending. For a signal to become pending, it must first be blocked with sigprocmask(2). The function accepts the signal (removes it from the pending list of signals), and returns the signal number in sig.

sigwait() の動作は sigwaitinfo(2) と同じだが、以下の点が異なる。

•
sigwait() は、シグナルの内容を表す siginfo_t 構造体を返すのではなく、単にシグナル番号を返す。
•
返り値が sigwaitinfo(2) とは異なる。
 

返り値

成功すると、 sigwait() は 0 を返す。 エラーの場合、(「エラー」の節のリストにある) 正のエラー番号を返す。  

エラー

EINVAL
set に無効なシグナル番号が入っている。
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
sigwait() Thread safetyMT-Safe
 

バージョン

sigwait() is implemented using sigtimedwait(2); consult its NOTES.

The glibc implementation of sigwait() silently ignores attempts to wait for the two real-time signals that are used internally by the NPTL threading implementation. See nptl(7) for details.  

標準規格

POSIX.1-2008.  

歴史

POSIX.1-2001.  

例

pthread_sigmask(3) を参照。  

関連項目

sigaction(2), signalfd(2), sigpending(2), sigsuspend(2), sigwaitinfo(2), sigsetops(3), signal(7)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
バージョン
標準規格
歴史
例
関連項目

This document was created by man2html, using the manual pages.