Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Reg. pthreads compilation. : (4 Items)
   
Reg. pthreads compilation.  
Hi All,

I am using QNX 6.4.0 version and application using pthreads, when I compile my application it give me following errors.

qnx/osixqnx.c:134: error: 'pthread_attr_t' has no member named 'flags'
qnx/osixqnx.c:135: error: 'pthread_attr_t' has no member named 'flags'
qnx/osixqnx.c:152: warning: assignment from incompatible pointer type

pthread_attr_t      Attr;

Attr.flags |= PTHREAD_MULTISIG_DISALLOW;
Attr.flags |= PTHREAD_CREATE_DETACHED;


If I see pthread_attr_t  structure in target_nto.h file flags are there in the structure.

Can anybody help me to solve this issue.

Thanks,
vinod.

Re: Reg. pthreads compilation.  
Hi Vinod,

the member name is '__flags' (with two leading underscores).

Your code should read
  Attr.__flags |= PTHREAD_MULTISIG_DISALLOW;
  Attr.__flags |= PTHREAD_CREATE_DETACHED;

Kind regards,
- Thomas
Re: Reg. pthreads compilation.  
However you should be use pthread_attr_setdetachstate() for PTHREAD_CREATE_DETACHED


Thomas Haupt wrote:
> Hi Vinod,
> 
> the member name is '__flags' (with two leading underscores).
> 
> Your code should read
>   Attr.__flags |= PTHREAD_MULTISIG_DISALLOW;
>   Attr.__flags |= PTHREAD_CREATE_DETACHED;
> 
> Kind regards,
> - Thomas
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post33635
> 

-- 
cburgess@qnx.com
Re: Reg. pthreads compilation.  
Thanks Thamus,

I have one more problem.

I am using following structure, it is defined in net/if.h.

struct ifreq        ifr;
ifr.ifr_flags = ifr.ifr_flags | IFF_PROMISC;

When I compile my application following errors displayed,

 error: storage size of 'ifr' isn't known
 error: invalid application of 'sizeof' to incomplete type 'struct ifreq'
error: 'IFF_PROMISC' undeclared (first use in this function)
 error: invalid application of 'sizeof' to incomplete type 'struct ifreq'
 error: invalid application of 'sizeof' to incomplete type 'struct ifreq'
 error: invalid application of 'sizeof' to incomplete type 'struct ifreq'

Thanks again,
vinod.