pthread_t - incompatible data type extensions (CrCh114)
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.)
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.
||any HP-UX 11i version