mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-21 13:22:23 -08:00
process groups + pipe pair
This commit is contained in:
1 parent
c44e4a388e
commit
77bacd640a
5 files changed
+328
-4
No files matched your search
@@ -40,6 +40,13 @@ struct File
|
||||
U64 u64[1];
|
||||
};
|
||||
|
||||
typedef struct FilePair FilePair;
|
||||
struct FilePair
|
||||
{
|
||||
File read;
|
||||
File write;
|
||||
};
|
||||
|
||||
typedef struct FileMap FileMap;
|
||||
struct FileMap
|
||||
{
|
||||
@@ -70,6 +77,11 @@ internal String8 file_read_cstring(Arena *arena, File file, U64 off);
|
||||
//- rjf: files
|
||||
internal File file_open(AccessFlags flags, String8 path);
|
||||
internal void file_close(File file);
|
||||
internal FilePair file_pipe_make(B32 read_inherited, B32 write_inherited);
|
||||
internal U64 file_pipe_read(File file, void *out_data, U64 size);
|
||||
internal U64 file_pipe_write(File file, void *data, U64 size);
|
||||
internal U64 file_pipe_bytes_available(File file);
|
||||
internal B32 file_pipe_is_end(File file);
|
||||
internal U64 file_read(File file, Rng1U64 rng, void *out_data);
|
||||
#define file_read_struct(f, off, ptr) file_read((f), r1u64((off), (off)+sizeof(*(ptr))), (ptr))
|
||||
internal U64 file_write(File file, Rng1U64 rng, void *data);
|
||||
|
||||
@@ -25,6 +25,12 @@ struct Process
|
||||
U64 u64[1];
|
||||
};
|
||||
|
||||
typedef struct ProcessGroup ProcessGroup;
|
||||
struct ProcessGroup
|
||||
{
|
||||
U64 u64[1];
|
||||
};
|
||||
|
||||
typedef struct ProcessNode ProcessNode;
|
||||
struct ProcessNode
|
||||
{
|
||||
@@ -49,6 +55,8 @@ struct ProcessLaunchParams
|
||||
B32 inherit_env;
|
||||
B32 debug_subprocesses;
|
||||
B32 consoleless;
|
||||
B32 new_console;
|
||||
ProcessGroup process_group;
|
||||
File stdout_file;
|
||||
File stderr_file;
|
||||
File stdin_file;
|
||||
@@ -84,8 +92,15 @@ internal U32 get_process_start_time_unix(void);
|
||||
|
||||
internal Process process_launch(ProcessLaunchParams *params);
|
||||
internal U64 pid_from_process(Process process);
|
||||
internal B32 process_poll(Process process, U64 *exit_code_out);
|
||||
internal B32 process_is_active(Process process);
|
||||
internal B32 process_join(Process process, U64 endt_us, U64 *exit_code_out);
|
||||
internal void process_detach(Process process);
|
||||
internal B32 process_kill(Process process);
|
||||
internal B32 process_send_ctrl_c(Process process);
|
||||
|
||||
internal ProcessGroup process_group_make(B32 kill_on_close);
|
||||
internal B32 process_group_add(ProcessGroup group, Process process);
|
||||
internal void process_group_close(ProcessGroup group);
|
||||
|
||||
#endif // BASE_PROCESSES_H
|
||||
Reference in new issue
Block a user