reset_buffer_flags(9)
π NAME π
reset_buffer_flags β bestie, it resets the buffer state β¨
so this is a Kernel API Manual moment and honestly? it's giving "small function, big responsibilities" π
π SYNOPSIS π
void reset_buffer_flags (struct n_tty_data *ldata );
no cap, that's the whole signature. short and iconic π
πΈ ARGUMENTS πΈ
ldataβ the line disc data we're resetting, aka the thing we're about to hit with the refresh button π«Ά
π¦ DESCRIPTION π¦
okay so picture this: you're resetting the read buffer counters and clearing the flags. that's it. that's the whole job. and it slays at it πβ¨
it gets called from n_tty_open and n_tty_flush_buffer β so basically whenever someone opens up or flushes the buffer, this little icon shows up to tidy everything π
Locking β read this part, fr fr, it's the vibe check of the whole function π
- caller holds exclusive
termios_rwsem, or - (locking is not required)
so like... either you're holding the exclusive termios_rwsem, or honestly? locking is not required. both are valid, we love a flexible queen π
β SEE ALSO β
Kernel file ./drivers/tty/n_tty.c β and literally the whole n_tty extended universe, iykyk:
n_tty_kick_worker(9)n_tty_write_wakeup(9)put_tty_queue(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_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)
like, the whole friend group showed up ππ
bestie moment: if you ever forget what this does, just remember β counters reset, flags cleared, termios_rwsem either held exclusive or literally not needed. that's the tea π
and that's the page!! sourced from ./drivers/tty, dated October 2026, and yes it's still reset_buffer_flags(9) β she's consistent, she's iconic, she's that girl π
π bye bestie π«Άπ
π¦ 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