LoadProgram

Loads a binary image and spawns it as a task.

Synopsis

Item LoadProgram(char *cmdLine);

Description

This function loads an executable file from disk and launches a new task to execute the code.

You give this function a command line to interpret. The first component of the command line is taken as the name of the file to load. The entirety of the command line is passed to the new task as argc and argv in the main() function. The filename component of the command line specifies either a fully qualified pathname, or a pathname relative to the current directory.

The priority of the new task is identical to the priority of the current task. If you wish the task to have a different priority, you must use the LoadProgramPrio() function instead.

If a priority was given to the executable being launched using the modbin utility, then the priority that was specified to modbin will be used for the new task, and not the current priority.

Arguments

cmdLine
A NULL-terminated string indicating the file to load as a task. The string may also contain arguments for the task being started.

Return Value

The Item number of the newly created task, or a negative error code if the task could not be created.

Implementation

Folio call implemented in file folio V20.

Associated Files

filefunctions.h

See Also

LoadProgramPrio(), LoadCode(), ExecuteAsThread()