Krishna Nair
Krishna Nair

Reputation: 1

What does a hard limit of -1 mean (getrlimit for RLIMIT_STACK)?

I see a segfault with a multi threaded application and want to play around with the resource limits. However when I try to get current stack limit using the code below, I see that the hard limit is -1. What does that mean? How do I fix it?

// Get old limits if( getrlimit(RLIMIT_STACK, &old_lim) == 0) printf("Old limits -> soft limit= %ld hard limit= %ld \n", old_lim.rlim_curold_lim.rlim_max); else fprintf(stderr, "%s\n", strerror(errno));

Upvotes: 0

Views: 76

Answers (1)

Jim Cownie
Jim Cownie

Reputation: 2859

Google points us to the man page which can be found here: https://man7.org/linux/man-pages/man2/getrlimit.2.html

Upvotes: 0

Related Questions