pts_unix98_lookup(9)
π 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 anint, 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:
pty_write(9)pty_write_room(9)pty_resize(9)pty_start(9)pty_common_install(9)ptm_open_peer(9)ptm_unix98_lookup(9)ptmx_open(9)
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
- 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