Re:POSIX close(2) is broken
by FooBarWidget on Saturday December 17, 2011 @11:46AM
(#3364525)
No reasons huh? I use signals to interrupt threads that block on open() and waitpid(). The only other alternative is sleep-polling which really sucks.
[ Parent
| on HN ]
I said don't catch signals, not don't use them. See signalfd() et. al.
Though I'm curious why you're wanting to trying to interrupt those syscalls. In particular, why are you waiting on a process that you don't know is already dead? That's what SIGCHLD is for. And the only case I can think of for a blocking open() is a network/fuse mounted file. In which case the filesystem will surely eventually return an error (and if it doesn't no amount of voodoo in your application logic is going to correct the bugs in the underlying system).