Apologies for this being  more C than freebsd, but I did say OT in
the subject...

In the most basic use of an alarm, like this:

#include <stdio.h>
#include <unistd.h>
#include <signal.h>

sig_t
signal(int sig, sig_t func);

static void bzzt() {
    printf("In routine bzzt now, timer expired after 3 seconds\n");
}

main() {

    signal(SIGALRM, bzzt);
    alarm(3);
    system("/usr/bin/host -t soa 111.0.12.in-addr.arpa");
    printf("Done\n");
}

Why does the alarm go off but not interrupt the system call?  bzzt() is
executed, but the program doesn't print Done and exit for a minute plus.

Pointers to FM to RT welcome.

Thanks,

--- David



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

Reply via email to