pidref: add structure that can reference a pid via both pidfd and pid_t
Let's start with the conversion of PID 1 to pidfds. Let's add a simple structure with just two fields that can be used to maintain a reference to arbitrary processes via both pid_t and pidfd. This is an embeddable struct, to keep it in line with where we previously used a pid_t directly to track a process. Of course, since this might contain an fd on systems where we have pidfd this structure has a proper lifecycle. (Note that this is quite different from sd_event_add_child() event source objects as that one is only for child processes and collects process results, while this infra is much simpler and more generic and can be used to reference any process, anywhere in the tree.)
This commit is contained in:
@@ -65,6 +65,7 @@ basic_sources = files(
|
||||
'path-lookup.c',
|
||||
'path-util.c',
|
||||
'percent-util.c',
|
||||
'pidref.c',
|
||||
'prioq.c',
|
||||
'proc-cmdline.c',
|
||||
'process-util.c',
|
||||
|
||||
Reference in New Issue
Block a user