Thoughts on SA_RESTART?
-
-
Replying to @bofh453
There's fundamentally no valid way to use EINTR short of hammering signals with exponential backoff (inherent race condition otherwise)...
1 reply 0 retweets 0 likes -
Replying to @RichFelker @bofh453
So my view is that installing signal handlers without SA_RESTART is almost always a bug.
1 reply 0 retweets 2 likes -
Replying to @RichFelker @bofh453
I generally don't write or recommend EINTR retry loops, because the only conceivable reason to install a signal handler without SA_RESTART..
2 replies 0 retweets 0 likes -
Replying to @RichFelker @bofh453
... is select/poll loops where you have to recompute the timeout after an interrupt, when the kernel doesn't do it for you.
1 reply 0 retweets 0 likes -
Replying to @laurentbercot @bofh453
Nope. select and poll always return on signals.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @bofh453
http://pubs.opengroup.org/onlinepubs/9699919799/functions/select.html … says the behaviour is implementation-defined. http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html … says nothing at all. There's no guarantee.
1 reply 0 retweets 0 likes -
Replying to @laurentbercot @bofh453
Sorry, select is that way because it sucks but poll isn't. poll explicitly "shall fail" if "A signal was caught during poll()."
1 reply 0 retweets 0 likes -
Note the shall-fail text is different from other functions where it only applies if the signal was interrupting.
1 reply 0 retweets 0 likes -
Replying to @RichFelker @bofh453
That's a little more reading between the spec's lines than I like, but ok, point taken. Still, for select, you need a loop on EINTR.
1 reply 0 retweets 0 likes
Welcome to reading standards. Stuff gets written this way to hide subtle requirements from committee members who would object/bikeshed it.
-
-
so that's actually true, I read a few RFC back in the day and suspected some kind of subtle struggle going on.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.