n_tty_receive_char(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– n_tty_receive_char(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ this one's a lil function out of n_tty and it's honestly giving "tiny but load-bearing" 🫢


🌸 NAME 🌸

n_tty_receive_char β€” perform processing πŸ’…

like. that's the whole name-and-purpose combo. "perform processing." iconic of the kernel to be that vague ngl, but we move πŸŽ€


✨ SYNOPSIS ✨

void n_tty_receive_char (struct tty_struct *tty , u8 c );

returns nothing (void, periodt), takes exactly two things, no cap πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • tty β€” the terminal device, bestie. the whole vibe lives here πŸ–₯️✨
  • c β€” a single character. one (1) char. that's the guest of honour 🌟

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜•: this function processes an individual character of input that's been received from the driver. one char at a time, main character energy πŸ‘‘

and it's serialized with respect to itself by the rules for the driver above β€” meaning the kernel's already got the concurrency situation handled upstream, so this one doesn't have to fight itself fr fr 🧚

⚠️ Locking deets, don't skip these (iykyk): on the n_tty_receive_buf/producer path, the caller holds a non-exclusive termios_rwsem, and it publishes canon_head if canonical mode is active 🫢

like, that locking note is not decoration, it's the whole contract. respect it πŸ’€


🌈 SEE ALSO 🌈

grab a snack, this list is LONG and we're listing every single one, no skipping πŸ™ˆπŸ’–

kernel file ./drivers/tty/n_tty.c plus: 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_buf_common(9), n_tty_set_termios(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) πŸ¦‹πŸŒΈβ­


aaaand that's the page! πŸ’… sign-off time: this lil beauty comes from ./drivers/tty and it's dated October 2026 β€” go off, tty subsystem πŸ“πŸ”₯ slay, mwah πŸ’œπŸŽ€

πŸ“¦ where this page comes from