common: add pidfd related methods

Add functions to open pidfds, i.e. file descriptors representing
processes, for process ids and vice versa. Both functions work
an array of fds/pids, stop on error and return the number of
successfully handled items.
This commit is contained in:
Christian Kellner
2019-10-04 17:34:53 +02:00
parent 4b59818fd4
commit 5398dd1d19
4 changed files with 266 additions and 0 deletions

View File

@@ -128,9 +128,13 @@ with_examples = get_option('with-examples')
with_util = get_option('with-util')
# Provide a config.h
pidfd_open = cc.has_function('pidfd_open', args: '-D_GNU_SOURCE')
cdata = configuration_data()
cdata.set_quoted('LIBEXECDIR', path_libexecdir)
cdata.set_quoted('GAMEMODE_VERSION', meson.project_version())
cdata.set10('HAVE_FN_PIDFD_OPEN', pidfd_open)
config_h = configure_file(
configuration: cdata,
output: 'build-config.h',