diff options
Diffstat (limited to 'libjava/posix.cc')
-rw-r--r-- | libjava/posix.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libjava/posix.cc b/libjava/posix.cc index 6b0ea8cad3c..ebff1c9ec79 100644 --- a/libjava/posix.cc +++ b/libjava/posix.cc @@ -12,12 +12,14 @@ details. */ #include "posix.h" +#include <stdlib.h> #include <errno.h> #include <signal.h> #include <jvm.h> #include <java/lang/Thread.h> #include <java/io/InterruptedIOException.h> +#include <java/util/Properties.h> #if defined (ECOS) extern "C" unsigned long long _clock (void); @@ -62,6 +64,23 @@ _Jv_platform_initialize (void) #endif } +// Set platform-specific System properties. +void +_Jv_platform_initProperties (java::util::Properties* newprops) +{ + // A convenience define. +#define SET(Prop,Val) \ + newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val)) + + SET ("file.separator", "/"); + SET ("path.separator", ":"); + SET ("line.separator", "\n"); + char *tmpdir = ::getenv("TMPDIR"); + if (! tmpdir) + tmpdir = "/tmp"; + SET ("java.io.tmpdir", tmpdir); +} + static inline void internal_gettimeofday (struct timeval *result) { |