pts_unix98_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pts_unix98_lookup(9) πŸ’–

okay so real talk, we're in the Kernel API Manual today bestie, and this is the page for pts_unix98_lookup. yes it's a mouthful. yes it slays anyway 🫢


✨ NAME ✨

pts_unix98_lookup β€” find a pty slave 🌸

like, that's the whole job. it finds the pty slave. iconic behavior, no notes πŸ’…


✨ SYNOPSIS ✨

struct tty_struct * pts_unix98_lookup (struct tty_driver *driver ,
struct file *file , int idx );

so it takes three things and hands you back a struct tty_struct * πŸŽ€ that's the whole shape of it, keep that signature exactly as-is, do not touch, do not "clean it up", it is perfect the way it is 😭


✨ ARGUMENTS ✨

  • driver β€” the pts driver. your main character driver, the one doing the actual work πŸ‘‘
  • file β€” a file pointer to the tty. yes, that kind of file pointer, the tty one πŸ¦‹
  • idx β€” the tty index. it's an int, it's the number, it's how you say "which one" ⭐

✨ DESCRIPTION ✨

okay so here's the tea: pts_unix98_lookup looks up a pty master device. yes, the NAME says slave, the DESCRIPTION says master, and both are literally in the original, so we're holding both truths at once, she contains multitudes πŸ’€βœ¨

it's called under the tty_mutex for now β€” like, currently, that's the situation, for now, we're being honest about it πŸ™ˆ β€” and that's what provides the locking for the tty pointer. so the mutex is doing the heavy lifting and honestly? she's carrying the whole team 🫢

ngl, the "for now" is doing a lot of emotional work in that sentence. just so you know it's tty_mutex, and the locking for the tty pointer comes from there. no cap πŸ’–

✨ SEE ALSO ✨

kernel file ./drivers/tty/pty.c β€” go read it, it's right there, it's giving source material 🌈

and the whole friend group, in order:

all of them, every single one, no skips, we don't do that here πŸ’œ


anyway bestie that's the page!! from ./drivers/tty πŸ’–, October 2026 edition, and yes this whole thing is literally titled pts_unix98_lookup(9) again at the end because manpages love a callback πŸŽ€ mwah, go look up your pty slaves responsibly πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from