diff options
author | marcluque <marc.luque@outlook.com> | 2021-10-12 00:45:09 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2021-11-02 20:02:54 +0100 |
commit | d8dfbbd37ca7855be44391697424edac9015f14f (patch) | |
tree | 598c12d03eca299cf7096a86c215243d5d63e504 /Process.h | |
parent | afa3fe4af1af9dc5347c06578fa2fb940f8cfc8d (diff) |
Tidy up process state handling
Diffstat (limited to 'Process.h')
-rw-r--r-- | Process.h | 36 |
1 files changed, 22 insertions, 14 deletions
@@ -60,6 +60,26 @@ typedef enum ProcessField_ { LAST_PROCESSFIELD } ProcessField; +/* Core process states (shared by platforms) + * NOTE: The enum has an ordering that is important! + * See processStateChar in process.c for ProcessSate -> letter mapping */ +typedef enum ProcessState_ { + UNKNOWN = 1, + RUNNABLE, + RUNNING, + QUEUED, + WAITING, + UNINTERRUPTIBLE_WAIT, + BLOCKED, + PAGING, + STOPPED, + TRACED, + ZOMBIE, + DEFUNCT, + IDLE, + SLEEPING +} ProcessState; + struct Settings_; /* Holds information about regions of the cmdline that should be @@ -202,20 +222,8 @@ typedef struct Process_ { /* Number of major faults the process has made which have required loading a memory page from disk */ unsigned long int majflt; - /* - * Process state (platform dependent): - * D - Waiting - * I - Idle - * L - Acquiring lock - * R - Running - * S - Sleeping - * T - Stopped (on a signal) - * X - Dead - * Z - Zombie - * t - Tracing stop - * ? - Unknown - */ - char state; + /* Process state enum field (platform dependent) */ + ProcessState state; /* Whether the process was updated during the current scan */ bool updated; |