* lib/c-stack.c (SIGACTION_WORKS): Rename...
(SIGINFO_WORKS): ...since gnulib module guarantees that (most) of
sigaction will work.
(die): Assume stack overflow if siginfo doesn't work, to let Haiku
behavior match Linux.
* tests/test-c-stack.c (main): Prefer NULL for pointers.
Signed-off-by: Eric Blake <eblake@redhat.com>
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Make
recursion harder to optimize, to ensure a stack overflow occurs.
* tests/test-c-stack.c (recurse): Likewise.
Borrowed from libsigsegv.
Signed-off-by: Eric Blake <ebb9@byu.net>
* tests/test-c-stack.c [HAVE_SETRLIMIT]: Include prerequisite
headers before <sys/resource.h>.
* doc/posix-headers/sys_resource.texi (sys/resource.h): Document
the bug.
Reported by Nelson H. F. Beebe.
Signed-off-by: Eric Blake <ebb9@byu.net>
* modules/c-stack-tests: New file.
* lib/c-stack.c [DEBUG]: Move test program...
* tests/test-c-stack.c: ...into this new file. Skip rather than
fail test if sigaltstack is lacking.
* tests/test-c-stack.sh: New driver file.
Signed-off-by: Eric Blake <ebb9@byu.net>