Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams sigsetjmp(jbuf[0],1); (jbuf[0]->__jmpbuf)[JB_SP] = translate_address(sp);<----ERROR (jbuf[0]->__jmpbuf)[JB_PC] = translate_address(pc);<----ERROR sigemptyset(&jbuf[0]->__saved_mask);<----ERROR sp = (address_t)stack2 + STACK_SIZE - sizeof(address_t); pc = (address_t)g; sigsetjmp(jbuf[1],1); (jbuf[1]->__jmpbuf)[JB_SP] = translate_address(sp);<----ERROR (jbuf[1]->__jmpbuf)[JB_PC] = translate_address(pc);<----ERROR sigemptyset(&jbuf[1]->__saved_mask);<----ERROR

Any idea of what this error means?

If you're thinking it is safe and/or portable to mess with the stack pointer (SP) or program counter (PC) like that, you need to think again. Jonathan Leffler Apr 26, 2012 at 15:46

The type of a sigjmp_buf (which is what sigsetjmp() takes as a first parameter) is opaque — it's not what your code is expecting it to be in this case. Apparently, it's a simple int here, not a pointer to a struct.

If you want to muck around with the internals of the sigjmp_buf , you'll need to look into how it's implemented on that particular platform (and obviously the code will not be portable).

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .