Thanks for immediate reply Shridhar, but the documentation
says that "errno" should be set to "EINTR", and the syscall
should return -1




>From: "Shridhar Daithankar" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>CC: [EMAIL PROTECTED]
>Subject: Re: [LIH] system call
>Date: Wed, 12 Dec 2001 14:34:13 +0530
>
>
> >     #include <stdio.h>
> >     #include <errno.h>
> >     #include <signal.h>
> >
> >     void key( )
> >     {
> >     printf("Some key\n");
> >     }
> >
> >     char buff[10];
> >     int nbytes;
> >
> >     main( )
> >     {
> >
> >     signal(SIGALRM, key);
> >     alarm(5);
> >
> >     nbytes = read ( STD_IN, buff, 10 );
> >     if ( errno == EINTR )
> >             {
> >             printf("Syscall interrupted by signal\n");
> >             }
> >     .....
> >     .....
> >     } /*  End main */
>
>Heck I found that while signal does get delivered but it doesn't come out 
>of
>program unless I press a key. I tried fflushing stdin/stdout. Didn't work.
>
>But signal is caught.. No trouble there. I am using MDK8.1..
>
>  Shridhar







_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to