1 /*
   2  * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 /*
  26  * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
  27  * search "GAMMA" for gamma specific changes.
  28  */
  29 
  30 #ifndef JAVA_MD_H
  31 #define JAVA_MD_H
  32 
  33 #include <limits.h>
  34 #include <unistd.h>
  35 #include <sys/param.h>
  36 #ifndef GAMMA
  37 #include "manifest_info.h"
  38 #endif
  39 
  40 #define PATH_SEPARATOR          ':'
  41 #define FILESEP                 "/"
  42 #define FILE_SEPARATOR          '/'
  43 #ifndef MAXNAMELEN
  44 #define MAXNAMELEN              PATH_MAX
  45 #endif
  46 
  47 #ifdef JAVA_ARGS
  48 /*
  49  * ApplicationHome is prepended to each of these entries; the resulting
  50  * strings are concatenated (separated by PATH_SEPARATOR) and used as the
  51  * value of -cp option to the launcher.
  52  */
  53 #ifndef APP_CLASSPATH
  54 #define APP_CLASSPATH        { "/lib/tools.jar", "/classes" }
  55 #endif
  56 #endif
  57 
  58 #ifdef HAVE_GETHRTIME
  59 /*
  60  * Support for doing cheap, accurate interval timing.
  61  */
  62 #include <sys/time.h>
  63 #define CounterGet()              (gethrtime()/1000)
  64 #define Counter2Micros(counts)    (counts)
  65 #else
  66 #define CounterGet()              (0)
  67 #define Counter2Micros(counts)    (1)
  68 #endif /* HAVE_GETHRTIME */
  69 
  70 /*
  71  * Function prototypes.
  72  */
  73 #ifndef GAMMA
  74 char *LocateJRE(manifest_info* info);
  75 void ExecJRE(char *jre, char **argv);
  76 #endif
  77 int UnsetEnv(char *name);
  78 
  79 #endif