Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 06:25:39 -0500
From:      Mike Makonnen <mtm@identd.net>
To:        julian@freebsd.org
Cc:        freebsd-current@freebsd.org
Subject:   signals still  broken ?
Message-ID:  <20030226112543.ISTQ16831.out001.verizon.net@kokeb.ambesa.net>

next in thread | raw e-mail | index | archive | help

# uname -a
FreeBSD kokeb.ambesa.net 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Tue Feb 25 16:45:54
EST 2003
mtm@kokeb.ambesa.net:/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
mtm@identd.net | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030226112543.ISTQ16831.out001.verizon.net>