__process_echoes(9)
π __process_echoes β write pending echo characters
okay so this is a page from the Kernel API Manual, section 9, and it's about __process_echoes. bestie, it's literally the little function that finally lets your buffered echo characters out of jail. π«Ά
β¨ SYNOPSIS β¨
size_t __process_echoes (struct tty_struct *tty );
π ARGUMENTS π
ttyβ the terminal device. that's it. that's the whole argument. iconic minimalism honestly π
πΈ DESCRIPTION πΈ
so what does it do? it writes previously buffered echo (and other ldisc-generated) characters to the tty. basically it's the moment the queue gets to breathe. π¨
here's the tea though β characters generated by the ldisc (including echoes) need to be buffered because the driver's write buffer can fill up during heavy program output. and if you try echoing straight to the driver under those conditions? it will often fail, which means lost characters and, worse, mismatches of ldisc state information. not cute. not slay. π
and since the ldisc state must represent the characters actually sent to the driver at the time of the write, operations like certain changes in column state are also saved in the buffer and executed here. so it's not just characters chilling in there β state bookkeeping lives there too. fr fr.
a circular fifo buffer is used so that the most recent characters are prioritized. π also, when control characters are echoed with a prefixed "^", the pair is treated atomically and thus not separated. the way that ^ and its buddy never get split upβ¦ we love a package deal π
Locking: callers must hold output_lock. no cap. if you don't hold it, that's on you, and it's giving undefined-vibes. π
π¦ SEE ALSO π¦
Kernel file ./drivers/tty/n_tty.c, plus the whole friend group:
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)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_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)
and that's the whole page, bestie β go forth and process those echoes π
sign-off tea β: this one lives under the ./drivers/tty source tree, dated October 2026, and it's __process_echoes(9) all the way down. mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms