I use the function prctl
which was introduced in Linux 2.1.57.
I do the following:
// function 'prctl' is linux only and was introduced in version
#ifdef __linux__
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,57)
prctl(PR_SET_PDEATHSIG, SIGKILL);
#endif
#endif
But what happens if I run my binary in lower version of linux? Program will crash or not load?
Do I need to replace compile time checks by runtime (with utsname()->release
) or use both compile and runtime checks?
If you compile your program on modern Linux but try to run it on older one, there are 2 possibilites:
At any rate, it will not work normally.