---
name: "rtapi_exit"
section: "3rtapi"
platform: "linux"
package: "linuxcnc-uspace-dev"
version: "1:2.9.4-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rtapi_exit"
---

# rtapi\_exit(3rtapi)

Shut down RTAPI

## NAME

rtapi\_exit - Shut down RTAPI

## SYNTAX

 int rtapi\_exit(int *module\_id*)

## ARGUMENTS

- *module\_id*

  An rtapi module identifier returned by an earlier call to **rtapi\_init**.

## DESCRIPTION

**rtapi\_exit** shuts down and cleans up the RTAPI.  It must be called prior to exit by any module that called **rtapi\_init**.

## REALTIME CONSIDERATIONS

Call only from within non-realtime or realtime init/cleanup code, not from realtime tasks.

## RETURN VALUE

Returns a RTAPI status code.
