Subject: [Q] Please help me!!
From: [email-masked] (GunHo Jeon)

22 Jul 1997 18:07:23 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-Mailer: Mozilla 3.01Gold (Win95; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

Hello

Thank you for making the GNU-WIN32 product.

I have a question.

I can not exceute following code correctly.
I think the alarm(2) function does not work successfull.
Do I have any bug?

Sincerely yours,

GunHo Jeon

STUDENT for MBA(MIS)
KOREA UNIVERSITY

----------------------------------------------------
#include        <stdio.h>
#include        <stdlib.h>
#include        <sys/types.h>
#include        <unistd.h>
#include        <signal.h>

#define PROT(x) x

void catch_alarm();

main()
{
    int i, j;

    catch_alarm();

    alarm(2);

    while(1) {
        i = i + 1;
        if ((i % 50000000) == 0)
            printf("=message=====\n");

        if (i > 100000001)
            break;
    }

    return (0);
}

void catch_alarm() {
#ifndef MSDOS
    (void)signal(SIGALRM, (void(*)PROT((int)))catch_alarm);
#endif
#ifdef OS2
    (void)signal(SIGALRM, SIG_ACK);
#endif
    printf("==> catch_alarm ==<\n");

    alarm(2);
}
------------------------------------------------------------
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".