diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-10 16:12:03 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-10 16:12:03 +0100 |
commit | 48c1c4dcc449d05e9950a861e165f456e0d583a1 (patch) | |
tree | 1107e6a6779d16824055e358eb04a45fc5365b63 /src/common/include/proto/proc.h | |
parent | c6068c0bce5cf764846e775d3509b1a82af4a0e5 (diff) | |
download | kogata-48c1c4dcc449d05e9950a861e165f456e0d583a1.tar.gz kogata-48c1c4dcc449d05e9950a861e165f456e0d583a1.zip |
Rename & cleanup.
Diffstat (limited to 'src/common/include/proto/proc.h')
-rw-r--r-- | src/common/include/proto/proc.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/common/include/proto/proc.h b/src/common/include/proto/proc.h new file mode 100644 index 0000000..29b5b91 --- /dev/null +++ b/src/common/include/proto/proc.h @@ -0,0 +1,25 @@ +#pragma once + +#include <stddef.h> +#include <stdint.h> + +typedef int pid_t; + +#define PS_LOADING 1 +#define PS_RUNNING 2 +#define PS_FINISHED 3 +#define PS_FAILURE 4 // exception or segfault or stuff +#define PS_KILLED 5 + +#define FAIL_EXCEPTION 1 // unhandled processor exception +#define FAIL_ZEROPTR 2 // segfault at < 4k +#define FAIL_SEGFAULT 3 +#define FAIL_SC_SEGFAULT 4 // failed to validate parameter for system call + +typedef struct { + int pid; + int status; // one of PS_* + int exit_code; // an error code if state == PS_FAILURE +} proc_status_t; + +/* vim: set ts=4 sw=4 tw=0 noet :*/ |