pty_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

hiii bestie πŸ’– welcome to pty_write(9) from the Kernel API Manual β€” today’s vibe check is β€œwriting to a pty,” and ngl it’s kind of iconic ✨

πŸŽ€ NAME πŸŽ€

pty_write β€” write to a pty, periodt πŸ’…

✨ SYNOPSIS ✨

the way that the signature is literally right here, no cap:

ssize_t pty_write (struct tty_struct *tty , const u8 *buf , size_t c );

πŸ’… ARGUMENTS πŸ’…

  • tty β€” the tty we write from 🫢
  • buf β€” kernel buffer of data πŸ“¦
  • c β€” bytes to write πŸ”’

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is our β€œhardware” write method πŸ‘‘ β€” yes, the quotes are doing a lot of work there, bestie 😭. Data is coming from the ldisc, which may be in a non sleeping state 😴🚫.

We simply throw this at the other end of the link, as if we were an IRQ handler receiving stuff for the other side of the pty/tty pair πŸ”₯. That’s the whole vibe. It’s giving main character energy, fr fr πŸ’œ

not me romanticizing a kernel write path, but here we are πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/tty/pty.c β€” and the related pages are pty_write_room(9), pty_resize(9), pty_start(9), pty_common_install(9), ptm_open_peer(9), ptm_unix98_lookup(9), pts_unix98_lookup(9), ptmx_open(9) β€” go read them, bestie 🫢


mwah πŸ’‹ this little page lives in ./drivers/tty, is dated October 2026, and goes by pty_write(9) β€” byeeee πŸŽ€βœ¨

πŸ“¦ where this page comes from