SchOS/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 0b39f8bad1 proc: the controlling terminal crosses fork()
`ps` listed the shell and nothing the shell had started -- background jobs
included, which is how it was noticed.

p->ctty was set by TIOCSCTTY and never inherited, so every child of a shell had
ctty 0. `ps` with no arguments shows only processes on *this* terminal, so a
job running on your terminal was invisible because the only process that had
ever claimed one was the shell itself.

The controlling terminal is a property of the session, not of the process that
happened to call the ioctl. It crosses fork() with pgid and sid, three lines
above where it now sits.

    # sleep 60 & ; sleep 61 &
    # ps
       PID TTY          TIME CMD
        14 1:11     00:00:00 sleep
         9 1:11     00:00:00 zsh
        15 1:11     00:00:00 sleep
        17 1:11     00:00:00 ps

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 09:21:06 +02:00
..
arch/x86_64 proc: real CPU time, a tty number, and an exe that is a symlink 2026-09-22 02:45:00 +02:00
core root: find the filesystem instead of being told at build time, and fix dmesg 2026-09-22 01:24:34 +02:00
dev branding: one mark, and PSOGM draws it 2026-09-21 21:35:58 +02:00
drivers boot: one line when it works, all of it when it does not 2026-09-14 21:19:50 +02:00
fs proc: real CPU time, a tty number, and an exe that is a symlink 2026-09-22 02:45:00 +02:00
net boot: one line when it works, all of it when it does not 2026-09-14 21:19:50 +02:00
proc proc: the controlling terminal crosses fork() 2026-09-22 09:21:06 +02:00
sys proc: real CPU time, a tty number, and an exe that is a symlink 2026-09-22 02:45:00 +02:00
kernel.ld debugger: the kernel can be asked a question 2026-09-14 00:58:45 +02:00