提交 76fd0117 编写于 作者: R Rich Felker

block all signals (even internal ones) in cancellation signal handler

previously the implementation-internal signal used for multithreaded
set*id operations was left unblocked during handling of the
cancellation signal. however, on some archs, signal contexts are huge
(up to 5k) and the possibility of nested signal handlers drastically
increases the minimum stack requirement. since the cancellation signal
handler will do its job and return in bounded time before possibly
passing execution to application code, there is no need to allow other
signals to interrupt it.
上级 eceaf1d2
#include <string.h>
#include "pthread_impl.h"
#include "syscall.h"
#include "libc.h"
......@@ -80,7 +81,7 @@ static void init_cancellation()
.sa_flags = SA_SIGINFO | SA_RESTART,
.sa_sigaction = cancel_handler
};
sigfillset(&sa.sa_mask);
memset(&sa.sa_mask, -1, _NSIG/8);
__libc_sigaction(SIGCANCEL, &sa, 0);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册