#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void sig(int x)
{
printf("Try to kill me (pid=%ld)\n",(long)getpid());
sleep(100);
printf("Exiting\n");
exit(1);
}
int main()
{
struct sigaction s;
s.sa_handler=sig;
s.sa_flags=0;
sigfillset(&s.sa_mask);
sigaction(1,&s,0);
raise(1);
return 0;
}
--- signal.c.1 Mon Apr 13 22:38:08 1998
+++ signal.c Mon Apr 13 22:51:54 1998
@@ -338,7 +338,8 @@
}
sigaddset(&t->signal, sig);
- if (!sigismember(&t->blocked, sig))
+ /* KILL and STOP signals can't be blocked */
+ if (!sigismember(&t->blocked, sig) || sig==SIGKILL || sig==SIGSTOP)
t->sigpending = 1;
out:
@@ -788,6 +789,8 @@
if (act) {
*k = *act;
+ sigdelsetmask(&k->sa.sa_mask, (sigmask(SIGKILL)|
+ sigmask(SIGSTOP)));
/*
* POSIX 3.3.1.3:
Alexander.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu