From b9706b1bf6a81fd1481f6c0f55b5f3eb95ae79c1 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 26 Feb 2024 11:11:14 +0100 Subject: [PATCH] kill: delete obsolete mrelease() function The sole caller was removed in 10148739c49b8ec0b242ce8c46e428adf99def45 . Fixes: 10148739c49b8ec0b242ce8c46e428adf99def45 --- kill.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/kill.c b/kill.c index e8f283e..504ec43 100644 --- a/kill.c +++ b/kill.c @@ -135,35 +135,6 @@ static void notify_process_killed(const poll_loop_args_t* args, const procinfo_t } } -#if defined(__NR_pidfd_open) && defined(__NR_process_mrelease) -void mrelease(const pid_t pid) -{ - int pidfd = (int)syscall(__NR_pidfd_open, pid, 0); - if (pidfd < 0) { - // can happen if process has already exited - debug("mrelease: pid %d: error opening pidfd: %s\n", pid, strerror(errno)); - return; - } - int res = (int)syscall(__NR_process_mrelease, pidfd, 0); - if (res != 0) { - warn("mrelease: pid=%d pidfd=%d failed: %s\n", pid, pidfd, strerror(errno)); - } else { - debug("mrelease: pid=%d pidfd=%d success\n", pid, pidfd); - } -} -#else -void mrelease(__attribute__((unused)) const pid_t pid) -{ - debug("mrelease: process_mrelease() and/or pidfd_open() not available\n"); -} -#ifndef __NR_pidfd_open -#warning "__NR_pidfd_open is undefined, cannot use process_mrelease" -#endif -#ifndef __NR_process_mrelease -#warning "__NR_process_mrelease is undefined, cannot use process_mrelease" -#endif -#endif - /* * Send the selected signal to "pid" and wait for the process to exit * (max 10 seconds)