This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Q] Please help me!!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]