This is the mail archive of the cygwin@sources.redhat.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]

signals while reading


Hi all,

I tried the following program on my machine.
( CYGWIN_NT-5.0 1.1.4(0.26/3/2) 2000-08-03 20:53 win2k)

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

void sigfunc(int sig)
{
        fprintf(stderr, "received signal=%d\n", sig);
        exit(1);
}
main()
{
        char    rdt[8];

        signal(SIGTERM, sigfunc);
        while (1)
        {
                fprintf(stderr,"read wait -> ");
                read(0, rdt, 1);
                fprintf(stderr,"read return %d\n", errno);
                if (errno != EINTR)
                        break;
        }
}

When I kill this program, I see the following.

read wait -> read return 4
read wait -> read return 4
read wait -> read return 4
........
(inifinite loop)

Is this a expected behavior ?
Note that sigfunc() isn't called.

Regards.

Hiroshi Inoue




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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