fx.diagnostics: add linux support for starting processes

This commit is contained in:
2026-06-13 14:48:19 +01:00
parent 10cfb05287
commit 8237fae60f
4 changed files with 540 additions and 13 deletions
@@ -1,6 +1,7 @@
#ifndef FX_DIAGNOSTICS_PROCESS_H_
#define FX_DIAGNOSTICS_PROCESS_H_
#include <fx/collections/hashtable.h>
#include <fx/macros.h>
#include <fx/stream.h>
@@ -18,16 +19,20 @@ typedef struct fx_process_start_info {
const char *proc_file_name;
const char **proc_args;
size_t proc_args_count;
const fx_hashtable *proc_environment;
} fx_process_start_info;
FX_API fx_type_id fx_process_get_type(void);
FX_API fx_process *fx_process_create(const fx_process_start_info *info);
FX_API fx_process *fx_process_get_self(void);
FX_API fx_status fx_process_start(fx_process *proc);
FX_API fx_status fx_process_wait(fx_process *proc, int *out_result);
FX_API fx_status fx_process_kill(fx_process *proc);
FX_API const fx_hashtable *fx_process_get_environment(const fx_process *proc);
FX_API fx_stream *fx_process_get_stdin(fx_process *proc);
FX_API fx_stream *fx_process_get_stdout(fx_process *proc);
FX_API fx_stream *fx_process_get_stderr(fx_process *proc);