[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: sigaction module

From: Eric Blake
Subject: Re: RFC: sigaction module
Date: Mon, 16 Jun 2008 18:19:26 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080421 Thunderbird/ Mnenhy/

Hash: SHA1

According to Paul Eggert on 6/16/2008 5:01 PM:
|> +          /* 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.

True enough; but generally sigaction is often used with NULL act and
non-NULL oact to query the current settings before doing anything else, so
it won't benefit existing gnulib clients.

| More generally, can't you use sigprocmask to avoid this class of race
| conditions within sigaction?  (I don't know the platform.)

mingw lacks sigprocmask.  There is a gnulib module replacement, but it too
suffers from the race condition.  In general, I know of no way to make
mingw immune to poorly timed signals.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]