Skip to content

Commit

Permalink
Uptime implementation on Windows (osquery#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
marpaia authored and PoppySeedPlehzr committed Jan 12, 2017
1 parent 57a6a94 commit 762e31a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osquery/tables/system/uptime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <sys/sysctl.h>
#elif defined(__linux__)
#include <sys/sysinfo.h>
#elif defined(WIN32)
#include <windows.h>
#endif

namespace osquery {
Expand Down Expand Up @@ -43,6 +45,8 @@ long getUptime() {
}

return sys_info.uptime;
#elif defined(WIN32)
return (long)GetTickCount64() / 1000;
#endif

return -1;
Expand Down

0 comments on commit 762e31a

Please sign in to comment.