This may be because , In linux scanf is implemented as atomic operation & in HPUX, it may not have been implemented as atomic operaration. Hope you understand what I mean by atomic ( If execute one , then execute all) Bye > -----Original Message----- > From: Ghins Mathai [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, October 14, 1999 11:24 AM > To: [EMAIL PROTECTED] > Subject: [LI] Signal behaves differently on LINUX and HPUX > > Hi, > SIGALRM interrupts the system calls in HPUX even when > signal handler is present. > When the signal is sent, the signal handler is called but the blocking > > system calls like "accept" are interrupted. > > Can somebody tell why does this happen on HPUX and > how to solve it? > regards > ------- > > PS: Following is the code when run on HPUX "scanf" is interrupted. On > Linux "scanf" will wait till user presses any key. > { Looks like commercial unices can't match Linux ;-) } > ------- > #include <stdio.h> > #include <signal.h> > > void signal_handler(int i) > { > printf("received sig alarm\n"); > signal(SIGALRM,signal_handler); > alarm(10); > return; > } > void main(void) > { > int value; > alarm(5); > signal(SIGALRM,signal_handler); > > printf("Enter the value : \n"); > scanf("%d",&value); > printf("The read value is %d\n",value); > } > --------- > > > -------------------------------------------------------------------- > The Linux India Mailing List Archives are now available. Please search > the archive at http://lists.linux-india.org/ before posting your question > to avoid repetition and save bandwidth. -------------------------------------------------------------------- The Linux India Mailing List Archives are now available. Please search the archive at http://lists.linux-india.org/ before posting your question to avoid repetition and save bandwidth.
RE: [LI] Signal behaves differently on LINUX and HPUX
Guruprasad, Mahendrakar V (IE10) Thu, 14 Oct 1999 01:30:41 -0700
- [LI] Signal behaves differently on LINUX... Ghins Mathai
- Re: [LI] Signal behaves differently... Arun Sharma
- Re: [LI] Signal behaves differe... Nitin
- Re: [LI] Signal behaves dif... Arun Sharma
- RE: [LI] Signal behaves differently... Guruprasad, Mahendrakar V (IE10)
- RE: [LI] Signal behaves differe... Ghins Mathai
- RE: [LI] Signal behaves dif... V S Sai Satish
- Re: [LI] Signal behaves dif... Rajshekar Iyer