put_tty_queue(9)
π put_tty_queue(9) β the Kernel API Manual tea π
okay so real talk, bestie, we're in the put_tty_queue(9) girlies today β this one lives in the Kernel API Manual and it's lowkey iconic? like, tiny function, huge main character energy β¨
πΈ NAME πΈ
put_tty_queue β bestie, it literally just adds a character to tty π
that's it, that's the whole vibe.
π¦ SYNOPSIS π¦
void put_tty_queue (u8 c , struct n_tty_data *ldata );
like yes, returns nothing (void, she gives nothing and takes nothing back, queen), and takes exactly two things. no more, no less, periodt.
π ARGUMENTS π
cβ the character π just. a character. one (1) little guy.u8. bless.ldataβ the n_tty data π«Ά this is the vibe container, the data struct where all the n_tty stuff hangs out.
β DESCRIPTION β
so what she does is: add a character to the tty read_buf queue. that's the whole job. she puts it in the buffer, she goes home. ngl that's a slay π
Locking: π okay listen up because this part matters, do not skip it:
n_tty_receive_buf/ producer path β in this path, the caller holds the non-exclusivetermios_rwsem. not exclusive. non-exclusive. we're sharing, we're being polite, it's giving healthy boundaries π§
π SEE ALSO π
okay this list is LONG and honestly it's a whole friend group π«Ά if you liked put_tty_queue(9), the kernel file ./drivers/tty/n_tty.c has so many more besties for you to meet:
n_tty_kick_worker(9)n_tty_write_wakeup(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_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. thirty-five entries. she said "i'm not coming to the function alone" ππ₯ genuinely obsessed with the commitment.
π friendly reminder that the non-exclusive termios_rwsem thing is a real locking requirement, not a cute suggestion. hold it on the producer path like you mean it, bestie. no cap.
and that's the page, babes π sign-off time: this lil masterpiece comes from the source path ./drivers/tty, stamped October 2026, and it's filed under put_tty_queue(9) forever and ever π mwah, see you in the buffer π¦β¨π
π¦ 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