nx_termios.nx
buildroot/runtime/nx_termios.nx
about
nx_termios.nx -- raw / cooked terminal mode via ioctl(TCGETS/TCSETS).
Switches the controlling TTY between cooked (line-buffered, echo on)
and raw (byte-by-byte, no echo, no signals) modes. Required for
interactive TUI applications.
Pairs with nx_tty.nx (output) and nx_input.nx (input).
Per POSIX termios. Raw mode disables:
- ICANON (canonical line buffering)
- ECHO (echo input to terminal)
- ISIG (Ctrl+C/Z signal generation)
- IEXTEN (extended input processing)
- IXON (XON/XOFF flow control)
- ICRNL (CR -> NL input translation)
- OPOST (output post-processing)
...and sets c_cc[VMIN]=1, c_cc[VTIME]=0 (return on each byte).
genealogy_id: posix_termios_1003.1 + bsd_v6_tty_driver
+ stevens_advanced_programming_1992
lineage_id: tty_mode_toggle_via_ioctl
axioms: NX_AX_LOGIC_EXCLUDED_MIDDLE (TTY is in raw OR cooked
mode at any instant; no third state)
dependencies 3 imports · 0 importers
imports: syscalls.nxruntime.nxnx_axioms.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 37 | const NX_TIOC_GETS: i64 = 0x5401 // TCGETS |
| 38 | const NX_TIOC_SETS: i64 = 0x5402 // TCSETS |
| 39 | const NX_TIOC_GWINSZ: i64 = 0x5413 // TIOCGWINSZ |
| 46 | const NX_T_BRKINT: i64 = 0x0002 |
| 47 | const NX_T_ICRNL: i64 = 0x0100 |
| 48 | const NX_T_INPCK: i64 = 0x0010 |
| 49 | const NX_T_ISTRIP: i64 = 0x0020 |
| 50 | const NX_T_IXON: i64 = 0x0400 |
| 53 | const NX_T_OPOST: i64 = 0x0001 |
| 56 | const NX_T_CS8: i64 = 0x0030 |
| 59 | const NX_T_ICANON: i64 = 0x0002 |
| 60 | const NX_T_ECHO: i64 = 0x0008 |
| 61 | const NX_T_ISIG: i64 = 0x0001 |
| 62 | const NX_T_IEXTEN: i64 = 0x8000 |
| 65 | const NX_T_VMIN: i64 = 6 |
| 66 | const NX_T_VTIME: i64 = 5 |
| 74 | const NX_TERMIOS_BYTES: i64 = 60 |
functions
| 77 | func nx_termios_get32(buf: *u8, off: i64) -> i64 called by 1: nx_termios_enter_raw |
| 86 | func nx_termios_set32(buf: *u8, off: i64, v: i64) -> i64 called by 1: nx_termios_enter_raw |
| 96 | func nx_termios_get(buf: *u8) -> i64 |
| 100 | func nx_termios_set(buf: *u8) -> i64 |
| 110 | func nx_termios_enter_raw(save_buf: *u8) -> i64 |
| 143 | func nx_termios_restore(save_buf: *u8) -> i64 calls 1: nx_termios_set |
| 153 | func nx_termios_winsize(out_rows: *i64, out_cols: *i64) -> i64 calls 1: sys_ioctl |