abort.c 609 B

1234567891011121314151617181920
  1. /*
  2. * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
  3. *
  4. * This work is licensed under the terms of the GNU LGPL, version 2.
  5. */
  6. #include "libcflat.h"
  7. /*
  8. * When exit(code) is invoked, qemu will exit with ((code << 1) | 1),
  9. * leaving us 128 exit status codes. To avoid confusion with signal
  10. * status, we further limit exit codes to those resulting in qemu
  11. * exiting with a status < 128. We give abort() the highest (127),
  12. * leaving the lower status codes for unit tests.
  13. */
  14. #define ABORT_EXIT_STATUS 63 /* 127 exit status from qemu */
  15. void abort(void)
  16. {
  17. exit(ABORT_EXIT_STATUS);
  18. }