]> git.saurik.com Git - apple/libutil.git/blob - reexec_to_match_kernel.3
libutil-21.tar.gz
[apple/libutil.git] / reexec_to_match_kernel.3
1 .Dd Apr 14, 2008
2 .Dt REEXEC_TO_MATCH_KERNEL 3
3 .Os "Mac OS X"
4 .Sh NAME
5 .Nm reexec_to_match_kernel
6 .Nd Re-exec the current binary to match the ABI of the running kernel
7 .Sh LIBRARY
8 .Lb libutil
9 .Sh SYNOPSIS
10 .In libutil.h
11 .Ft int
12 .Fo reexec_to_match_kernel
13 .Fa "void"
14 .Fc
15 .Sh DESCRIPTION
16 The
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.
23 .Sh RETURN VALUES
24 The
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.