diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2014-11-26 15:46:03 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2014-11-26 15:46:03 +0100 |
commit | bc9f42f5595bf554e9af7d2cfc0bb9dfb8fb255f (patch) | |
tree | 0aa2cad898b22aae0052553478a7290209303f36 /src/global.h | |
parent | a9b1332f8f0edb0b98113d6b959e0066bac8505f (diff) | |
download | 0xFFFF-bc9f42f5595bf554e9af7d2cfc0bb9dfb8fb255f.tar.bz2 |
all: Use nanosleep (via SLEEP) instead usleep
Diffstat (limited to 'src/global.h')
-rw-r--r-- | src/global.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/global.h b/src/global.h index e1f0365..991d3b3 100644 --- a/src/global.h +++ b/src/global.h @@ -5,6 +5,7 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include <time.h> extern int simulate; extern int noverify; @@ -21,4 +22,6 @@ extern int verbose; #define ALLOC_ERROR() do { ERROR("Cannot allocate memory"); } while (0) #define ALLOC_ERROR_RETURN(...) do { ALLOC_ERROR(); return __VA_ARGS__; } while (0) +#define SLEEP(usec) do { struct timespec _t = { 0, (usec) }; nanosleep(&_t, NULL); } while (0) + #endif |