Overhaul Windows signal handling

The new asynchronous signal delivery technique is now also being used
for tkill(), raise(), etc. Many subtle issues have been addresesd. We
now signal handling on Windows that's remarkably similar to the POSIX
behaviors. However that's just across threads. We're lacking a way to
have the signal semantics work well, across multiple WIN32 processes.
This commit is contained in:
Justine Tunney 2023-09-08 01:49:41 -07:00
parent 8bdaddd81d
commit 99dc1281f5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
38 changed files with 635 additions and 279 deletions

View file

@ -89,12 +89,12 @@ static textwindows ssize_t sys_write_nt_impl(int fd, void *data, size_t size,
// return edquot(); /* handled by consts.sh */
case kNtErrorBrokenPipe: // broken pipe
case kNtErrorNoData: // closing named pipe
if (_weaken(__sig_raise)) {
_weaken(__sig_raise)(SIGPIPE, SI_KERNEL);
if (_weaken(__sig_handle)) {
_weaken(__sig_handle)(0, SIGPIPE, SI_KERNEL, 0);
return epipe();
} else {
STRACE("broken pipe");
ExitProcess(EPIPE);
ExitProcess(SIGPIPE);
}
case kNtErrorAccessDenied: // write doesn't return EACCESS
return ebadf();