[MLIR][TOSA] Update CustomOp input and output names (#118408)
[llvm-project.git] / libc / src / termios / linux / kernel_termios.h
blob5a3a9722789ebb544353945bff9585ec937a2a0c
1 //===-- Definition of kernel's version of struct termios --------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIBC_SRC_TERMIOS_LINUX_KERNEL_TERMIOS_H
10 #define LLVM_LIBC_SRC_TERMIOS_LINUX_KERNEL_TERMIOS_H
12 #include "src/__support/macros/config.h"
13 #include <stddef.h>
14 #include <termios.h>
16 namespace LIBC_NAMESPACE_DECL {
18 // The kernel's struct termios is different from the libc's struct termios. The
19 // kernel's syscalls expect the size and layout of its definition of struct
20 // termios. So, we define a flavor of struct termios which matches that of the
21 // kernel so that we can translate between the libc version and the kernel
22 // version when passing struct termios objects to syscalls.
24 // NOTE: The definitions here are generic definitions valid for most target
25 // architectures including x86_64 and aarch64. Definitions on some architectures
26 // deviate from these generic definitions. Adjustments have to be made for those
27 // architectures.
29 constexpr size_t KERNEL_NCCS = 19;
31 struct kernel_termios {
32 tcflag_t c_iflag;
33 tcflag_t c_oflag;
34 tcflag_t c_cflag;
35 tcflag_t c_lflag;
36 cc_t c_line;
37 cc_t c_cc[KERNEL_NCCS];
40 } // namespace LIBC_NAMESPACE_DECL
42 #endif // LLVM_LIBC_SRC_TERMIOS_LINUX_KERNEL_TERMIOS_H