Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH] proc: allow killing processes via file descriptors | Date | Mon, 19 Nov 2018 14:15:31 +0000 |
| |
From: > Christian Brauner > Sent: 18 November 2018 11:18 > > With this patch an open() call on /proc/<pid> will give userspace a handle > to struct pid of the process associated with /proc/<pid>. This allows to > maintain a stable handle on a process.
My 3c...
You need to add a version of fork() that returns an open fd to /proc/pid to the parent.
Is it possible to overload fcntl() rather than ioctl() ?
More interestingly what about a 'unique pid' (eg the pid extended to (say) 128 bits with a use count) that can be safely put into a /var/run/pid file for a daemon and used later in a 'kill' that will only ever reference the correct process.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |