<div dir="ltr"><div>Is this patch pushed?<br></div>where will its test be added? <br><div>:)</div><div><br></div><div>thanks <br></div><div>- Eshan <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 13, 2020 at 1:30 AM Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---<br>
cpukit/posix/src/pthreadgetcpuclockid.c | 31 ++++++++++++++++++++++++++-----<br>
1 file changed, 26 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/cpukit/posix/src/pthreadgetcpuclockid.c b/cpukit/posix/src/pthreadgetcpuclockid.c<br>
index cd7814b..c15962e 100644<br>
--- a/cpukit/posix/src/pthreadgetcpuclockid.c<br>
+++ b/cpukit/posix/src/pthreadgetcpuclockid.c<br>
@@ -7,8 +7,10 @@<br>
<br>
/*<br>
* 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58<br>
- *<br>
- * COPYRIGHT (c) 1989-2007.<br>
+ */<br>
+<br>
+/*<br>
+ * COPYRIGHT (c) 1989-2007,2020.<br>
* On-Line Applications Research Corporation (OAR).<br>
*<br>
* The license and distribution terms for this file may be<br>
@@ -23,12 +25,31 @@<br>
#include <pthread.h><br>
#include <errno.h><br>
<br>
-#include <rtems/seterr.h><br>
+#include <rtems/score/threadimpl.h><br>
<br>
int pthread_getcpuclockid(<br>
- pthread_t pid,<br>
+ pthread_t thread,<br>
clockid_t *clock_id<br>
)<br>
{<br>
- rtems_set_errno_and_return_minus_one( ENOSYS );<br>
+ Thread_Control *the_thread;<br>
+ ISR_lock_Context lock_context;<br>
+<br>
+ if ( clock_id == NULL ) {<br>
+ return EINVAL;<br>
+ }<br>
+<br>
+ the_thread = _Thread_Get( thread, &lock_context );<br>
+<br>
+ if ( the_thread == NULL ) {<br>
+ return ESRCH;<br>
+ }<br>
+<br>
+ _Thread_State_acquire_critical( the_thread, &lock_context );<br>
+<br>
+ *clock_id = the_thread->Object.id;<br>
+<br>
+ _Thread_State_release( the_thread, &lock_context );<br>
+<br>
+ return 0;<br>
}<br>
-- <br>
1.8.3.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>