On Thu, Aug 11, 2016 at 1:01 PM, Friedrich Locke
<friedrich.lo...@gmail.com> wrote:
> i am having problems trying to create 2k process in a very simple style. My
> environment is the following:
...
> 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;

So fork could be failing but you don't bother to actually report the
error?  You prefer to *guess* about the situation?

xlong for everything with comparison of pids to -1ul?  Is this an
entry in the obfuscated C contest?

No dmesg; plonk.


Philip Guenther

Reply via email to