Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sigaction() and Undefined identifier 'siginfo_t'

 
   Mac (Home) -> Programmer Code RSS
Next:  How to call a shell command  
Author Message
Bint

External


Since: May 30, 2005
Posts: 13



(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
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Bug in alloc.c? - I'm getting an infinite loop in alloc.c, which is located in MSL/MSL_C/MSL_Common/Src. This is with CW 9.5. The function is allocate_from_var_pools. There is a do/while loop that searches for a block with the required size to allocate a block of..

Multiply defined symbol: .bss - Hi, when trying to build a dll for Windows using CW9 on MacOS, I get an error message like: Link Error : Multiply defined symbol: .bss in files file1.cpp, file2.cpp The same message with the same filenames is repeated several times, but....

Where next? - Hi folks, All of my recent Mac coding has been Carbon C++, mostly using PowerPlant as a framework. As most of my clients are moving to X and CW's future is, shall we say, uncertain I'm wondering where to look for my future coding setup. I've dabbled....

Does mwcc work on Tiger? - Anybody using the comand line compilers on 10.4? When saving the following simple program as /tmp/x.cpp: int main() { double x = 0.5; return 0; } and trying to compile it with $ mwcc -c /tmp/x.cpp , I get the error message Error :....

Console app "file" selector - Hello, I feel like I've asked this before, but I did a search on the archives and came up short. I've got a console std c app that I'm compiling with CW. When it runs, it pops up a little menu where I can type in some command line arguments (for..
       Mac (Home) -> Programmer Code All times are: Pacific Time (US & Canada) (change)
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
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact