I want to increase the stack size of a thread created via pthread_create (). It seems like a way
int pthread_attr_setstack( pthread_attr_t *attr, void *stackaddr, size_t stacksize );
from pthread.h .
However, according to numerous online links ,
The stack should be properly aligned for use as a stack; for example, pthread_attr_setstack () may fail with [EINVAL] if (stackaddr and 0x7) is not 0.
My question is: can someone give an example of how to perform alignment? Is this (alignment) platform or implementation dependent?
Thanks in advance
abeln
source share