Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: posix: nanosleep #25554

Closed
cfriedt opened this issue May 22, 2020 · 1 comment · Fixed by #25559
Closed

lib: posix: nanosleep #25554

cfriedt opened this issue May 22, 2020 · 1 comment · Fixed by #25559
Labels
Enhancement Changes/Updates/Additions to existing features

Comments

@cfriedt
Copy link
Member

cfriedt commented May 22, 2020

Is your enhancement proposal related to a problem? Please describe.
nanosleep(2) is required for std::chrono in C++, among other things. It's POSIX (IEEE 1003.1) as well.

Describe the solution you'd like
I'll create a PR.

Describe alternatives you've considered
Looked into newlib. There is no de-facto implementation of nanosleep. It generally just makes a system call. FWICT, Zephyr only has k_msleep() precision, which relies on ticks, FWICT.

Additional context
Loosely related to #24730 (where reusing time.h header from libc was mentioned)
Required by #25527

@cfriedt cfriedt added the Enhancement Changes/Updates/Additions to existing features label May 22, 2020
@cfriedt
Copy link
Member Author

cfriedt commented May 23, 2020

Also discussed in #6498
Our primary limitation is k_busy_wait(us), fwict.

carlescufi pushed a commit that referenced this issue Jun 12, 2020
This change adds support for nanosleep(2) documented at
https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html

N.B: Currently, this provides no better resolution than
k_busy_wait()

Fixes #25554

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant