What is the most violent way that an application can terminate itself (Linux)
23:34 18 May 2009

I'd like to emulate violent system shutdown, i.e., to get as close as possible to power outage on an application level. We are talking about C/C++ application on Linux. I need the application to terminate itself.

Currently, I see several options:

  1. call exit()
  2. call _exit()
  3. call abort()
  4. do division by zero or dereference NULL.
  5. other options?

What is the best choice?

It is partly a duplicate of this question.

c++ c linux operating-system