Avoid non-portable signal(SIGCHLD, SIG_IGN)

Alexandre Julliard julliard at winehq.com
Sun Apr 13 12:42:35 CDT 2003


Joerg Wunsch <j at uriah.heep.sax.de> writes:

> #include <signal.h>
> #include <unistd.h>
> #include <stdlib.h>
> 
> void
> createchild(void)
> {
>         if (fork() == 0) {
>                 exit(0);
>         }
> }
> 
> int
> main(void)
> {
>         createchild();
>         createchild();
>         createchild();
>         sleep(1);
>         system("ps");
>         sleep(2);
>         return 0;
> }
> ...
> 
> Of course, now that i see that SUSP indeed standardized this oddness,
> i might change my opinion.  Anyway, as demonstrated above,
> signal(SIGCHLD, SIG_IGN) doesn't work on FreeBSD the way you would
> expect it to work.

Well, if you really tested with the program above then it doesn't
demonstrate anything, since you don't set the SIGCHLD handler <g>

-- 
Alexandre Julliard
julliard at winehq.com



More information about the wine-devel mailing list