PROMEXEC(2spp) RISC/os Reference Manual PROMEXEC(2spp)
NAME
Prom_exec - load program image and optionally transfer con-
trol
SYNOPSIS
#include <prom/entrypt.h>
#define RVEC 0xbfc00000
int Promexec(pap)
struct promexecargs *pap;
DESCRIPTION
Prom_exec can be used to load a program image from any dev-
ice accessible to the PROM monitor. The argument, pap,
should point to a promexec_args structure. The pa_bootfile
field of this structure indicates the file to load. The
file should be specified as indicated in intro(1spp). 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 and passed as the environment to the loaded
program. If the field pa_flags is set to EXEC_NOGO, then
the program image is loaded and control is returned to the
caller.
RETURNS
Prom_exec returns -1 if the image could not be loaded and
the global integer variable, errno , is set. If you specify
the EXEC_NOGO, Prom_exec will return the entry point of the
loaded program if successful. Prom_exec will return -1 oth-
erwise and set errno.
Printed 1/6/92 Page 1