Hello!

On Thu, Mar 16, 2000 at 04:48:02PM -0700, Alastair Reid wrote:

> More through testing of my quick fix (ie trying bigger examples)
> revealed that my "trap '' 26" hack failed about 1% of the time.

> This being too often (approximately once per program run!)
> I hacked up fptools/ghc/lib/std/cbits/system.c by adding this code

>     case 0:
>       /* the child */
> #ifdef ADR_HACK 
>         block_vtalrm_signal(); /* from rts/ITimer.c */
> #endif
>       execl("/bin/sh", "sh", "-c", cmd, NULL);
>       _exit(127);
>     }

Better turn off the itimers copletely in the child:

        struct timeval tv_null = { 0, 0 };
        struct itimerval itv;
        itv.it_interval = tv_null;
        itv.it_value = tv_null;
        setitimer(ITIMER_REAL, &itv, NULL);
        setitimer(ITIMER_VIRTUAL, &itv, NULL);
        setitimer(ITIMER_PROF, &itv, NULL);

> [...]

Regards, Hannah.

Reply via email to