#include <stdlib.h>
#include <errno.h>
#include <signal.h>
+#include <stdio.h>
#include <jvm.h>
#include <java/lang/Thread.h>
extern "C" unsigned long long _clock (void);
#endif
+#if defined(HAVE_PROC_SELF_EXE)
+static char exec_name[20];
+ // initialized in _Jv_platform_initialize()
+#endif
+
+const char *_Jv_ThisExecutable (void)
+{
+#if defined(DISABLE_MAIN_ARGS)
+ return "[Embedded App]";
+#elif defined(HAVE_PROC_SELF_EXE)
+ return exec_name;
+ // initialized in _Jv_platform_initialize()
+#else
+ return _Jv_GetSafeArg (0);
+#endif
+}
+
// gettimeofday implementation.
jlong
_Jv_platform_gettimeofday ()
#else
signal (SIGPIPE, SIG_IGN);
#endif
+
+#if defined (HAVE_PROC_SELF_EXE)
+ // Compute our executable name
+ sprintf (exec_name, "/proc/%d/exe", getpid ());
+#endif
}
// Set platform-specific System properties.