n_tty_set_termios(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… n_tty_set_termios(9) β€” like, the kernel API manual bestie πŸŽ€

okay so welcome to the glow-up era of n_tty_set_termios, a function that lives in the <rainbow>Kernel API Manual</rainbow> (section 9, iykyk) and honestly? she's lowkey the moment.


✨ NAME ✨

n_tty_set_termios β€” termios data changed</p> πŸ’« (yes that's the whole vibe: something in termios shifted and we're all reacting to it)


πŸ¦‹ SYNOPSIS πŸ¦‹

void n_tty_set_termios (struct tty_struct *tty , const struct ktermios
*old );

that's the whole signature, no cap. two things go in, nothing comes back (void, she gives nothing and that's the point πŸ‘‘).


🌸 ARGUMENTS 🌸

  • tty β€” the terminal, bestie. the actual struct tty_struct we're doing all this for πŸ–₯️
  • old β€” the previous data. like the termios from before, so we can be nosy about what changed πŸ’…

🧚 DESCRIPTION 🧚

so here's the tea πŸ“: the tty layer calls this bad boy whenever the user changes the termios flags, so the line discipline can plan ahead. iconic foresight, truly main character energy.

big important facts, do NOT skip these:

  • this function cannot sleep 😴🚫 β€” literally not allowed, not even a lil nap
  • it is protected from re-entry by the tty layer πŸ”’ β€” no barging in twice
  • the user is guaranteed that this function will not be re-entered or be in progress when the ldisc is closed βœ…
Locking: the caller holds tty->termios_rwsem πŸ” β€” that's the rule, hold the sem, no drama.

πŸŽ€ SEE ALSO πŸŽ€

the whole friend group, fr fr β€” plus the kernel file ./drivers/tty/n_tty.c:

n_tty_kick_worker(9), n_tty_write_wakeup(9), put_tty_queue(9), reset_buffer_flags(9), n_tty_flush_buffer(9), is_utf8_continuation(9), is_continuation(9), do_output_char(9), process_output(9), process_output_block(9), __process_echoes(9), add_echo_byte(9), echo_move_back_col(9), echo_set_canon_col(9), echo_erase_tab(9), echo_char_raw(9), echo_char(9), finish_erasing(9), eraser(9), isig(9), n_tty_receive_break(9), n_tty_receive_overrun(9), n_tty_receive_parity_error(9), n_tty_receive_char_flow_ctrl(9), n_tty_receive_char(9), n_tty_receive_buf_common(9), n_tty_close(9), n_tty_open(9), copy_from_read_buf(9), canon_copy_from_read_buf(9), job_control(9), n_tty_read(9), n_tty_write(9), n_tty_poll(9), n_tty_inherit_ops(9)

that's every single one, I counted, slay πŸ”₯


and that's the page!! 🫢 source/version vibes: she ships from ./drivers/tty, dated October 2026, and she's filed under n_tty_set_termios(9) in the Kernel API Manual. periodt. πŸ’œ

πŸ“¦ where this page comes from