POSIX Termios Structure (POSIX/termios.h)

serenity · Kernel/API/POSIX/termios.h · c · BSD-2-Clause
infra, cli, integration, tag:termios, tag:posix

Defines terminal I/O flags, control characters, and baud rates for POSIX termios API. Use for terminal configuration and control.

// Source: https://github.com/SerenityOS/serenity | License: BSD-2-Clause | Copyright 2018-2026, the SerenityOS developers
// Provided via justclaw.it.com; keep this notice with the code.
/*
 * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <Kernel/API/POSIX/sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

#define NCCS 32

typedef uint32_t tcflag_t;
typedef uint8_t cc_t;
typedef uint32_t speed_t;

struct termios {
    tcflag_t c_iflag;
    tcflag_t c_oflag;
    tcflag_t c_cflag;
    tcflag_t c_lflag;
    cc_t c_cc[NCCS];
    speed_t c_ispeed;
    speed_t c_ospeed;
};

/* c_cc characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VTIME 5
#define VMIN 6


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key