pthread_getattr_np does not work

xuelin.tian xuelin.tian at
Sat Sep 23 02:26:11 UTC 2017

Thanks so much for your test. 
The parts of this structure I care about most are the stackaddr and stacksize (and guardsize maybe), where stackaddr always returns 0. The value of stacksize is either 8192 or 0, based on the fact that this attribute structure is retrieved from POSIX_Init or other pthreads in my system (maybe I use pthread_create in a wrong way...). 

So, from the result you post, the stackaddr is 0 too, which means this element is not supported in rtems, or there is something wrong with this function?
------------------ Original ------------------
From:  "Joel Sherrill"<joel at>;
Date:  Fri, Sep 22, 2017 10:15 PM
To:  "xuelin.tian at"<xuelin.tian at>; 
Cc:  "Sebastian Huber"<sebastian.huber at>; "users at"<users at>; 
Subject:  Re: Re: pthread_getattr_np does not work

The test does verify the values. I don't see a specific case of creating a threadwith a non-standard stack value and verifying that value in the task but the
test creates a thread which retrieves its values and verifies many (most, all?)
of them:

Thread - pthread_getattr_np - Verify value
46        sc = pthread_getattr_np( Thread_id, &attr );
47        rtems_test_assert( sc == 0 );
52        puts( "Thread - pthread_setschedparam: Setting highest priority SCHED_FIFO" );
(gdb) p attr
$1 = {is_initialized = 1, stackaddr = 0x0, stacksize = 8192, 
  contentionscope = 0, inheritsched = 2, schedpolicy = 2, schedparam = {
    sched_priority = 3, sched_ss_low_priority = 285216961, 
    sched_ss_repl_period = {tv_sec = 0, tv_nsec = 16}, 
    sched_ss_init_budget = {tv_sec = 0, tv_nsec = 1}, sched_ss_max_repl = 0}, 
  guardsize = 0, cputime_clock_allowed = 1, detachstate = 1, 
  affinitysetsize = 0, affinityset = 0x0, affinitysetpreallocated = {
    __bits = {0}}}

Clearly the attribute structure returned is not all zero.

I am not sure what you are seeing but it doesn't match what I see in
this test on the erc32.


On Fri, Sep 22, 2017 at 4:04 AM, xuelin.tian at <xuelin.tian at> wrote:
 OK, no problem, thanks anyway.

 Best wishes,
xuelin.tian at

From: Sebastian Huber
Date: 2017-09-22 16:58
To: xuelin.tian at; users at
Subject: Re: pthread_getattr_np does not work

On 22/09/17 10:55, xuelin.tian at wrote:
 > OK, I will try to do some fix on this function. And if Sherrill and 
 > you have time, please take some time on this. Thanks a lot.
 No, sorry. I have no time to fix this.
 Sebastian Huber, embedded brains GmbH
 Address : Dornierstr. 4, D-82178 Puchheim, Germany
 Phone   : +49 89 189 47 41-16
 Fax     : +49 89 189 47 41-09
 E-Mail  : sebastian.huber at
 PGP     : Public key available on request.
 Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

 users mailing list
 users at


             自动判断 中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语      自动选择 中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语     有道翻译 百度翻译 必应翻译 谷歌翻译 谷歌翻译(国内)   翻译    朗读 复制     正在查询,请稍候……    重试      朗读 复制        复制      朗读 复制      via    译
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list