prom_exec − load program image and optionally transfer control
#include <prom/entrypt.h>
prom_exec(pap)
struct promexec_args *pap;
may be used to load a program image from any device accessable to the
prom monitor. The argument,
should point to a promexec_args structure. The field, pa_bootfile,
of this structure indicates the file to load, the file should be
specified as indicated in
The field, pa_argv, should contain a pointer to a null-terminated
array of character pointers pointing to null terminated strings.
The strings will be copied and passed as arguments to the loaded
program.
The field, pa_argc, should contain the number of strings in pa_argv.
The field, pa_environ, should contain a pointer to a null-terminated
array of character pointers pointing to null terminated strings.
The strings will be copied an passed as the environment to the loaded
program.
If the field, pa_flags, is set to EXEC_NOGO the program image will be
loaded but control will be returned to the caller.
will return -1 if the image could not
be loaded. The global integer variable, errno, will be set.
If the EXEC_NOGO flag is specified, prom_exec will return the entry
point of the loaded program if successful, prom_exec will return
-1 otherwise and set errno.