lkml.org 
[lkml]   [2018]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH] Minimal non-child process exit notification support
Date
From: Daniel Colascione
> Sent: 29 October 2018 17:53
>
> This patch adds a new file under /proc/pid, /proc/pid/exithand.
> Attempting to read from an exithand file will block until the
> corresponding process exits, at which point the read will successfully
> complete with EOF. The file descriptor supports both blocking
> operations and poll(2). It's intended to be a minimal interface for
> allowing a program to wait for the exit of a process that is not one
> of its children.

Why do you need an extra file?
It ought to be possible to use poll() to wait for POLLERR having set
'events' to zero on any of the nodes in /proc/pid - or even on
the directory itself.

Indeed, to avoid killing the wrong process you need to have opened
some node of /proc/pid/* (maybe cmdline) before sending the kill
signal.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2018-10-31 13:27    [W:0.230 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site