summaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authormarcluque <marc.luque@outlook.com>2021-10-12 00:45:09 +0200
committercgzones <cgzones@googlemail.com>2021-11-02 20:02:54 +0100
commitd8dfbbd37ca7855be44391697424edac9015f14f (patch)
tree598c12d03eca299cf7096a86c215243d5d63e504 /Process.h
parentafa3fe4af1af9dc5347c06578fa2fb940f8cfc8d (diff)
Tidy up process state handling
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/Process.h b/Process.h
index bbdcbf66..26f64349 100644
--- a/Process.h
+++ b/Process.h
@@ -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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy