I'm using Windows 11, WSL2, NCS 2.
I had a program crash due to using an uninitialized function<> object, and end up at _exit in libc-hooks.c
__weak void _exit(int status)
{
_write(1, "exit\n", 5);
while (1) {
;
}
}
Unfortunately this locks up the main thread and doesn't reset the whole system, which is a problem.
I tried to implement my own _exit() function, but doing so doesn't seem to override the __weak nature of the libc function.
My code looks like this:
.h file
...
extern void _exit(int status);
...
.cpp file
...
void _exit(int status)
{
// do stuff
}
...
Any thoughts on what I can do to make this work correctly?
Thanks.