diff options
Diffstat (limited to 'EdkUnixPkg/Sec/UnixThunk.c')
-rw-r--r-- | EdkUnixPkg/Sec/UnixThunk.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/EdkUnixPkg/Sec/UnixThunk.c b/EdkUnixPkg/Sec/UnixThunk.c index 46b0e34c55..c1988faf59 100644 --- a/EdkUnixPkg/Sec/UnixThunk.c +++ b/EdkUnixPkg/Sec/UnixThunk.c @@ -90,6 +90,18 @@ SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs)) } void +msSleep (unsigned long Milliseconds) +{ + struct timespec ts; + + ts.tv_sec = Milliseconds / 1000; + ts.tv_nsec = (Milliseconds % 1000) * 1000000; + + while (nanosleep (&ts, &ts) != 0 && errno == EINTR) + ; +} + +void GetLocalTime (EFI_TIME *Time) { struct tm *tm; @@ -110,12 +122,6 @@ GetLocalTime (EFI_TIME *Time) | (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0); } -void -msSleep (unsigned long Milliseconds) -{ - usleep (Milliseconds * 1000); -} - static void TzSet (void) { |