Is it possible to use the sigaction function in a codewarrior 9 program? I
am using some sample code from an Apple TechNote, and it gives me the error:
Undefined identifier 'siginfo_t'
I'm including <signal.h>. Will this work? The code compiles with Xcode,
but not codewarrior.
Here is the sample code:
void myHandler(sig, sip, scp)
int sig;
siginfo_t *sip;
struct ucontext *scp;
{
hexdouble t;
ppc_float_state_t *fs;
ppc_thread_state_t *ss;
fs = &scp->uc_mcontext->fs;
ss = &scp->uc_mcontext->ss;
printf("SIGFPE taken at 0x%x invokes myHandler, fpscr = %08X\n",
sip->si_addr, fs->fpscr);
/* Re-arms interrupts when this state is restored */
fs->fpscr &= FE_ENABLE_ALL_EXCEPT;
/* Advances the PC when this state is restored */
ss->srr0 += 4;
printf("fpscr = %08X\n", fs->fpscr);
}
static struct sigaction act = { myHandler, (sigset_t)0, SA_SIGINFO };
main ()
{
....
/* Set handler */
if (sigaction(SIGFPE, &act, (struct sigaction *)0) != 0) {
perror("Yikes");
exit(-1);
}
....
Thanks
B