1

The abort function in C is supposed to raise a SIGABRT signal. But what if the underlying platform does not support the SIGABRT signal or does not support signals at all, for example, when C is ported to some non-Posix-compliant OSes. In this case, what should the implementer do?

John Z. Li
  • 1,893
  • 2
  • 12
  • 19

1 Answers1

1

Fairly simple, in fact. In that case, the implementer of the C runtime needs to make sure that SIGABRT is delivered to signal, without help from the OS. It's purely inside a single process.

MSalters
  • 173,980
  • 10
  • 155
  • 350
  • 2
    what do you mean by "delivered to signal" if the OS does not support signals? – John Z. Li Apr 27 '22 at 12:07
  • 2
    @JohnZ.Li Function `signal` is part of the C standard library. There is no support by the OS required by the C standard. If you raise a signal, the C library has all it needs to find the callback registered with `signal` function. – Gerhardh Apr 27 '22 at 12:41