Hans-Peter Reichert
|
possibile problem with pthread_attr_init()
|
Hans-Peter Reichert
02/17/2010 2:40 AM
post47475
|
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;
|
|
|