# PetscPushSignalHandler
Catches the usual fatal errors and calls a user-provided routine. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscPushSignalHandler(PetscErrorCode (*routine)(int, void *), void *ctx)
```
Not Collective


## Input Parameters

- ***routine -*** routine to call when a signal is received
- ***ctx -*** optional context needed by the routine





## See Also
 `PetscPopSignalHandler()`, `PetscSignalHandlerDefault()`, `PetscPushErrorHandler()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/error/signal.c.html#PetscPushSignalHandler">src/sys/error/signal.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex30.c.html">src/snes/tutorials/ex30.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/signal.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
