set_sgttyb(9)
π 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 β
0on 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 π:
tty_chars_in_buffer(9)tty_write_room(9)tty_driver_flush_buffer(9)tty_unthrottle(9)tty_throttle_safe(9)tty_unthrottle_safe(9)tty_wait_until_sent(9)tty_termios_copy_hw(9)tty_termios_hw_change(9)tty_get_char_size(9)tty_get_frame_size(9)tty_set_termios(9)set_termios(9)tty_change_softcar(9)tty_mode_ioctl(9)
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
- 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