summaryrefslogtreecommitdiff
path: root/drivers/unix/os_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/unix/os_unix.cpp')
-rw-r--r--drivers/unix/os_unix.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 992b12b7cd..75c8a153f6 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -315,7 +315,9 @@ OS::TimeZoneInfo OS_Unix::get_time_zone_info() const {
void OS_Unix::delay_usec(uint32_t p_usec) const {
- usleep(p_usec);
+ struct timespec rem = { p_usec / 1000000, (p_usec % 1000000) * 1000 };
+ while (nanosleep(&rem, &rem) == EINTR) {
+ }
}
uint64_t OS_Unix::get_ticks_usec() const {