Debian Codegraph @

upstream/debian-unstable/man2/TIOCEXCL.2const

raw
1 .\" Copyright 2002, Walter Harms <[email protected]>
2 .\" Copyright 2002, Andries E. Brouwer <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\"
7 .TH TIOCEXCL 2const 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 TIOCEXCL,
10 TIOCGEXCL,
11 TIOCNXCL
12 \-
13 exclusive mode
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ,\~ \-lc )
17 .SH SYNOPSIS
18 .nf
19 .BR "#include <asm/termbits.h>" " /* Definition of " TIOC*XCL " constants */"
20 .B #include <sys/ioctl.h>
21 .P
22 .BI "int ioctl(int " fd ", TIOCEXCL);"
23 .BI "int ioctl(int " fd ", TIOCGEXCL, int *" argp );
24 .BI "int ioctl(int " fd ", TIOCNXCL);"
25 .fi
26 .SH DESCRIPTION
27 .TP
28 .B TIOCEXCL
29 Put the terminal into exclusive mode.
30 No further
31 .BR open (2)
32 operations on the terminal are permitted.
33 (They fail with
34 .BR EBUSY ,
35 except for a process with the
36 .B CAP_SYS_ADMIN
37 capability.)
38 .TP
39 .B TIOCGEXCL
40 If the terminal is currently in exclusive mode,
41 place a nonzero value in the location pointed to by
42 .IR argp ;
43 otherwise, place zero in
44 .IR *argp .
45 .TP
46 .B TIOCNXCL
47 Disable exclusive mode.
48 .SH RETURN VALUE
49 On success,
50 0 is returned.
51 On error,
52 \-1 is returned, and
53 .I errno
54 is set to indicate the error.
55 .SH HISTORY
56 .TP
57 .B TIOCGEXCL
58 Linux 3.8.
59 .SH SEE ALSO
60 .BR ioctl (2),
61 .BR ioctl_tty (2)