From 3b56d41ef579c18feafbf47d170a6ea4375beb6f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 4 Nov 2025 22:23:28 +0000 Subject: Lots of work done, doesn't build yet, next commit will - alias subsystem moved to s6 - config subsystem deleted - new helpers subsystem, with a s6-frontend-helper-kill program - new s6f_equote function, to execline-quote an argv - started the adaptation to the new s6-rc functions, in progress --- src/helpers/s6-frontend-helper-kill.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/helpers/s6-frontend-helper-kill.c (limited to 'src/helpers/s6-frontend-helper-kill.c') diff --git a/src/helpers/s6-frontend-helper-kill.c b/src/helpers/s6-frontend-helper-kill.c new file mode 100644 index 0000000..c217373 --- /dev/null +++ b/src/helpers/s6-frontend-helper-kill.c @@ -0,0 +1,31 @@ +/* ISC license. */ + +#include +#include + +#include +#include +#include + +#define USAGE "s6-frontend-helper-kill signal pid..." +#define dieusage() strerr_dieusage(100, USAGE) + +int main (int argc, char const *const *argv) +{ + unsigned int sig ; + PROG = "s6-frontend-helper-kill" ; + if (argc-- < 3) dieusage() ; + argv++ ; + if (!uint0_scan(*argv++, &sig)) dieusage() ; + argc-- ; + + pid_t pids[argc] ; + for (unsigned int i = 0 ; i < argc ; i++) + if (!pid0_scan(argv[i], pids + i)) + strerr_dief1x(100, "pids must be numerical") ; + + for (unsigned int i = 0 ; i < argc ; i++) + kill(sig, pids[i]) ; + + _exit(0) ; +} -- cgit v1.3.1