[Q] Please help me!!

GunHo Jeon ghjeon@shinbiro.com
Tue Jul 22 17:32:00 GMT 1997


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".



More information about the Cygwin mailing list