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

# TIOCSETD(2const)

get or set the line discipline of the terminal

## NAME

TIOCGETD, TIOCSETD - get or set the line discipline of the terminal

## LIBRARY

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

## SYNOPSIS

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

**int ioctl(int** *fd***, TIOCGETD, int \****argp***);** **int ioctl(int** *fd***, TIOCSETD, const int \****argp***);**

## DESCRIPTION

- **TIOCGETD**

  Get the line discipline of the terminal.

- **TIOCSETD**

  Set the line discipline of the terminal.

## RETURN VALUE

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

## SEE ALSO

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