set_sgttyb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… set_sgttyb(9) β€” like, the legacy terminal setter, bestie πŸ’…

okay so this is a page from the Kernel API Manual (yes, that's the manual name, we're fancy now ✨) and it's all about set_sgttyb, which is giving "vintage but still iconic" energy. Come sit with me, I'll walk you through it 🫢


✨ NAME ✨

set_sgttyb β€” set legacy terminal values 🌸

Like, it sets the old-school terminal values. Legacy. Vintage. Retro. It's giving "found this in the attic and it still works" πŸ’–


🌈 SYNOPSIS 🌈

int set_sgttyb (struct tty_struct *tty , struct sgttyb __user *sgttyb );

That's the whole signature, no cap, copy it exactly πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • tty β€” the tty structure. The terminal. The main character, honestly πŸ‘‘
  • sgttyb β€” a pointer to the old style terminal structure. Old style!! vintage!! she's got history πŸ¦‹

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it actually does: it updates a terminal from the legacy BSD style terminal information structure. That's the whole thing. It's a glow-up for your terminal, but sourced from the old-school BSD struct, iykyk ✨

Locking: tty_struct->termios_rwsem πŸ”’

fr fr, that's the lock it takes β€” the termios rwsem on the tty struct. Don't be weird about it, just know it's there πŸ’€

⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • an error otherwise 😭

That's it. Zero means slay, anything else means something went sideways. Periodt.


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/tty/tty_ioctl.c β€” that's where she lives, bestie 🏠

And here's the whole friend group, all of them, not skipping a single one πŸ’–:

Like, the entire tty squad in one list. Obsessed. Go read them too, you won't regret it 🌈


and that's the page, bestie!! this gem comes from ./drivers/tty and it's dated October 2026 β€” so yeah, she's new-ish but the values are legacy, which is honestly such a vibe mismatch and I love that for her πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from