asterinas/kernel/src/fs/utils/ioctl.rs

47 lines
1.5 KiB
Rust
Raw Normal View History

2024-01-03 03:22:36 +00:00
// SPDX-License-Identifier: MPL-2.0
2022-11-15 06:08:21 +00:00
use crate::prelude::*;
2023-04-17 08:11:36 +00:00
#[repr(u32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
pub enum IoctlCmd {
2023-08-01 06:35:35 +00:00
/// Get terminal attributes
2022-11-21 11:09:23 +00:00
TCGETS = 0x5401,
TCSETS = 0x5402,
2023-08-01 06:35:35 +00:00
/// Drain the output buffer and set attributes
2023-06-14 08:40:27 +00:00
TCSETSW = 0x5403,
2023-08-01 06:35:35 +00:00
/// Drain the output buffer, and discard pending input, and set attributes
2023-06-14 08:40:27 +00:00
TCSETSF = 0x5404,
2023-08-01 06:35:35 +00:00
/// Make the given terminal the controlling terminal of the calling process.
TIOCSCTTY = 0x540e,
/// Get the process group ID of the foreground process group on this terminal
2022-11-21 11:09:23 +00:00
TIOCGPGRP = 0x540f,
2023-08-01 06:35:35 +00:00
/// Set the foreground process group ID of this terminal.
2022-11-21 11:09:23 +00:00
TIOCSPGRP = 0x5410,
2023-08-17 06:15:35 +00:00
/// Get the number of bytes in the input buffer.
FIONREAD = 0x541B,
2023-08-01 06:35:35 +00:00
/// Set window size
2022-11-21 11:09:23 +00:00
TIOCGWINSZ = 0x5413,
2023-04-17 08:11:36 +00:00
TIOCSWINSZ = 0x5414,
2024-07-15 09:28:22 +00:00
/// Enable or disable non-blocking I/O mode.
FIONBIO = 0x5421,
2023-08-01 06:35:35 +00:00
/// the calling process gives up this controlling terminal
TIOCNOTTY = 0x5422,
2025-04-19 14:59:12 +00:00
/// Return the session ID of FD
TIOCGSID = 0x5429,
2024-10-10 15:24:52 +00:00
/// Clear the close on exec flag on a file descriptor
FIONCLEX = 0x5450,
/// Set the close on exec flag on a file descriptor
FIOCLEX = 0x5451,
2024-07-15 09:28:22 +00:00
/// Enable or disable asynchronous I/O mode.
FIOASYNC = 0x5452,
2023-08-01 06:35:35 +00:00
/// Get Pty Number
TIOCGPTN = 0x80045430,
/// Lock/unlock Pty
TIOCSPTLCK = 0x40045431,
/// Safely open the slave
TIOCGPTPEER = 0x40045441,
2023-11-29 02:30:05 +00:00
/// Get tdx report using TDCALL
TDXGETREPORT = 0xc4405401,
2022-11-21 11:09:23 +00:00
}