I'm running a program with multiple forks based on entered number for an assignment and I would like to get the number of processes that the system will let me create prior to forking so I can print and error message and stop the program rather than trying to fork my way through until -1.
Is there a way to do this in C?