[Mono-list] help needed

Dietmar Maurer dietmar@ximian.com
23 Nov 2001 17:31:57 +0100


Can someone tell me why the following program ends in an endless loop?
How can I avoid that?

- Dietmar


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

static void
fp_signal_handler (int sig, siginfo_t *si, struct sigcontext *ctx)
{
	printf ("TEST %d %p %p\n", si->si_code, si->si_addr, ctx->eip);

	return;
}

int
main ()
{
	int a = 5, b = 0;
	struct sigaction sa, sao;

	sa.sa_sigaction = fp_signal_handler;
	sigemptyset (&sa.sa_mask);
	sa.sa_flags = SA_SIGINFO;
	sigaction (SIGFPE, &sa, NULL);
	
	return a/b;
}