views:

160

answers:

2

I've searched until I was blue in the face and cannot find the answer to this question.

Where I can find a table listing the meanings of all the error codes for pcntl_fork()? Or even the C fork() function, for that matter.

+2  A: 

The man page for the function describes the possible errors in the ERRORS section. The mapping between error name and number can be found in /usr/include/asm-generic/errno*.h, or via perror if you have MySQL installed.

Ignacio Vazquez-Abrams
+1  A: 

It seems the 12 error code indicates there was not enough memory to fork.

See this post, for instance (quoting) :

I've had this when
(1) I've run out of memory, and
(2) when the pid table is full. In the latter case a rogue program was constantly forked child processes & not picking-up the message when they die. The result was >200 zombies.

Pascal MARTIN