From a5511a0b0f74cc15c807bcee39fd9b4bc44beae2 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 7 Dec 2020 23:47:39 +0300 Subject: implement a way for programs in the mount namespace (with glibc binaries) to launch processes in the original namespace (with musl binaries) --- utils.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 utils.h (limited to 'utils.h') diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..cc9f610 --- /dev/null +++ b/utils.h @@ -0,0 +1,35 @@ +#ifndef VOIDNSRUN_UTILS_H +#define VOIDNSRUN_UTILS_H + +#include +#include "config.h" + +struct strarray { + size_t end; + size_t size; + char **list; +}; + +struct intarray { + size_t end; + size_t size; + int *list; +}; + +bool isdir(const char *s); +bool isexe(const char *s); +bool exists(const char *s); +bool mkfile(const char *s); + +int send_fd(int sock, int fd); +int recv_fd(int sock); + +bool isxbpscommand(const char *s); + +void strarray_alloc(struct strarray *a, size_t size); +bool strarray_append(struct strarray *a, char *s); + +void intarray_alloc(struct intarray *i, size_t size); +bool intarray_append(struct intarray *a, int i); + +#endif //VOIDNSRUN_UTILS_H -- cgit v1.2.3