Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 1997 09:47:24 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=)
Cc:        bde@zeta.org.au, current@FreeBSD.ORG, sos@sos.freebsd.dk, terry@lambert.org
Subject:   Re: siginterrupt (was Re: Error in sleep !)
Message-ID:  <199708131647.JAA12611@phaeton.artisoft.com>
In-Reply-To: <Pine.BSF.3.96.970813202043.15685A-100000@lsd.relcom.eu.net> from "=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=" at Aug 13, 97 08:25:08 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708131647.JAA12611>