* (removes -client, -server, etc.) |
* \|/
* CreateExecutionEnvironment
* (removes -d32 and -d64,
* determines desired data model,
* sets up LD_LIBRARY_PATH,
* and exec's)
* |
* --------------------------------------------
* |
* \|/
* exec child 1 incoming argv -----------------
* | |
* \|/ |
* CheckJVMType |
* (removes -client, -server, etc.) |
* | \|/
* | CreateExecutionEnvironment
* | (verifies desired data model
* | is running and acceptable
* | LD_LIBRARY_PATH;
* | no-op in child)
* |
* \|/
* TranslateDashJArgs...
* (Prepare to pass args to vm)
* |
* |
* |
* \|/
* ParseArguments
* (ignores -d32 and -d64,
* processes version options,
* creates argument list for vm,
* etc.)
*
*/
static char *SetExecname(char **argv);
static char * GetExecname();
static jboolean GetJVMPath(const char *jrepath, const char *jvmtype,
char *jvmpath, jint jvmpathsize, char * arch);
static jboolean GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative);
const char *
GetArch()
{
return LIBARCHNAME;
}
void
CreateExecutionEnvironment(int *_argcp,
char ***_argvp,
char jrepath[],
jint so_jrepath,
char jvmpath[],
jint so_jvmpath,
char **original_argv) {
/*
* First, determine if we are running the desired data model. If we
* are running the desired data model, all the error messages
* associated with calling GetJREPath, ReadKnownVMs, etc. should be
* output. However, if we are not running the desired data model,
* some of the errors should be suppressed since it is more
* informative to issue an error message based on whether or not the
* os/processor combination has dual mode capabilities.
*/
char *execname = NULL;
int original_argc = *_argcp;
jboolean jvmpathExists;
/* Compute the name of the executable */
execname = SetExecname(*_argvp);
/* Set the LD_LIBRARY_PATH environment variable, check data model
flags, and exec process, if needed */
{
char *arch = (char *)GetArch(); /* like sparc or sparcv9 */
char * jvmtype = NULL;
int argc = *_argcp;
char **argv = original_argv;
char *runpath = NULL; /* existing effective LD_LIBRARY_PATH
setting */
int running = /* What data model is being ILP32 =>
32 bit vm; LP64 => 64 bit vm */
#ifdef _LP64
64;
#else
32;
#endif
int wanted = running; /* What data mode is being
asked for? Current model is
fine unless another model
is asked for */
char* new_runpath = NULL; /* desired new LD_LIBRARY_PATH string */
=2= |