Thanks for doing that. A few minor comments: Eric Blake <[EMAIL PROTECTED]> writes:
> +/* We assume that a platform without POSIX sigaction implements SysV > + semantics in signal() (ie. the handler is uninstalled before it is > + invoked). This is an inherent data race, but there's nothing we > + can do about it. We assume that SIGCHLD is not defined, so we > + don't implement SA_NOCLDSTOP or SA_NOCLDWAIT. We assume that > + sigaltstack() is not present, so we don't implement SA_ONSTACK. We > + assume siginterrupt() is not present, so we don't implement > + SA_RESTART. Supporting SA_SIGINFO is impossible to do portably. > + These points are true for Woe32 platforms. Some of these assumptions can be checked at compile-time. Perhaps they should be, if it's cheap? E.g.: #ifdef SIGCHLD #error "We assume SIGCHLD is not defined." #endif > + /* This opens a slight window where an async signal can call > + wrong handler. Oh well. */ > + oact->sa_handler = signal (sig, SIG_DFL); Isn't it easy to close this window when oact and act are both nonnull? In that case, you can invoke 'signal' once, without opening this particular race condition. More generally, can't you use sigprocmask to avoid this class of race conditions within sigaction? (I don't know the platform.)
