Apologies if this has been asked before, but,
My program is failing with an ENOMEM from pthread_create(). Before
unning my program I can issue 'ulimit -s unlimited' to increase the
stack size and my program will work.
Prior to increasing the stack size I issue ulimit -a and I notice that
my default stack size is 8192.
Now, I see that include/linux/resource.h has:
#define _STK_LIM (8*1024*1024).
So, I change this to (64*1024*1024) and recompile the kernel. After a
reboot I see that ulimit -a shows 65536.
Now, I run my program again, and I still get ENOMEM response from
My embedded system has 64M of RAM !!!
So, why does 'ulimit -s unlimited' work and hacking resource.h not
What am I missing?
Also, the secondary question here is? Is hacking the kernel like this
an acceptable approach? Or should I add the ulimit -s command to a
setup file somewhere?