Hi,
Just like many pthread_ functions (all?), pthread_attr_setstack() returns the error code itself, it doesn't fill errno, so all statements like (conformance/interface/pthread_attr_setstack/1-1.c)
rc = pthread_attr_setstack(&attr, stack_addr, stack_size);
if (rc != 0 ) {
perror(ERROR_PREFIX "pthread_attr_setstack");
exit(PTS_UNRESOLVED);
}
should rather be
rc = pthread_attr_setstack(&attr, stack_addr, stack_size);
if (rc != 0 ) {
errno = rc;
perror(ERROR_PREFIX "pthread_attr_setstack");
exit(PTS_UNRESOLVED);
}
for displaying the correct error message.
(I guess there are plenty of such bugs throughough pthread test programs...)