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

# TIOCGEXCL(2const)

exclusive mode

Part of [TIOCEXCL(2const)](/TIOCEXCL/2const.md).

## NAME

TIOCEXCL, TIOCGEXCL, TIOCNXCL - exclusive mode

## LIBRARY

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

## SYNOPSIS

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

**int ioctl(int** *fd***, TIOCEXCL);** **int ioctl(int** *fd***, TIOCGEXCL, int \****argp***);** **int ioctl(int** *fd***, TIOCNXCL);**

## DESCRIPTION

- **TIOCEXCL**

  Put the terminal into exclusive mode. No further [**open**(2)](/open/2.md) operations on the terminal are permitted. (They fail with **EBUSY**, except for a process with the **CAP\_SYS\_ADMIN** capability.)

- **TIOCGEXCL**

  If the terminal is currently in exclusive mode, place a nonzero value in the location pointed to by *argp*; otherwise, place zero in *\*argp*.

- **TIOCNXCL**

  Disable exclusive mode.

## RETURN VALUE

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

## HISTORY

- **TIOCGEXCL**

  Linux 3.8.

## SEE ALSO

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