fix #105 EINTR handled too defensively when polling
[awesomized/libmemcached] / src / p9y / clock_gettime.hpp
1 #pragma once
2
3 #include "mem_config.h"
4
5 #if defined __cplusplus
6 # include <ctime>
7 #else
8 # include <time.h>
9 #endif
10
11 #ifndef HAVE_CLOCK_MONOTONIC
12 # define CLOCK_MONOTONIC 1
13 #endif
14
15 #ifndef HAVE_STRUCT_TIMESPEC
16 struct timespec {
17 long tv_sec;
18 long tv_nsec;
19 };
20 #endif
21
22 #ifndef HAVE_CLOCK_GETTIME
23 # define P9Y_NEED_CLOCK_GETTIME
24 int clock_gettime(int clock_type, struct timespec *spec);
25 # ifdef _WIN32
26 # endif // _WIN32
27 #endif // HAVE_CLOCK_GETTIME