Blame lib/c-stack.h

Packit Service fdd496
/* Stack overflow handling.
Packit Service fdd496
Packit Service fdd496
   Copyright (C) 2002, 2004, 2008-2017 Free Software Foundation, Inc.
Packit Service fdd496
Packit Service fdd496
   This program is free software: you can redistribute it and/or modify
Packit Service fdd496
   it under the terms of the GNU General Public License as published by
Packit Service fdd496
   the Free Software Foundation; either version 3 of the License, or
Packit Service fdd496
   (at your option) any later version.
Packit Service fdd496
Packit Service fdd496
   This program is distributed in the hope that it will be useful,
Packit Service fdd496
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
   GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
   You should have received a copy of the GNU General Public License
Packit Service fdd496
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service fdd496
Packit Service fdd496
Packit Service fdd496
/* Set up ACTION so that it is invoked on C stack overflow and on other,
Packit Service fdd496
   stack-unrelated, segmentation violation.
Packit Service fdd496
   Return -1 (setting errno) if this cannot be done.
Packit Service fdd496
Packit Service fdd496
   When a stack overflow or segmentation violation occurs:
Packit Service fdd496
   1) ACTION is called.  It is passed an argument equal to
Packit Service fdd496
        - 0, for a stack overflow,
Packit Service fdd496
        - SIGSEGV, for a segmentation violation that does not appear related
Packit Service fdd496
          to stack overflow.
Packit Service fdd496
      On many platforms the two cases are hard to distinguish; when in doubt,
Packit Service fdd496
      zero is passed.
Packit Service fdd496
   2) If ACTION returns, a message is written to standard error, and the
Packit Service fdd496
      program is terminated: in the case of stack overflow, with exit code
Packit Service fdd496
      exit_failure (see "exitfail.h"), otherwise through a signal SIGSEGV.
Packit Service fdd496
Packit Service fdd496
   A null ACTION acts like an action that does nothing.
Packit Service fdd496
Packit Service fdd496
   ACTION must be async-signal-safe.  ACTION together with its callees
Packit Service fdd496
   must not require more than SIGSTKSZ bytes of stack space.  Also,
Packit Service fdd496
   ACTION should not call longjmp, because this implementation does
Packit Service fdd496
   not guarantee that it is safe to return to the original stack.
Packit Service fdd496
Packit Service fdd496
   This function may install a handler for the SIGSEGV signal or for the SIGBUS
Packit Service fdd496
   signal or exercise other system dependent exception handling APIs.  */
Packit Service fdd496
Packit Service fdd496
extern int c_stack_action (void (* /*action*/) (int));