[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test for SA_RESTART?
From: |
Harlan Stenn |
Subject: |
Re: Test for SA_RESTART? |
Date: |
Tue, 17 Dec 2002 00:59:21 -0500 |
User-agent: |
EMH/1.10.0 SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) |
> Does anyone know of any reasonable way to test whether the SA_RESTART
> flag actually works (as opposed to simply being present in one of the
> standard header files)?
The following is what I wrote for metaconfig a While ago.
It's not all that you need, but it should be a start.
H
--
?S:d_keepsig:
?S: This variable contains the eventual value of the SIGNALS_KEPT symbol,
?S: which indicates to the C program if signal handlers need not reinstated
?S: after receipt of a signal.
?S:.
?C:SIGNALS_KEPT (PERSISTENT_SIGNAL):
?C: This symbol is defined if signal handlers needn't be reinstated after
?C: receipt of a signal.
?C:.
?H:#$d_keepsig SIGNALS_KEPT /**/
?H:.
?LINT:set d_keepsig
: see if signals are kept
val="$undef";
echo " "
echo "Checking to see if signal handlers stick around..." >&4
$cat >try.c <<'EOCP'
foo() {}
main()
{
signal(2, foo);
kill(getpid(), 2);
kill(getpid(), 2);
printf("abc\n");
}
EOCP
if $cc -o try $ccflags try.c >/dev/null 2>&1; then
?X: On AIX a single ./try will not work (with ksh)
sh -c ./try > try.out 2>/dev/null
if $contains abc try.out >/dev/null 2>&1; then
echo "Yes, they do."
val="$define";
else
echo "No, they don't."
fi
else
$echo $n "(I can't seem to compile the test program. Assuming $c"
if bsd; then
echo "they do.)"
val="$define"
else
echo "they don't.)"
fi
fi
set d_keepsig
eval $setvar
$rm -f try*