xref: /kvm-unit-tests/lib/abort.c (revision ce42dc88e4d1c60f852d8bc803d44b7f176e59a3)
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 /*
9  * When exit(code) is invoked, qemu will exit with ((code << 1) | 1),
10  * leaving us 128 exit status codes. To avoid confusion with signal
11  * status, we further limit exit codes to those resulting in qemu
12  * exiting with a status < 128. We give abort() the highest (127),
13  * leaving the lower status codes for unit tests.
14  */
15 #define ABORT_EXIT_STATUS 63	/* 127 exit status from qemu */
16 
abort(void)17 void abort(void)
18 {
19 	exit(ABORT_EXIT_STATUS);
20 }
21