# uname -a
FreeBSD kokeb.ambesa.net 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Tue Feb 25 16:45:54
EST 2003
[EMAIL PROTECTED]:/daemon/build/current/obj/daemon/build/current/src/sys/QUARK  i386

The following program is stuck in pause(3) forever. I have reproduced the bug in
5.0-RELEASE, but 4.7-STABLE behaves as expected: the child resumes upon
receiving SIGCONT.


#include <err.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/resource.h>

static void
cont_handler()
{ ; }
int main()
{
        int child, status;
        if (signal(SIGCONT, cont_handler) == SIG_ERR)
                err(1, "signal()");
        if ((child = fork()) == 0) {
                pause();
                exit(0);
        } else if (child == -1)
                err(1, "fork()");
        printf("sleeping 3s\n");
        sleep(3);
        if (kill(child, SIGCONT) == -1)
                err(1, "kill()");
        printf("waiting\n");
        if ((child = wait(status)) == -1)
                err(1, "wait()");
        printf("done\n");
        return (0);
}

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
[EMAIL PROTECTED] | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to