Process polling api

This commit is contained in:
Krzosa Karol
2024-08-07 07:31:37 +02:00
parent fe20d05e13
commit 7b8b8c751d
4 changed files with 204 additions and 60 deletions

View File

@@ -34,11 +34,20 @@ bool IsFile(String path);
String GetWorkingDir(Allocator arena);
bool IsAbsolute(String path);
struct StdoutPollInfo {
int64_t size_read;
int64_t size_available;
};
struct Process {
bool is_valid;
String error_message;
char platform[32];
int exit_code;
char platform[6 * 8];
};
Process RunEx(String cmd);
int Wait(Process *process);
Process RunCmd(String command_line, String working_dir);
bool WaitForExit(Process *process);
bool PollExitCode(Process *process);
void KillProcess(Process *process);
StdoutPollInfo PollStdout(Process *process, char *buffer, int64_t buffer_size);