mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
baremetal: ah, actually nope, it didn't work :-(
Workaround for now. Works on asserts, but not on exit 1. Some other day, maybe. https://github.com/cirosantilli/linux-kernel-module-cheat/issues/59
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
#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