12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include <signal.h>
- #ifdef SA_RESTART
- # define __need_NULL
- # include <stddef.h>
- #else
- # include <errno.h>
- #endif
- int siginterrupt (int sig, int interrupt)
- {
- #ifdef SA_RESTART
- struct sigaction action;
-
- if (sigaction (sig, NULL, &action) < 0)
- return -1;
- if (interrupt)
- {
- __sigaddset (&_sigintr, sig);
- action.sa_flags &= ~SA_RESTART;
- }
- else
- {
- __sigdelset (&_sigintr, sig);
- action.sa_flags |= SA_RESTART;
- }
- return sigaction (sig, &action, NULL);
- #else
- __set_errno (ENOSYS);
- return -1;
- #endif
- }
|