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

posix: clock_nanosleep implementation #61671

Merged

Conversation

TomFinet
Copy link
Contributor

@TomFinet TomFinet commented Aug 19, 2023

Implementation of the clock_nanosleep function.

Fixes #59949

@TomFinet TomFinet requested a review from cfriedt as a code owner August 19, 2023 17:56
@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Aug 19, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @TomFinet, and thank you very much for your first pull request to the Zephyr project!

A project maintainer just triggered our CI pipeline to run it against your PR and ensure it's compliant and doesn't cause any issues. You might want to take this opportunity to review the project's Contributor Expectations and make any updates to your pull request if necessary. 😊

Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - please just fix compliance issues, failed tests, and please refactor tests in nanosleep.c

lib/posix/clock.c Outdated Show resolved Hide resolved
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this PR includes a significant amount of code formatting / whitespace changes.

Can you please make the whitespace changes in a separate commit, if necessary, or simply undo the formatting changes in your current code commit?

@TomFinet TomFinet force-pushed the posix_clock_nanosleep branch 2 times, most recently from 92456f9 to 7b0776b Compare August 28, 2023 16:13
Implements the posix clock_nanosleep function, where both relative
and absolute sleeps are made as absolute sleeps.
The nanosleep() function is a special case of clock_nanosleep(),
and so has been refactored to simply call it.

Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
Adds error and lower bounds tests for the posix clock_nanosleep
function. Refactors common test functions to be shared by both
clock_nanosleep and nanosleep tests.

Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM & thanks for your contribution :-)

@mbolivar-ampere mbolivar-ampere merged commit ceb5995 into zephyrproject-rtos:main Aug 30, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

posix: implement clock_nanosleep()
4 participants