aux: Support waiting more than 0.999... seconds in os_nanosleep

This commit is contained in:
Christoph Haag 2020-09-07 15:25:00 +02:00
parent 6133d4cf99
commit a884e24b9a

View file

@ -64,8 +64,9 @@ os_nanosleep(long nsec)
{
#ifdef XRT_OS_LINUX
struct timespec spec;
spec.tv_sec = 0;
spec.tv_nsec = nsec, nanosleep(&spec, NULL);
spec.tv_sec = (nsec / (1000 * 1000 * 1000));
spec.tv_nsec = (nsec % (1000 * 1000 * 1000));
nanosleep(&spec, NULL);
#endif
}