TheBrokenRail
48137f9665
Some checks failed
Build / Build (AMD64, Client) (push) Successful in 35m5s
Build / Build (AMD64, Server) (push) Successful in 25m47s
Build / Build (ARM64, Client) (push) Successful in 30m50s
Build / Build (ARM64, Server) (push) Successful in 29m6s
Build / Build (ARMHF, Client) (push) Successful in 29m9s
Build / Build (ARMHF, Server) (push) Successful in 25m58s
Build / Release (push) Successful in 2m57s
Build / Test (push) Has been cancelled
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include <unistd.h>
|
|
#include <stdint.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <sys/wait.h>
|
|
#include <fcntl.h>
|
|
#include <signal.h>
|
|
|
|
#include "log.h"
|
|
#include "string.h"
|
|
#include "util.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Set Environmental Variable
|
|
void set_and_print_env(const char *name, const char *value);
|
|
|
|
// Safe execvpe()
|
|
#define for_each_special_environmental_variable(handle) \
|
|
handle("LD_LIBRARY_PATH"); \
|
|
handle("LD_PRELOAD");
|
|
void setup_exec_environment(int is_arm_component);
|
|
__attribute__((noreturn)) void safe_execvpe(const char *const argv[], const char *const envp[]);
|
|
|
|
// Debug Tag
|
|
#define CHILD_PROCESS_TAG "(Child Process) "
|
|
|
|
// Run Command And Get Output
|
|
char *run_command(const char *const command[], int *exit_status, size_t *output_size);
|
|
#define is_exit_status_success(status) (WIFEXITED(status) && WEXITSTATUS(status) == 0)
|
|
|
|
// Get Exit Status String
|
|
void get_exit_status_string(int status, char **out);
|
|
|
|
// Track Children
|
|
void track_child(pid_t pid);
|
|
void untrack_child(pid_t pid);
|
|
void murder_children();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|