sapling/eden/fs/utils/Clock.cpp
Chad Austin 265128f4f4 remove some conditional includes
Summary:
To simplify the build and fall in line with Folly's conventions,
remove several conditional includes. Instead, headers conditionally
define symbols.

Reviewed By: xavierd

Differential Revision: D37897850

fbshipit-source-id: 8b52d5310f5cd8cb17fdc013117c271ae09dd5d6
2022-07-19 12:37:57 -07:00

27 lines
568 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#include "eden/fs/utils/Clock.h"
#include <folly/portability/Time.h>
#include <chrono>
#include <system_error>
namespace facebook::eden {
timespec UnixClock::getRealtime() const {
timespec rv;
if (clock_gettime(CLOCK_REALTIME, &rv)) {
throw std::system_error(
errno, std::generic_category(), "clock_gettime failed");
}
return rv;
}
} // namespace facebook::eden