Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 1997 16:34:42 -0700 (PDT)
From:      Simon Shapiro <Shimon@i-Connect.Net>
To:        freebsd-hackers@freebsd.org
Subject:   What is wrong with this snipet?
Message-ID:  <XFMail.970913163442.Shimon@i-Connect.Net>

next in thread | raw e-mail | index | archive | help
Why would the following segfault on 6 of the 10 iterations?

int
main(int argc, char **argv, char **argp)
{
    int ndx;

    for ( ndx = 0; ndx < 10; ndx++ ) {
        switch ( rfork(RFPROC|RFNOWAIT|RFFDG|RFMEM) ) {
        case -1:
            (void)fprintf(stderr, "%s ERROR: Failed to fork (%s)\n",
                          argv[0], strerror(errno));
            break;
        case 0:
            return(0);
        }
    }

    return(0);   
}

---


Sincerely Yours,                               (Sent on 13-Sep-97, 16:31:40
by XF-Mail)

Simon Shapiro                                                Atlas Telecom
Senior Architect         14355 SW Allen Blvd., Suite 130 Beaverton OR 97005
Shimon@i-Connect.Net          Voice:  503.643.5559, Emergency: 503.799.2313



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.970913163442.Shimon>