Implementation of pthread_getcpuclockid()

Joel Sherrill joel at rtems.org
Sat Mar 7 18:02:19 UTC 2020


On Sat, Mar 7, 2020, 8:30 AM Eshan Dhawan <eshandhawan51 at gmail.com> wrote:

> Pthread_getcpuclockid() is defined in time.h but its implementation in
> RTEMS returns error
>
> I went through FreeBSD and NetBSD implementations of the same
> they call pthread_getcpuclockid2() function
> but I couldn't find anything related to this in rtems
> so how could we implement pthread_getcpuclockid()?
>

My understanding is that this clock should return the execution time
consumed for the thread. I suspect that returning the thread id for this
cpu clock id will work. In clock_gettime, check for the hard coded clock
IDs, then look this up as a thread id and if it is valid, return the cpu
time used.

You can't set this IMO but check the POSIX standard.


> Thanks
> -Eshan
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200307/592f1182/attachment.html>


More information about the devel mailing list