2 .Dt REEXEC_TO_MATCH_KERNEL 3
5 .Nm reexec_to_match_kernel
6 .Nd Re-exec the current binary to match the ABI of the running kernel
12 .Fo reexec_to_match_kernel
17 .Fn reexec_to_match_kernel
18 function re-executes the current binary to match the ABI of the running kernel.
19 That is, if the current kernel is a 64-bit Intel kernel, it will attempt to
20 execute the 64-bit x86_64 userspace slice of the universal binary. The API
21 intentionally does not take arguments because its use should be transparent
22 to the program and to the user.
25 .Fn reexec_to_match_kernel
26 function returns 0 if re-execution was not required. It returns -1 and
27 sets errno if there was an error performing the re-execution, for example
28 if the binary is not universal, or does not contain a slice to match the running
29 kernel's ABI. If the function succeeds, control never returns to the caller
30 and the program starts from main() again.