aboutsummaryrefslogtreecommitdiffstats
path: root/Process.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2022-02-04 11:23:04 +0100
committerDaniel Lange <DLange@git.local>2022-02-04 11:23:04 +0100
commit93c96b12c9cb349b762d38d69568d65cd3e4fbfd (patch)
tree9cb12bb8f6c16c23cbb19df65c2334449693187d /Process.h
parentebf0c067a1fdd4b4779b9557552c2278755dcab4 (diff)
parenta6822e98434cf7da6fab033898094976d881ee0f (diff)
downloaddebian_htop-93c96b12c9cb349b762d38d69568d65cd3e4fbfd.tar.gz
debian_htop-93c96b12c9cb349b762d38d69568d65cd3e4fbfd.tar.bz2
debian_htop-93c96b12c9cb349b762d38d69568d65cd3e4fbfd.zip
Update upstream source from tag 'upstream/3.1.2'
Update to upstream version '3.1.2' with Debian dir 5ce130e9471b77941bbd217b5ea8b7b3419a91c6
Diffstat (limited to 'Process.h')
-rw-r--r--Process.h43
1 files changed, 29 insertions, 14 deletions
diff --git a/Process.h b/Process.h
index 4080d98..26f6434 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;
@@ -278,8 +286,12 @@ void Process_writeField(const Process* this, RichString* str, ProcessField field
int Process_compare(const void* v1, const void* v2);
void Process_delete(Object* cast);
extern const ProcessFieldData Process_fields[LAST_PROCESSFIELD];
+#define PROCESS_MIN_PID_DIGITS 5
#define PROCESS_MAX_PID_DIGITS 19
+#define PROCESS_MIN_UID_DIGITS 5
+#define PROCESS_MAX_UID_DIGITS 19
extern int Process_pidDigits;
+extern int Process_uidDigits;
typedef Process* (*Process_New)(const struct Settings_*);
typedef void (*Process_WriteField)(const Process*, RichString*, ProcessField);
@@ -337,6 +349,9 @@ static inline bool Process_isThread(const Process* this) {
void Process_setupColumnWidths(void);
+/* Sets the size of the UID column based on the passed UID */
+void Process_setUidColumnWidth(uid_t maxUid);
+
/* Takes number in bytes (base 1024). Prints 6 columns. */
void Process_printBytes(RichString* str, unsigned long long number, bool coloring);

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