From: ghjeon@shinbiro.com (GunHo Jeon)
Subject: [Q] Please help me!!
22 Jul 1997 18:07:23 -0700
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <33D55159.596C.cygnus.gnu-win32@shinbiro.com>
Reply-To: ghjeon@shinbiro.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-Mailer: Mozilla 3.01Gold (Win95; I)
Original-To: gnu-win32@cygnus.com
Original-Sender: owner-gnu-win32@cygnus.com

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
"gnu-win32-request@cygnus.com" with one line of text: "help".
