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

[LibC] Implement 'clock_gettime', 'clock_settime', 'clock_getres' #116

Closed
nathanLoretan opened this issue Jan 26, 2017 · 11 comments
Closed

Comments

@nathanLoretan
Copy link

Hello, I try to use the function clock_gettime(). I define _POSIX_TIMERS and I include <time.h> but I always have the error: undefined reference to 'clock_gettime'.

@danielinux
Copy link
Contributor

Hi! In fact clock_gettime/clock_settime/clock_getres are not yet implemented in libC.

I will turn this issue in a feature request and take care of it ASAP. Meanwhile, any chance you can use gettimeofday() ?

Thanks

d

@danielinux danielinux self-assigned this Jan 27, 2017
@danielinux danielinux changed the title undefined reference to 'clock_gettime' [LibC] Implement 'clock_gettime', 'clock_settime', 'clock_getres' Jan 27, 2017
@danielinux
Copy link
Contributor

Not fixed yet for us, so better not close it @nathanLoretan

@danielinux danielinux reopened this Mar 5, 2017
@danielinux danielinux assigned brabo and unassigned danielinux Mar 7, 2017
@brabo brabo assigned danielinux and unassigned danielinux Mar 7, 2017
@brabo
Copy link
Member

brabo commented Mar 7, 2017

ok, this is next up on my frosted-calendar!

@brabo
Copy link
Member

brabo commented Mar 7, 2017

@nathanLoretan what resolution are you guys expecting clock_gettime() to have? assuming XSI-conformance or?

brabo added a commit to insane-adding-machines/frosted-headers that referenced this issue Mar 7, 2017
brabo added a commit to insane-adding-machines/frosted-headers that referenced this issue Mar 7, 2017
@nathanLoretan
Copy link
Author

nathanLoretan commented Mar 7, 2017 via email

@brabo
Copy link
Member

brabo commented Mar 7, 2017

@nathanLoretan that is a clock, not the resolution. i ask because of:
"Although the value of CLOCKS_PER_SEC is required to be 1 million on all XSI-conformant systems, it may be variable on other systems, and it should not be assumed that CLOCKS_PER_SEC is a compile-time constant"
if you assume 1 million per second, it may cause issues as our system clock resolution is only 1000/sec, i.e. millisecond resolution, and i noticed there is no clock_getres() call in uGFX to determine what resolution the system has.

@danielinux
Copy link
Contributor

@brabo we should stick with 1ms resolution for these calls anyhow

brabo added a commit to insane-adding-machines/newlib that referenced this issue Mar 8, 2017
brabo added a commit that referenced this issue Mar 8, 2017
@brabo
Copy link
Member

brabo commented Mar 8, 2017

@nathanLoretan done, closing this issue ;)

@brabo
Copy link
Member

brabo commented Mar 8, 2017

@nathanLoretan note, just include sys/time.h for now, not time.h as posix specifies.

@danielinux
Copy link
Contributor

Related to #120

@brabo
Copy link
Member

brabo commented Mar 14, 2017

time.h is there now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants