Skip to content
Commit 3400e6d9 authored by Christopher Friedt's avatar Christopher Friedt Committed by Christopher Friedt
Browse files

lib: posix: update usleep() to follow the POSIX spec



The original implementation of `usleep()` was not compliant
to the POSIX spec in 3 ways.
- calling thread may not be suspended (because `k_busy_wait()`
  was previously used for short durations)
- if `usecs` > 1000000, previously we did not return -1 or set
  `errno` to `EINVAL`
- if interrupted, previously we did not return -1 or set
  `errno` to `EINTR`

This change addresses those issues to make `usleep()` more
POSIX-compliant.

Signed-off-by: default avatarChris Friedt <cfriedt@meta.com>
(cherry picked from commit 7b95428f)
parent fbea9e74
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment