tiocsctty(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_lock to serialize proc_set_tty for this tty 🧡
  • It takes tasklist_lock internally to walk sessions πŸšΆβ€β™€οΈ
  • It takes ->siglock when updating signal->tty πŸ“‘

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/tty/tty_jobctrl.c is the place, and the whole squad is:


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