[PATCH v1] include sys/types.h to include defination of clockid_t
Joel Sherrill
joel at rtems.org
Thu Mar 12 20:06:01 UTC 2020
I still don't see why you need the includes. I just posted (
https://lists.rtems.org/pipermail/devel/2020-March/058176.html ) what I
think is a complete implementation of this method. It assumes that the
thread Id does not overlap the valid clockid's which I am pretty sure is
true. Then clock_gettime just needs to (1) treat CLOCK_THREAD_CPUTIME_ID as
a get execution time of executing thread. And (2) if it is a valid thread
id, then return the executing time of that thread.
There is an example program in the Linux man page for
pthread_getcpuclockid() which should work based on what I am describing
plus the code I posted.
On Thu, Mar 12, 2020 at 2:58 PM Eshan Dhawan <eshandhawan51 at gmail.com>
wrote:
> Link to the new patch :
> https://lists.rtems.org/pipermail/devel/2020-March/058174.html
>
> On Fri, Mar 13, 2020 at 1:19 AM Eshan Dhawan <eshandhawan51 at gmail.com>
> wrote:
>
>>
>>
>> On Fri, Mar 13, 2020 at 12:57 AM Joel Sherrill <joel at rtems.org> wrote:
>>
>>> Why did you need to add the include? Per
>>> https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_getcpuclockid.html,
>>> you should only have to include pthread.h and time.h to have access to the
>>> types needed.
>>>
>> I tried to access clockid_t but it wasn't included in the file so then I
>> looked for the clockid_t definition it was in sys/types.h so I included
>> that though the file also has no inclusion of time.h as well
>> I should include that and send a Patch
>>
>> --eshan
>>
>>
>>> --joel
>>>
>>> On Thu, Mar 12, 2020 at 1:22 PM Eshan Dhawan <eshandhawan51 at gmail.com>
>>> wrote:
>>>
>>>> Hello
>>>> I sent this patch a few days ago but no one reviewed it.
>>>> If someone could look into it and give feedback.
>>>>
>>>> patch link:
>>>> https://lists.rtems.org/pipermail/devel/2020-March/058044.html
>>>>
>>>> On Fri, Mar 6, 2020 at 7:50 PM Eshan dhawan <eshandhawan51 at gmail.com>
>>>> wrote:
>>>>
>>>>> ---
>>>>> cpukit/posix/src/pthreadgetcpuclockid.c | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/cpukit/posix/src/pthreadgetcpuclockid.c
>>>>> b/cpukit/posix/src/pthreadgetcpuclockid.c
>>>>> index cd7814b1a6..159a3f9791 100644
>>>>> --- a/cpukit/posix/src/pthreadgetcpuclockid.c
>>>>> +++ b/cpukit/posix/src/pthreadgetcpuclockid.c
>>>>> @@ -22,7 +22,7 @@
>>>>>
>>>>> #include <pthread.h>
>>>>> #include <errno.h>
>>>>> -
>>>>> +#include <sys/types.h>
>>>>> #include <rtems/seterr.h>
>>>>>
>>>>> int pthread_getcpuclockid(
>>>>> --
>>>>> 2.17.1
>>>>>
>>>>> _______________________________________________
>>>> 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/20200312/82d2e51c/attachment.html>
More information about the devel
mailing list