mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 05:59:10 +00:00
Fix flakes in runitd and popen_test
This commit is contained in:
parent
801224df67
commit
2ebc5781a1
18 changed files with 123 additions and 34 deletions
|
@ -479,6 +479,15 @@ static int __sigaction(int sig, const struct sigaction *act,
|
|||
* frequently calling sigprocmask() out of an abundance of caution, will
|
||||
* no longer need to pay its outrageous cost.
|
||||
*
|
||||
* Signal handlers should avoid clobbering global variables like `errno`
|
||||
* because most signals are asynchronous, i.e. the signal handler might
|
||||
* be called at any assembly instruction. If something like a `SIGCHLD`
|
||||
* handler doesn't save / restore the `errno` global when calling wait,
|
||||
* then any i/o logic in the main program that checks `errno` will most
|
||||
* likely break. This is rare in practice, since systems usually design
|
||||
* signals to favor delivery from cancellation points before they block
|
||||
* however that's not guaranteed.
|
||||
*
|
||||
* @return 0 on success or -1 w/ errno
|
||||
* @see xsigaction() for a much better api
|
||||
* @asyncsignalsafe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue