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: implement clock_getcpuclockid() #67039

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

jaiiarora
Copy link
Contributor

Patch implements clock_getcpuclockid
Fix for #59954

I have based my implementation around

  1. https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getcpuclockid.html
  2. https://www.man7.org/linux/man-pages/man3/clock_getcpuclockid.3p.html (for reference)

Since zephyr only supports single process, access is allowed for clock ID only of that process specified by its process id (pid).

@jaiiarora jaiiarora changed the title posix: implement_clock_clock_getcpuclockid posix: implement clock_getcpuclockid() Dec 28, 2023
@jaiiarora jaiiarora force-pushed the fix_59954 branch 2 times, most recently from 3b1341d to 6e917a6 Compare December 30, 2023 08:06
@jaiiarora jaiiarora changed the title posix: implement clock_getcpuclockid() [RFC]posix: implement clock_getcpuclockid() Dec 30, 2023
lib/posix/clock.c Outdated Show resolved Hide resolved
lib/posix/clock.c Outdated Show resolved Hide resolved
@jaiiarora
Copy link
Contributor Author

Hi @cfriedt. I have addressed your review comments. Please take a look and let me know if any changes are needed. I will work on them.

lib/posix/clock.c Outdated Show resolved Hide resolved
@jaiiarora
Copy link
Contributor Author

Hello @cfriedt. I have addressed your comments. Thanks.

lib/posix/pthread.c Outdated Show resolved Hide resolved
@cfriedt cfriedt changed the title [RFC]posix: implement clock_getcpuclockid() posix: implement clock_getcpuclockid() Jan 3, 2024
@jaiiarora jaiiarora marked this pull request as ready for review January 3, 2024 18:07
@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Jan 3, 2024
cfriedt
cfriedt previously approved these changes Jan 3, 2024
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! 🥳

This might need a respin after #67044 is merged, but it's good to get reviews from others for the time being.

lib/posix/pthread.c Outdated Show resolved Hide resolved
lib/posix/clock.c Outdated Show resolved Hide resolved
Implements clock_getcpuclockid function

Fixes zephyrproject-rtos#59954

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
Adds ZTEST for clock_getcpuclockid function

Signed-off-by: Jai Arora <infolinesoni@gmail.com>
patch to implement get_pid function

Signed-off-by: Jai Arora <infolinesoni@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

@carlescufi carlescufi merged commit 5c34726 into zephyrproject-rtos:main Jan 8, 2024
25 checks passed
@jaiiarora jaiiarora deleted the fix_59954 branch January 8, 2024 14:18
@ycsin
Copy link
Member

ycsin commented Jan 18, 2024

/* zassert_not_null(getpid); */ /* not implemented */

is missed out from this PR, @jaiiarora would you be able to create a follow up PR?

@jaiiarora
Copy link
Contributor Author

Sure @ycsin

@jaiiarora
Copy link
Contributor Author

Hi @ycsin. Kindly have a look at this PR.

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.

6 participants