put_tty_queue(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ 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-exclusive termios_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:

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