---
name: "TIOCSLCKTRMIOS"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/TIOCSLCKTRMIOS"
---

# TIOCSLCKTRMIOS(2const)

locking the termios structre

## NAME

TIOCGLCKTRMIOS, TIOCSLCKTRMIOS - locking the termios structre

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <asm/termbits.h>  /* Definition of TIOC*CLKTRMIOS constants */
#include <sys/ioctl.h>
```

**int ioctl(int** *fd***, TIOCGLCKTRMIOS, struct termios \****argp***);** **int ioctl(int** *fd***, TIOCSLCKTRMIOS, const struct termios \****argp***);**

**#include \<asm/termbits.h\>**

**struct termios;**

## DESCRIPTION

The *termios* structure of a terminal can be locked. The lock is itself a *termios* structure, with nonzero bits or fields indicating a locked value.

- **TIOCGLCKTRMIOS**

  Gets the locking status of the *termios* structure of the terminal.

- **TIOCSLCKTRMIOS**

  Sets the locking status of the *termios* structure of the terminal. Only a process with the **CAP\_SYS\_ADMIN** capability can do this.

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EPERM**

  Insufficient permission.

## CAVEATS

Please note that **struct termios** from *\<asm/termbits.h\>* is different and incompatible with **struct termios** from *\<termios.h\>*. These ioctl calls require **struct termios** from *\<asm/termbits.h\>*.

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md), [**ioctl\_tty**(2)](/ioctl_tty/2.md), [**TCSETS**(2const)](/TCSETS/2const.md)
