---
name: "rtapi_app_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_app_exit"
---

# rtapi\_app\_exit(3rtapi)

User-provided function to shut down a component

## NAME

rtapi\_app\_exit - User-provided function to shut down a component

## SYNTAX

```
#include <rtapi_app.h>
void rtapi_app_exit(void) {...}
```

## ARGUMENTS

None

## DESCRIPTION

The body of **rtapi\_app\_exit**, which is provided by the component author, generally consists of a call to rtapi\_exit or hal\_exit, preceded by other component-specific shutdown code.

This code is called when unloading a component which successfully initialized (i.e., returned zero from its **rtapi\_app\_main**).  It is not called when the component did not successfully initialize.

## RETURN CODE

None.

## REALTIME CONSIDERATIONS

Called automatically by the rtapi infrastructure in an initialization (not realtime) context.

## SEE ALSO

**[rtapi\_app\_main(3rtapi)](/rtapi_app_main/3rtapi.md)**, **[rtapi\_exit(3rtapi)](/rtapi_exit/3rtapi.md)**, **[hal\_exit(3hal)](/hal_exit/3hal.md)**
