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

# hal\_exit(3hal)

Shut down HAL

## NAME

hal\_exit - Shut down HAL

## SYNTAX

int hal\_exit(int *comp\_id*)

## ARGUMENTS

- *comp\_id*

  A HAL component identifier returned by an earlier call to **hal\_init**.

## DESCRIPTION

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

## REALTIME CONSIDERATIONS

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

## RETURN VALUE

Returns a HAL status code.
