The basic mistake is that the variable values have not changed.
1/0 will generate a FPE no matter what you do.
use variables like a=0;b=1;
and if b/a generates an FPE,
change its value.(bit hazy how to implement this... google around)
the reason for giving you a signal handler
is obviously to help
On Mon, 2004-11-22 at 14:49, Manish Regmi wrote:
> see man kill, raise
Thank you. I got that!!
--
With regards,
Jagadeesh Bhaskar P
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel
On Mon, 22 Nov 2004 14:35:24 +0530, Jagadeesh Bhaskar P
<[EMAIL PROTECTED]> wrote:
> On Mon, 2004-11-22 at 14:27, Yogesh Bute wrote:
> > hi,
> > u need to inform the shell that the signal is handled - so u need to
> > SIG_IGN the singal ie. signal (signum, SIG_IGN) once u have done with
> > han
> How can I generate and send a signal from a function of mine? Is it
> possible from a userlevel C program, using some functions like
> signal()??
>
> Please do help
> --
> With regards,
>
> Jagadeesh Bhaskar P
>
yes,
see man kill, raise
regards manish
--
Manish Regmi
-
To unsubscribe from
On Mon, 2004-11-22 at 14:27, Yogesh Bute wrote:
> hi,
> u need to inform the shell that the signal is handled - so u need to
> SIG_IGN the singal ie. signal (signum, SIG_IGN) once u have done with
> handling the signal
> or u could send SIG_DFL, so that default singal handler will handle th
Hi Manish,
As suggested, I rewrote the C program using sigaction, as follows:
/** start of code **/
#include
#include
void fe(int x){
printf("floating pt exception:\n");
}
int main(void){
struct sigaction p;
p.sa_handler = fe;
sigaction(SIGFPE, &
On Mon, 2004-11-22 at 12:30, Manish Regmi wrote:
>
> > /*** start of code /
> >
> > #include
> > #include
> >
> > void fe(void){
> >printf("floating pt exception:\n");
> > }
> >
> > int main(void){
> >signal(SIGFPE, (void *)fe);
> >printf("%f\n", (1/0
On Mon, 22 Nov 2004 11:56:12 +0530, Jagadeesh Bhaskar P
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I wrote a the small program, to c how signals can be caught by
> customized routines.
>
> /*** start of code /
>
> #include
> #include
>
> void fe(void){
>printf("floating pt e
Hi,
I wrote a the small program, to c how signals can be caught by
customized routines.
/*** start of code /
#include
#include
void fe(void){
printf("floating pt exception:\n");
}
int main(void){
signal(SIGFPE, (void *)fe);
printf("%f\n", (1/0));