Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Code warrior for Mac > Sigaction() and...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2191 of 2225
Post > Topic >>

Sigaction() and Undefined identifier 'siginfo_t'

by Bint <juliosity@[EMAIL PROTECTED] > May 6, 2007 at 05:51 PM

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




 1 Posts in Topic:
Sigaction() and Undefined identifier 'siginfo_t'
Bint <juliosity@[EMAIL  2007-05-06 17:51:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 4 16:46:10 CDT 2008.