<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 微软雅黑; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><div>>> But, this test just checks the return value, not the value of elements</div><div>>> in pthread_attr_t structure. When I tried to print out these values,</div><div>>> the same result as before appeared, all 0...</div><div> </div><div>> It would be good to check the expected values with test assertions.</div><div><br></div><div>The return value of pthread_getattr_np is correct, I double checked it. But the values of element in attr structure are not correct, like stack_addr and stack_size.</div><div><br></div><div>>></div><div>>> So, how can I modify the source code in rtems to let this function</div><div>>> work? Thanks a lot.</div><div> </div><div>> You have to edit:</div><div> </div><div>> cpukit/posix/src/pthreadgetattrnp.c</div></div>
<div><br></div><div>Yes, I know this. I just do not know how to do this. The implementation of pthread_getattr_np of 4.11 and 4.12 are different, I just do not know where do I start from...</div><div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>Best wishes,</div><div>xuelin.tian@qkmtech.com</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:sebastian.huber@embedded-brains.de">Sebastian Huber</a></div><div><b>Date:</b> 2017-09-22 16:33</div><div><b>To:</b> <a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a>; <a href="mailto:users@rtems.org">users@rtems.org</a></div><div><b>Subject:</b> Re: pthread_getattr_np does not work</div></div></div><div><div>On 22/09/17 10:24, xuelin.tian@qkmtech.com wrote:</div>
<div> </div>
<div>> I found out that there is a test in 4.12-master about </div>
<div>> pthread_getattr_np, so I compiled that one and ran it.</div>
<div>></div>
<div>> The result shows that this function works well, like this</div>
<div>> *************************************************************************</div>
<div>> *** BEGIN OF TEST PSXGETATTRNP 1 ***</div>
<div>> Init - pthread_getattr_np - attr NULL - EINVAL</div>
<div>> Init - pthread_getattr_np - invalid id - ESRCH</div>
<div>> Init - pthread_attr_init</div>
<div>> Init - pthread_attr_setinheritsched - PTHREAD_EXPLICIT_SCHED</div>
<div>> Init - pthread_attr_setschedpolicy to SCHED_RR</div>
<div>> Init - pthread_attr_setschedparam to minimum priority + 2</div>
<div>> Init - pthread_attr_getstack</div>
<div>> Init - pthread_attr_setstack double the stacksize</div>
<div>> Init - pthread_attr_getguardsize</div>
<div>> Init - pthread_attr_setguardsize double the guardsizecreate</div>
<div>> Init - Lower pri</div>
<div>> Init - raise priority to max</div>
<div>> Init - pthread_ority</div>
<div>> Thread - pthread_getattr_np - Verify value</div>
<div>> Thread - pthread_setschedparam: Setting highest priority SCHED_FIFO</div>
<div>> Thread - Detach</div>
<div>> Thread - pthread_getattr_np</div>
<div>> Thread - Verify SCHED_FIFO policy</div>
<div>> Thread - Verify max priority</div>
<div>> Thread - Verify detached</div>
<div>> *** END OF</div>
<div>> *************************************************************************</div>
<div>></div>
<div>> But, this test just checks the return value, not the value of elements </div>
<div>> in pthread_attr_t structure. When I tried to print out these values, </div>
<div>> the same result as before appeared, all 0...</div>
<div> </div>
<div>It would be good to check the expected values with test assertions.</div>
<div> </div>
<div>></div>
<div>> So, how can I modify the source code in rtems to let this function </div>
<div>> work? Thanks a lot.</div>
<div> </div>
<div>You have to edit:</div>
<div> </div>
<div>cpukit/posix/src/pthreadgetattrnp.c</div>
<div> </div>
<div>-- </div>
<div>Sebastian Huber, embedded brains GmbH</div>
<div> </div>
<div>Address : Dornierstr. 4, D-82178 Puchheim, Germany</div>
<div>Phone : +49 89 189 47 41-16</div>
<div>Fax : +49 89 189 47 41-09</div>
<div>E-Mail : sebastian.huber@embedded-brains.de</div>
<div>PGP : Public key available on request.</div>
<div> </div>
<div>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.</div>
</div></blockquote>
</body></html>