Qt Code:
  1. #include <stdio.h>
  2. #include <sys/resource.h>
  3.  
  4. int main(int , char *[])
  5. {
  6. struct rlimit rlim;
  7. getrlimit(RLIMIT_STACK, &rlim);
  8. printf("max stack size=%d bytes\n", (int)rlim.rlim_cur);
  9. }
To copy to clipboard, switch view to plain text mode 

This prints

max stack size=8388608 bytes

on my machine. One learns something every day!