mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
b9f732c31f
As per t5494224, all of the license headers in osquery needed to be updated to reflect the correct open source header style.
35 lines
767 B
C++
35 lines
767 B
C++
/*
|
|
* Copyright (c) 2014, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
|
|
#include <ctime>
|
|
|
|
#include <osquery/tables.h>
|
|
|
|
namespace osquery {
|
|
namespace tables {
|
|
|
|
const int kNumCols = 1;
|
|
|
|
QueryData genTime(QueryContext& context) {
|
|
Row r;
|
|
time_t _time = time(0);
|
|
struct tm* now = localtime(&_time);
|
|
r["hour"] = INTEGER(now->tm_hour);
|
|
r["minutes"] = INTEGER(now->tm_min);
|
|
r["seconds"] = INTEGER(now->tm_sec);
|
|
QueryData results;
|
|
for (int i = 0; i < kNumCols; ++i) {
|
|
results.push_back(r);
|
|
}
|
|
return results;
|
|
}
|
|
}
|
|
}
|