CodePudding user response:
Pthread_getattr_np is unique to the GNU API, not to displacement, please use the posix standard interface,Don't have direct access to pthread_attr_t structure, set and get all have the corresponding API
# include & lt; Pthread. H>
Int pthread_attr_destroy (pthread_attr_t * attr);
Int pthread_attr_init (pthread_attr_t * attr);
Int pthread_attr_getstack (const pthread_attr_t * restrict attr,
Void * * restrict stackaddr, size_t * restrict stacksize);
Int pthread_attr_setstack (pthread_attr_t * attr, void * stackaddr,
Size_t stacksize);