tiocsctty(9)
π tiocsctty β set controlling tty π
okay so bestie, welcome to the tiocsctty(9) page from the Kernel API Manual β¨ this one is lowkey all about job control, and it's giving "session leader makes a tty official" energy. no cap π«Ά
β¨ NAME β¨
tiocsctty β set controlling tty
πΈ SYNOPSIS πΈ
int tiocsctty (struct tty_struct *tty , struct file *file , int arg );
π ARGUMENTS π
ttyβ the tty structure, aka the tty we're talking about πfileβ the file structure used to check permissions πargβ the user argument π«‘
π DESCRIPTION π
okay so this ioctl is literally used to manage job control. It permits a session leader to set this tty as the controlling tty for the session. periodt. π
π Locking (the important bits)
- It takes
tty_lockto serializeproc_set_ttyfor this tty π§΅ - It takes
tasklist_lockinternally to walk sessions πΆββοΈ - It takes
->siglockwhen updatingsignal->ttyπ‘
π₯ SEE ALSO π₯
Kernel file ./drivers/tty/tty_jobctrl.c is the place, and the whole squad is:
__tty_check_change(9)__proc_set_tty(9)tty_signal_session_leader(9)disassociate_ctty(9)tty_get_pgrp(9)tiocgpgrp(9)tiocspgrp(9)tiocgsid(9)
mwah π cute little sign-off: source/version is ./drivers/tty, date is October 2026, page is tiocsctty(9) β byeee bestie, go get that controlling tty sorted π«Άβ¨
π¦ 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