mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
baremetal: get exit status working with on_exit :-)
This commit is contained in:
@@ -1,21 +1,5 @@
|
||||
#include <lkmc.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void atexit_cb(void) {
|
||||
puts("atexit");
|
||||
}
|
||||
|
||||
void onexit_cb(int status, void *arg) {
|
||||
printf("status %d\n", status);
|
||||
}
|
||||
|
||||
void __attribute__ ((constructor)) premain() {
|
||||
printf("premain2()\n");
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
atexit(atexit_cb);
|
||||
on_exit(onexit_cb, NULL);
|
||||
lkmc_assert_fail();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user