Jonathon Hill
Jonathon Hill

Reputation: 3495

What does "pcntl_fork(): Error 12" mean?

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.

Upvotes: 5

Views: 4692

Answers (3)

console command

perror 12

"OS error code 12: Cannot allocate memory"

Upvotes: 0

Pascal MARTIN
Pascal MARTIN

Reputation: 401172

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.

Upvotes: 9

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799240

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.

Upvotes: 1

Related Questions