Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sigaction() and Undefined identifier 'siginfo_t'

 
   Macintosh computer (Home) -> Programmer Code RSS
Next:  Download from the server  
Author Message
Bint1

External


Since: Sep 16, 2003
Posts: 39



(Msg. 1) Posted: Sun May 06, 2007 5:51 pm
Post subject: Sigaction() and Undefined identifier 'siginfo_t'
Archived from groups: comp>sys>mac>programmer>codewarrior (more info?)

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

 >> Stay informed about: Sigaction() and Undefined identifier 'siginfo_t' 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
undefined identifiers - Im compiling a windows dll that contains .c and .cpp files. I have C99 extensions on and im forcing C++ compiling. Im getting undefined functions for most of the math functions im using such as sqrt, atan, acos, etc, ... How can i use these function....

Undefined identifier 'task_name_t'? - Hello, I updated Xcode over the weekend, and now my Codewarrior 9 project doesn't compile!? I think maybe Xcode changed gcc or something that Codewarrior uses? I am getting these errors--do they look familiar? Error : undefined identifier..

Ridiculous Error: undefined identifier 'std' - Hello. I get the following ridiculous error when compiling with a third-party C++ library in CW 8 to a Mach-O target: Error : undefined identifier 'std' (included from: localeimp:18 istream:147 niostream:17 iostream:33 ..

iSight and unique Firewire Identifiers - Hello All, I just scored a pair of iSight cameras, and looking via Dam Busters at their configurations, I notice that they do NOT seem to have unique FireWire identifiers with them. ALL their parameters were identical except current bus device info. Do...

How to avoid function names and identifiers in my executab.. - I'm using CW8 and having a weird problem: I noticed that even in the Release version of the execuables I build, names of my functions and other identifiers show up (watching with a Hex editor). I really wonder why, because once compiled & linked, the...
   Macintosh computer (Home) -> Programmer Code All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]