Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit


» HP STK home
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
Content starts here

critical impact:

pthread_t - incompatible data type extensions (CrCh114)

TH Impacts

Problem description

The pthread_t data type is formally defined by POSIX and the Single UNIX Specification, by HP-UX, and by Tru64 UNIX to be opaque, which means no correct or portable code may make assumptions regarding the size or structure of the type. On Tru64 UNIX, the pthread_t type is often assumed to be a pointer to a defined and semi-public structure called the Thread Environment Block (TEB).

Although most code on Tru64 UNIX should use pthread_t according to the standards, some applications and tools may dereference the TEB data to acquire information such as the stack size and location, or to gain fast "inline" access to thread-specific data values. Although this relationship has never been documented or formally supported, the current implementation is widely known and assumed. Code that depends on this relationship will not be portable to HP-UX. (Note that the TEB structure pointer is more correctly acquired by making the rduniq Alpha PAL call; this is also not portable to HP-UX.)


C/C++ Misc. Identifierspthread_t        

See also

Solution description

The pthread_t data type may be used only as an argument to pthread functions defined to accept that data type, or to application routines that will pass the value through to such a pthread function.

Any code that presumes knowledge of the size or format of a pthread_t value is neither portable nor supported on either Tru64 UNIX or HP-UX. A pthread_t value on HP-UX is not a pointer, and there is no supported structure similar to the Tru64 UNIX TEB. If your code makes assumptions about the size or structure of the pthread_t type, please review the code and determine support mechanisms to meet the code requirements.

See also

Problem summary

classifications source types OS release severity type
TH C, C++ any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.