]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: add option for fexecve use 17079/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 Nov 2020 14:01:13 +0000 (15:01 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 6 Nov 2020 14:20:34 +0000 (15:20 +0100)
commitceedbf8185fc7593366679f02d31da63af8c4bd1
treec4bdddf2fa357c70bea717eb4f41b5a48bf7a6ed
parent3f51bbff559428e4c32640c0c1b7b8516dc16acb
meson: add option for fexecve use

There are downsides to using fexecve:

when fexecve is used (for normal executables), /proc/pid/status shows Name: 3,
which means that ps -C foobar doesn't work. pidof works, because it checks
/proc/self/cmdline. /proc/self/exe also shows the correct link, but requires
privileges to read. /proc/self/comm also shows "3".

I think this can be considered a kernel deficiency: when O_CLOEXEC is used, this
"3" is completely meaningless. It could be any number. The kernel should use
argv[0] instead, which at least has *some* meaning.

I think the approach with fexecve/execveat is instersting, so let's provide it
as opt-in.
meson.build
meson_options.txt
src/shared/exec-util.c