Hi folks,

i am having problems trying to create 2k process in a very simple style. My
environment is the following:

sioux@etosha$ sysctl kern.maxproc
kern.maxproc=10000
sioux@etosha$ ulimit -a
...
....
....
processes            2048
sioux@etosha$ ulimit -aH
...
...
...
processes             2048
$sioux@etosha$

But when i run a program to run 2000 process i got top display only 1901
zombie, why it is not showing 2000 zombie ?

The program source code is:

#include "apx.h"
#include "msc.h"

int
main(int argc, char **argv)
{
xlong p, x, n;
/* int s;*/

if (argc < 2) return 126;
if (n = 0, !scn_u(&n, argv[1])) return 127;
x = 0;

do {
p = apx_fork();
if (!p) break; /* child */
if (p == -1ul) /* fork error */
if (errno == eagain) (void)apx_poll(NULL, 0ul, 1000ul), --x;
else break;
/*(void)apx_wait(&s);*/
} while (++x < n);

if (p) if (p + 1) p = 0; else p = errno;
return p;
}

And remenber, "apx" is just an prefix.

Reply via email to