#include <oskit/exec/exec.h>int exec_load_aout(exec_read_func_t *read, exec_read_exec_func_t *read_exec, void *handle, [out] exec_info_t *info);
This function recognizes, interprets, and loads executables in the traditional Unix a.out file format. Unfortunately, there are many variants of the a.out format, even on a single processor architecture, each with similar but incompatible interpretations. Furthermore, there is no completely reliable and unambiguous way to differentiate between many of these formats: they often use the same magic numbers even though they have very different meanings. However, by using some hairy but fairly reliable heuristics, tthe OSKit's a.out loader for the x86 architecture simultaneously supports Linux, NetBSD, FreeBSD, and Mach executables, in the OMAGIC, NMAGIC, QMAGIC, and several ZMAGIC variants. Thus, at least for executables linked on one of these systems, the OSKit's loader should ``just work.'' Nevertheless, the a.out format is very outdated at best, and we strongly recommend anyone using the OSKit to use a more modern and powerful executable format such as ELF.
- read
- Specifies the metadata reader callback function, as described in Section 23.2.1.
- read_exec
- Specifies the executable data reader callback function, as described in Section 23.2.2.
- handle
- An opaque pointer value which the executable interpreter simply passes through to the callback functions.
- info
- A pointer to an exec_info structure which the executable interpreter will fill with information about the loaded executable.
Returns 0 on success, or an error code on failure. The error code may be either one of the EX_ error codes defined in exec.h, or it may be a caller-defined error code returned by one of the callback functions and passed through to the client.