On OpenBSD use the MacOS msleep(), not the default one

which uses clock_nanosleep(2) which OpenBSD doesn't have.
This commit is contained in:
Alexander A. Klimov 2022-10-22 13:14:32 +02:00
parent 373504735e
commit bca777bef4

View File

@ -212,6 +212,10 @@ int posix_fadvise(int fd, off_t offset, off_t len, int advice)
}
}
#endif /* Apple Macintosh */
#if (__APPLE__ && __MACH__) || defined(__OpenBSD__)
#include <unistd.h> /* For usleep(). */
void msleep(double wait_ms)
@ -219,7 +223,7 @@ void msleep(double wait_ms)
assert(!usleep(wait_ms * 1000));
}
#else
#else /* Apple Macintosh / OpenBSD */
#include <time.h> /* For clock_gettime() and clock_nanosleep(). */
@ -254,4 +258,4 @@ void msleep(double wait_ms)
assert(ret == 0);
}
#endif
#endif /* Apple Macintosh / OpenBSD */