mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 10:18:31 +00:00
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:
parent
8bdaddd81d
commit
99dc1281f5
38 changed files with 635 additions and 279 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue