0

I understand that using the above API is safe for normal x86 based desktop systems, but for embedded system using ARM or MIPs, certain not-so-oftenly-used API can get less support or buggy implementations. Is it entirely portable to include such advanced APIs in one's program?

3
  • Without taking a look at the specification and documentation of a given embedded system, you can't even be sure that it implements memcpy correctly.
    – Philipp
    Jan 27, 2014 at 15:33
  • As someone once said: there is no such thing as portable code, only code which has been ported. Look at the specific targets you're aiming for, pick what's available there. Jan 27, 2014 at 15:34
  • The excellent GNU Pth includes a technical paper (as well as ctx switch code) describing the setjmp, longjmp, sig*stack/jmp alternative. Of course, it's easier just to use pthreads on a modern, POSIX-conforming platform.
    – Brett Hale
    Jan 27, 2014 at 17:38

2 Answers 2

2

It looks like they were marked obsolete in 2004 and removed from POSIX in 2008. So depending on them to work seems ... doubtful.

0

These APIs while present are usually supported on all platforms a operating system supports. They are also a foundation of pretty much all cooperative multitasking implemenations and used extensively in various programming languages interpreters so usually get extensive testing.

These calls used to be broken in Linux some time ago, but that's a usual story. As someone else mentioned, extensive testing is a must anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.