tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PTHREAD_STACK_MIN



On Fri, Aug 15, 2014 at 08:37:14AM +0100, Patrick Welche wrote:
> On Fri, Aug 15, 2014 at 01:48:55AM +0200, Joerg Sonnenberger wrote:
> > On Fri, Aug 15, 2014 at 12:30:40AM +0100, Patrick Welche wrote:
> > > and pthread_attr_setstacksize returns EINVAL if
> > > stacksize > _SC_THREAD_STACK_MIN (=59) as per /usr/include/sys/unistd.h.
> > 
> > No, it returns EINVAL if stacksize < sysconf(_SC_THREAD_STACK_MIN).
> > Small difference. We map that to getpagesize(), but that's not a fixed
> > value on some platforms.
> 
> I thought "59 is rather small"...
> 
> So it sounds as though it is safe to use sysconf(_SC_THREAD_STACK_MIN)
> instead of PTHREAD_STACK_MIN ? (They are meant to achieve the same thing?)

Yes, it should be safe to use it. The main difference is that
PTHREAD_STACK_MIN must be a compile time constant.

Joerg


Home | Main Index | Thread Index | Old Index