mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 11:30:56 +08:00
default ps -W process start time to system boot time when inaccessible, 0, -1
This commit is contained in:
parent
5737045c00
commit
ee1ad64234
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user