summaryrefslogtreecommitdiffhomepage
path: root/test/util/test_util.cc
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2019-05-24 12:57:34 -0700
committerShentubot <shentubot@google.com>2019-05-24 12:58:46 -0700
commit91194788302305ffe4c32547f74c658c26b8aaed (patch)
tree3e8bb49d848586d823775e98e125ab34df6beaf1 /test/util/test_util.cc
parente4b395db49e9e90659bd3d366f62aa258a3c7157 (diff)
Extract SleepSafe from test_util
Allows socket tests that rely on test_util to compile on Fuchsia. PiperOrigin-RevId: 249884084 Change-Id: I17617e3f1baaba4c85c689f40db4a42a8de1597e
Diffstat (limited to 'test/util/test_util.cc')
-rw-r--r--test/util/test_util.cc16
1 files changed, 0 insertions, 16 deletions
diff --git a/test/util/test_util.cc b/test/util/test_util.cc
index c52fd9a4a..bf0029951 100644
--- a/test/util/test_util.cc
+++ b/test/util/test_util.cc
@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
-#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/utsname.h>
@@ -211,21 +210,6 @@ std::vector<std::vector<struct iovec>> GenerateIovecs(uint64_t total_size,
return result;
}
-void SleepSafe(absl::Duration duration) {
- if (duration == absl::ZeroDuration()) {
- return;
- }
-
- struct timespec ts = absl::ToTimespec(duration);
- int ret;
- while (1) {
- ret = syscall(__NR_nanosleep, &ts, &ts);
- if (ret == 0 || (ret <= 0 && errno != EINTR)) {
- break;
- }
- }
-}
-
uint64_t Megabytes(uint64_t n) {
// Overflow check, upper 20 bits in n shouldn't be set.
TEST_CHECK(!(0xfffff00000000000 & n));