siginterrupt - allow signals to interrupt functions
#include <signal.h>
int siginterrupt(int sig, int flag);
The siginterrupt() function shall change the restart behavior when a function is interrupted by the specified signal. The function siginterrupt(sig, flag) has an effect as if implemented as:
int siginterrupt(int sig, int flag) { int ret; struct sigaction act; (void) sigaction(sig, NULL, &act); if (flag) act.sa_flags &= ~SA_RESTART; else act.sa_flags |= SA_RESTART; ret = sigaction(sig, &act, NULL); return ret; }
Upon successful completion, siginterrupt() shall return 0; otherwise, -1 shall be returned and errno set to indicate the error.
The siginterrupt() function shall fail if:
The following sections are informative.
The siginterrupt() function supports programs written to historical system interfaces. A conforming application, when being written or rewritten, should use sigaction() with the SA_RESTART flag instead of siginterrupt().
Signal Concepts , sigaction() , the Base Definitions volume of IEEE Std 1003.1-2001, <signal.h>
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |