News for hackers. Stuff that matters.
Re:Dtrace for Linux by quotemstr on Wednesday February 14, 2018 @08:23PM (#16381198)
For ages now, I've wanted NT-style process handles. open(2)ing a process (maybe via its proc directory) should keep the corresponding process alive, even if as a zombie. This way, you'd be able to write perfectly robust versions of pkill without annoying TOCTOU PID reuse races.

Linus has rejected this mechanism due to the ability of an outstanding process handle to prevent process reclaim, permitting users to fill the process table --- but I think this argument is bogus: users not constrained by RLIMIT_NPROC can do that already, and we could count process handles against RLIMIT_NPROC.

Bonus points: allow operations like kill, ptrace, status-reading, etc., via the process handle FD instead of PID-accepting syscalls. This way, you'd be able to pass the FD around as a credential.

Even more bonus points: select(2) support for the FD for easy process death monitoring.

Re:Dtrace for Linux by nanny on Wednesday February 14, 2018 @08:41PM (#16381283)
The argument is not bogus, but it may not be realistic. But this is: https://randomascii.wordpress.com/2018/02/11/zombie-processe...
Re:Dtrace for Linux by quotemstr on Wednesday February 14, 2018 @08:43PM (#16381291)
So? How is that different from leaking any other kind of resource? There's nothing special about processes.
Re:Dtrace for Linux by JdeBP on Thursday February 15, 2018 @05:20AM (#16382973)
We've talked before about FreeBSD's process descriptors and EVFILT_PROC kevents, ne?
Re:Dtrace for Linux by loeg on Thursday February 15, 2018 @01:32PM (#16386336)
Process descriptors are unfortunately a little incomplete -- pdwait() was never implemented. They don't seem to be getting much use.
Re:Dtrace for Linux by crest on Thursday February 22, 2018 @08:57AM (#16437532)
You don't need pdwait(). You can watch the process descriptor with kqueue to get the process exit status look for EVFILT_PROCDESC in https://www.freebsd.org/cgi/man.cgi?kevent.