next up previous contents index
Next: 23.3.2 exec_load_elf: load a Up: 23.3 Function Reference Previous: 23.3 Function Reference

23.3.1 exec_load: detect the type of an executable file and load it

 

SYNOPSIS

#include <oskit/exec/exec.h>

int exec_load(exec_read_func_t *read, exec_read_exec_func_t *read_exec, void *handle, [out] exec_info_t *info);

DESCRIPTION

This is the primary entrypoint to the executable interpreter: it automatically detects the type of an executable file and loads it using the specified callback functions. This function simply calls, in succession, each of the format-specific executable loader functions that apply to the architecture for which the OSKit was compiled, until one succeeds or returns an error other than EX_NOT_EXECUTABLE.

PARAMETERS

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

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.



University of Utah Flux Research Group