This commit is contained in:
Anthony Scopatz 2017-02-04 15:14:45 -05:00
parent cc7dd91553
commit 23f606666d

View file

@ -28,7 +28,7 @@ def _uptime_osx():
"""Returns the uptime on mac / darwin."""
global _BOOTTIME
bt = xlimps.macutils.sysctlbyname("kern.boottime", return_str=False)
bt = struct.unpack('@ii', bt)
bt = struct.unpack('@ll', bt)
bt = bt[0] + bt[1]*1e-6
if bt == 0.0:
return None
@ -199,6 +199,7 @@ def _uptime_solaris():
return time.time() - _BOOTTIME
return None
def _uptime_syllable():
"""Returns uptime in seconds or None, on Syllable."""
global _BOOTTIME
@ -208,6 +209,7 @@ def _uptime_syllable():
except (NameError, OSError):
return None
def _uptime_windows():
"""
Returns uptime in seconds or None, on Windows. Warning: may return