Top (Hurd): reports startTime; uses time_value64_t

This commit is contained in:
李通洲
2026-08-29 10:29:39 +08:00
committed by Carter Li
parent 1c9e521775
commit af8a42270c
+7 -7
View File
@@ -60,16 +60,16 @@ const char* ffTopGetProcessSnapshot(FFlist* snapshots, FFTopTypes) {
if (proc_stat_has(stat, PSTAT_TASK_BASIC)) {
const task_basic_info_t info = proc_stat_task_basic_info(stat);
item->cpuTime = (uint64_t) info->user_time.seconds * 1000 +
(uint64_t) info->user_time.microseconds / 1000 +
(uint64_t) info->system_time.seconds * 1000 +
(uint64_t) info->system_time.microseconds / 1000;
item->cpuTime = (uint64_t) info->user_time64.seconds * 1000 +
(uint64_t) info->user_time64.nanoseconds / 1000000 +
(uint64_t) info->system_time64.seconds * 1000 +
(uint64_t) info->system_time64.nanoseconds / 1000000;
item->memBytes = (uint64_t) info->resident_size;
item->startTime = (uint64_t) info->creation_time64.seconds * 1000 +
(uint64_t) info->creation_time64.nanoseconds / 1000000;
}
// Neither process start times nor storage io counters are exposed by
// the Hurd; leave them zeroed.
item->startTime = 0;
// Storage io counters aren't exposed by kernel; leave them zeroed.
item->bytesRead = 0;
item->bytesWritten = 0;
}