---
name: "hal_set_lock"
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_set_lock"
---

# hal\_set\_lock(3hal)

Set or get the HAL lock level

## NAME

hal\_set\_lock, hal\_get\_lock - Set or get the HAL lock level

## SYNTAX

int hal\_set\_lock(unsigned char *lock\_type*)

int hal\_get\_lock()

## ARGUMENTS

- *lock\_type*

  The desired lock type, which may be a bitwise combination of: **HAL\_LOCK\_LOAD**, **HAL\_LOCK\_CONFIG**, **HAL\_LOCK\_PARAMS**, or **HAL\_LOCK\_PARAMS**.  **HAL\_LOCK\_NONE** or 0 locks nothing, and **HAL\_LOCK\_ALL locks everything.**

## DESCRIPTION

## RETURN VALUE

**hal\_set\_lock** Returns a HAL status code.  **hal\_get\_lock** returns the current HAL lock level or a HAL status code.
