[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sigaction, SA_SIGINFO, and SIG_IGN
From: |
Bruno Haible |
Subject: |
Re: sigaction, SA_SIGINFO, and SIG_IGN |
Date: |
Sun, 22 Jun 2008 21:53:54 +0200 |
User-agent: |
KMail/1.5.4 |
In a comment you say that the mingw replacement for sigaction does not
implement SA_RESTART. We can do better, since the msvcrt library never sets
errno = EINTR anyway: Define SA_RESTART and ignore it.
2008-06-22 Bruno Haible <address@hidden>
* lib/signal.in.h (SA_RESTART): New macro.
* lib/sigaction.c: Update comment.
*** lib/signal.in.h.orig 2008-06-22 21:50:37.000000000 +0200
--- lib/signal.in.h 2008-06-22 21:50:26.000000000 +0200
***************
*** 142,147 ****
--- 142,148 ----
/* Unsupported flags are not present. */
# define SA_RESETHAND 1
# define SA_NODEFER 2
+ # define SA_RESTART 4
extern int sigaction (int, const struct sigaction *restrict,
struct sigaction *restrict);
*** lib/sigaction.c.orig 2008-06-22 21:50:37.000000000 +0200
--- lib/sigaction.c 2008-06-22 21:50:26.000000000 +0200
***************
*** 35,45 ****
the situation by reading static storage in a signal handler, which
POSIX warns is not generically async-signal-safe. Oh well.
! Additionally, SIGCHLD is not defined, so we don't implement
! SA_NOCLDSTOP or SA_NOCLDWAIT; sigaltstack() is not present, so we
! don't implement SA_ONSTACK; and siginterrupt() is not present, so
! we don't implement SA_RESTART. Supporting SA_SIGINFO is impossible
! to do portably.
POSIX states that an application should not mix signal() and
sigaction(). We support the use of signal() within the gnulib
--- 35,49 ----
the situation by reading static storage in a signal handler, which
POSIX warns is not generically async-signal-safe. Oh well.
! Additionally:
! - We don't implement SA_NOCLDSTOP or SA_NOCLDWAIT, because SIGCHLD
! is not defined.
! - We don't implement SA_ONSTACK, because sigaltstack() is not present.
! - We ignore SA_RESTART, because blocking Win32 calls are not interrupted
! anyway when an asynchronous signal occurs, and the MSVCRT runtime
! never sets errno to EINTR.
! - We don't implement SA_SIGINFO because it is impossible to do so
! portably.
POSIX states that an application should not mix signal() and
sigaction(). We support the use of signal() within the gnulib
- Re: sigaction, SA_SIGINFO, and SIG_IGN, (continued)
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/19
- Re: Interix, Bruno Haible, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Paul Eggert, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/19
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Paul Eggert, 2008/06/20
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/20
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/20
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/21
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/22
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/22
- Re: sigaction, SA_SIGINFO, and SIG_IGN,
Bruno Haible <=
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/22
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/23
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/22
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/22
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/23
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Eric Blake, 2008/06/23
- Re: sigaction, SA_SIGINFO, and SIG_IGN, Bruno Haible, 2008/06/23
POSIX in docs [was: RFC: sigaction module], Eric Blake, 2008/06/17