From owner-freebsd-current Wed Aug 13 09:52:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA12319 for current-outgoing; Wed, 13 Aug 1997 09:52:41 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id JAA12314 for ; Wed, 13 Aug 1997 09:52:37 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id JAA12611; Wed, 13 Aug 1997 09:47:24 -0700 From: Terry Lambert Message-Id: <199708131647.JAA12611@phaeton.artisoft.com> Subject: Re: siginterrupt (was Re: Error in sleep !) To: ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=) Date: Wed, 13 Aug 1997 09:47:24 -0700 (MST) Cc: bde@zeta.org.au, current@FreeBSD.ORG, sos@sos.freebsd.dk, terry@lambert.org In-Reply-To: from "=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=" at Aug 13, 97 08:25:08 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > The caller of sigaction() decides the initial value. In portable > > POSIX programs, the value must be either 0 or SA_NOCLDSTOP, since > > SA_NOCLDSTOP is the only POSIX flag. For signal(), the value is > > implementation-defined. (I said that signal() is non-POSIX. Actually, > > it is inherited from ANSI C, and thus gives fuzzy ANSI signal semantics.) > > I mean not application which uses some signal interface but initial > handling of SIG_DFL _before_ any sigaction() or signal() used. I.e. is it > safe per POSIX to have SA_RESTART for SIG_DFL action initially at > application startup (before any application actions)? POSIX recognizes only the flag SA_NOCLDSTOP, as Bruce notes above. Look at /usr/include/sys/signal.h: [ ... ] #ifndef _POSIX_SOURCE #define SA_ONSTACK 0x0001 /* take signal on signal stack */ #define SA_RESTART 0x0002 /* restart system call on signal return */ #define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ #define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ #ifdef COMPAT_SUNOS #define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */ #endif #endif /* _POSIX_SOURCE */ #define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ [ ... ] For a POSIX compatible compiled libc, it's *IMPOSSIBLE* to have an *undefined* flag set by default. That should put this thing to rest, once and for all... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.