TIOCEXCL(2const)

TIOCEXCL2const

Exclusive mode

Usage

#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);

Library

Standard C library (libc, -lc)

Overview

TIOCEXCL

Put the terminal into exclusive mode. No further open(2) 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.

Releases

2 releases since Debian 13 (Trixie); the text changed 1 time.

  1. 13
  2. Arch

History

TIOCGEXCL

Linux 3.8.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.