# _CP_interrupt

_CP_interrupt is a global C integer
which contains the last D3 interrupt that occurred. This value is
the same as that returned by the BASIC function system(37). It is available when linking with the D3 libraries.

## Syntax

```
int _CP_interrupt;
```
Note: _CP_interrupt does not record non-D3
interrupts.

## Example(s)

```
/* Stops looping when some sort of interrupt occurs (like a break or a message). */

_CP_unix_env();
while (!_CP_interrupt) sleep(1); /* wait for something */
printf("I woke up!!!!\n");
```

## See also

- [C functions overview](https://d3codex.com/cfunctions/c-functions-overview/)

---
Source: https://d3codex.com/cfunctions/cp-interrupt/ - part of the D3Codex reference.
