title: Cannot fork, even with unlimited ulimit
body: <p>While executing a shell script in ksh I'm getting the following error:</p>
  
  <blockquote>
    <p>myscript.sh[13]: cannot fork - try again</p>
  </blockquote>
  
  <p>I thought I ran out of processes, but <code>ulimit -a</code> returns this:</p>
  
  <pre><code># ulimit -a
  time(cpu-seconds)    unlimited
  file(blocks)         unlimited
  coredump(blocks)     unlimited
  data(kbytes)         unlimited
  stack(kbytes)        unlimited
  lockedmem(kbytes)    unlimited
  memory(kbytes)       unlimited
  nofiles(descriptors) 1000
  processes            unlimited
  vmemory(kbytes)      unlimited
  </code></pre>
  
  <p>This is my script, which sends an IPC message to another device through /dev/ipc/ch2:</p>
  
  <pre><code>#!/bin/sh
  
  TIMEOUT=40
  
  echo "Petting watchdog for $TIMEOUT seconds..."
  
  c=1
  while [[ $c -le $TIMEOUT ]]; do
  #   echo "Petting $c"
      sleep 1
      echo -n "\001\002\003\004" &gt; /dev/ipc/ch2
      (( c++ ))
  done
  
  echo "Done petting dog..."
  </code></pre>
  
  <p>What could it be?, I don't see why forking gets restricted suddenly.</p>