X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fc-stack.c;h=1dddeefc412d1242c03839bebb583b1fbfc6dcf3;hb=26c5fd742f9136e2ddbd4695a9172c3fa30ea260;hp=e5e3ab610dc5c45b0adfa9ec0ccd44bb4e494149;hpb=ae5dae6fd1caa993e969b869e42820a119385cbc;p=gnulib.git diff --git a/lib/c-stack.c b/lib/c-stack.c index e5e3ab610..1dddeefc4 100644 --- a/lib/c-stack.c +++ b/lib/c-stack.c @@ -46,9 +46,6 @@ #define _(msgid) gettext (msgid) #include -#ifndef ENOTSUP -# define ENOTSUP EINVAL -#endif #include #if ! HAVE_STACK_T && ! defined stack_t @@ -239,21 +236,21 @@ segv_handler (int signo, siginfo_t *info, void *context __attribute__ ((unused))) { /* Clear SIGNO if it seems to have been a stack overflow. */ - if (0 < info->si_code) - { # if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC - /* We can't easily determine whether it is a stack overflow; so - assume that the rest of our program is perfect (!) and that - this segmentation violation is a stack overflow. - - Note that although both Linux and Solaris provide - sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only - Solaris satisfies the XSI heueristic. This is because - Solaris populates uc_stack with the details of the - interrupted stack, while Linux populates it with the details - of the current stack. */ - signo = 0; + /* We can't easily determine whether it is a stack overflow; so + assume that the rest of our program is perfect (!) and that + this segmentation violation is a stack overflow. + + Note that although both Linux and Solaris provide + sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only + Solaris satisfies the XSI heueristic. This is because + Solaris populates uc_stack with the details of the + interrupted stack, while Linux populates it with the details + of the current stack. */ + signo = 0; # else + if (0 < info->si_code) + { /* If the faulting address is within the stack, or within one page of the stack end, assume that it is a stack overflow. */ @@ -278,8 +275,8 @@ segv_handler (int signo, siginfo_t *info, write (STDERR_FILENO, buf, strlen (buf)); } # endif -# endif } +# endif die (signo); }