title: ENOMEM from popen() for system(), while there is enough memory
body: <p>I have two relatively big applications(processes) running in embedded Linux on ARM with 3 RAM banks (in Linux cmdline: mem=128M mem=256M@0x90000000 mem=128M@0xA0000000).
  One application processes user commands, between which there may be request to run ordinary Linux shell command. This is implemented as:  </p>
  
  <p><code>if((fp=popen(UserCommand, "r")) == NULL) return(errno));
  fgets(ReplyString, 128, fp);
  Res = pclose(fp);</code>  </p>
  
  <p>The first line returns errno=12 - ENOMEM even for the simplest command like "pwd", although there is plenty of memory:   </p>
  
  <p><code>root@dm814x-evm:~# free
                total         used         free       shared      buffers 
    Mem:       461472        38576       422896            0          152
   Swap:            0            0            0
  Total:       461472        38576       422896</code>  </p>
  
  <p>As far as I understand there is more than 400MB of free space!<br>
  For the first test purpose I also cancelled the second process - ops!, the error has gone!!!<br>
  For the second test I run telnet and executed the command via it (while both processes were running) - no problem, works fine.  </p>
  
  <p>So, where is the catch?</p>