]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/exec-util.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / shared / exec-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <stdbool.h>
5
6 #include "time-util.h"
7
8 typedef int (*gather_stdout_callback_t) (int fd, void *arg);
9
10 enum {
11 STDOUT_GENERATE, /* from generators to helper process */
12 STDOUT_COLLECT, /* from helper process to main process */
13 STDOUT_CONSUME, /* process data in main process */
14 _STDOUT_CONSUME_MAX,
15 };
16
17 typedef enum {
18 EXEC_DIR_NONE = 0, /* No execdir flags */
19 EXEC_DIR_PARALLEL = 1 << 0, /* Execute scripts in parallel, if possible */
20 EXEC_DIR_IGNORE_ERRORS = 1 << 1, /* Ignore non-zero exit status of scripts */
21 } ExecDirFlags;
22
23 int execute_directories(
24 const char* const* directories,
25 usec_t timeout,
26 gather_stdout_callback_t const callbacks[_STDOUT_CONSUME_MAX],
27 void* const callback_args[_STDOUT_CONSUME_MAX],
28 char *argv[],
29 char *envp[],
30 ExecDirFlags flags);
31
32 extern const gather_stdout_callback_t gather_environment[_STDOUT_CONSUME_MAX];