mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
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
22 lines
337 B
C
22 lines
337 B
C
#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();
|
|
}
|