Terminal and Device I/O API

POSIX terminal interface (termios) and device control system calls for managing terminals, serial ports, and device parameters.

API entry from apis.yml

apis.yml Raw ↑
name: Terminal and Device I/O API
description: POSIX terminal interface (termios) and device control system calls for managing terminals,
  serial ports, and device parameters.
image: https://kinlane-productions.s3.amazonaws.com/apis-json/apis-json-logo.jpg
humanURL: https://man7.org/linux/man-pages/man3/termios.3.html
baseURL: system://unix/terminal
tags:
- Device-Io
- Serial
- Terminal
- Termios
- Tty
properties:
- type: Documentation
  url: https://man7.org/linux/man-pages/man3/termios.3.html
- type: APIReference
  url: https://man7.org/linux/man-pages/man0/termios.h.0p.html
- type: Documentation
  url: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html
operations:
- name: tcgetattr
  description: Get terminal attributes
  parameters:
  - fd
  - termios_p
  returns: 0 on success, -1 on error
- name: tcsetattr
  description: Set terminal attributes
  parameters:
  - fd
  - optional_actions
  - termios_p
  returns: 0 on success, -1 on error
- name: tcsendbreak
  description: Send a break condition on a terminal
  parameters:
  - fd
  - duration
  returns: 0 on success, -1 on error
- name: tcdrain
  description: Wait until all output has been transmitted
  parameters:
  - fd
  returns: 0 on success, -1 on error
- name: tcflush
  description: Discard terminal data that has not been read or transmitted
  parameters:
  - fd
  - queue_selector
  returns: 0 on success, -1 on error
- name: tcflow
  description: Suspend or restart transmission or reception of data
  parameters:
  - fd
  - action
  returns: 0 on success, -1 on error
- name: cfgetispeed
  description: Get input baud rate from termios structure
  parameters:
  - termios_p
  returns: input baud rate
- name: cfgetospeed
  description: Get output baud rate from termios structure
  parameters:
  - termios_p
  returns: output baud rate
- name: cfsetispeed
  description: Set input baud rate in termios structure
  parameters:
  - termios_p
  - speed
  returns: 0 on success, -1 on error
- name: cfsetospeed
  description: Set output baud rate in termios structure
  parameters:
  - termios_p
  - speed
  returns: 0 on success, -1 on error
- name: isatty
  description: Test whether a file descriptor refers to a terminal
  parameters:
  - fd
  returns: 1 if terminal, 0 if not
- name: ttyname
  description: Get the name of the terminal associated with a file descriptor
  parameters:
  - fd
  returns: pointer to terminal name string
- name: ioctl
  description: Control device parameters and perform device-specific operations
  parameters:
  - fd
  - request
  - argp
  returns: depends on request, -1 on error