Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - possibile problem with pthread_attr_init(): (1 Item)
   
possibile problem with pthread_attr_init()  
looking at pthread_attr_init() to check for the used default guardsize 
I see that if sysconf() call is failing I implicitly get a guardsize of 0
without any error notification on return.
So using pthread_attr_init(), I allways have to check guardsize afterwards.
Is this the way it is ment to be used?
'cause checking for errno on a function that returns EOK is not the way that is valid.

thanks
/hp

	if(pagesize == 0) {
		ret = errno;
		if((pagesize = sysconf(_SC_PAGESIZE)) == -1) {
			errno = ret;
		}
	}

	attr->__guardsize = pagesize <= 0 ? 0 : pagesize;

	return EOK;