diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc index 4fce3e0b3..c81805ab6 100644 --- a/winsup/utils/ps.cc +++ b/winsup/utils/ps.cc @@ -337,6 +337,17 @@ main (int argc, char *argv[]) p->start_time = to_time_t (&ct); CloseHandle (h); } + if (!h || 0 == p->start_time || -1 == p->start_time) + { + SYSTEM_TIMEOFDAY_INFORMATION stodi; + status = NtQuerySystemInformation (SystemTimeOfDayInformation, + (PVOID) &stodi, sizeof stodi, NULL); + if (!NT_SUCCESS (status)) + fprintf (stderr, + "NtQuerySystemInformation(SystemTimeOfDayInformation), " + "status %08x", status); + p->start_time = to_time_t ((FILETIME*)&stodi.BootTime); + } } char uname[128]; -- 2.17.0
- [PATCH] default ps -W process start time to system boot t... Brian Inglis
- Re: [PATCH] default ps -W process start time to syst... Corinna Vinschen
- Re: [PATCH] default ps -W process start time to ... Brian Inglis
- Re: [PATCH] default ps -W process start time to syst... Achim Gratz
- Re: [PATCH] default ps -W process start time to ... Corinna Vinschen
- Re: [PATCH] default ps -W process start time... Achim Gratz
- Re: [PATCH] default ps -W process start ... Eric Blake
- Re: [PATCH] default ps -W process s... Brian Inglis
- Re: [PATCH] default ps -W process start ... Brian Inglis
- Re: [PATCH] default ps -W process s... Achim Gratz
- Re: [PATCH] default ps -W proce... Brian Inglis