diff options
| author | Tom Tromey <tromey@cygnus.com> | 2000-08-02 21:54:04 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-08-02 21:54:04 +0000 |
| commit | f536cd95fb5cfbfa54809514fd89dc55d6b8e1a4 (patch) | |
| tree | 03fe690813ad84c550ddb18c4058221d6290e55a /libjava/java/lang | |
| parent | 2d579116788c2841ace42c93fe35bef5cf263543 (diff) | |
| download | gcc-f536cd95fb5cfbfa54809514fd89dc55d6b8e1a4.zip gcc-f536cd95fb5cfbfa54809514fd89dc55d6b8e1a4.tar.gz gcc-f536cd95fb5cfbfa54809514fd89dc55d6b8e1a4.tar.bz2 | |
Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
* Makefile.am (libgcj_la_SOURCES): Added posix.cc.
* java/net/natPlainSocketImpl.cc: Include posix.h.
(accept): Use _Jv_select.
* java/net/natPlainDatagramSocketImpl.cc: Include posix.h.
(receive): Use _Jv_select.
* java/io/natFileDescriptorPosix.cc: Include posix.h.
(available): Use _Jv_select.
* java/lang/natSystem.cc: Include posix.h.
(currentTimeMillis): Use _Jv_gettimeofday.
* include/posix.h: New file.
* posix.cc: New file.
From-SVN: r35435
Diffstat (limited to 'libjava/java/lang')
| -rw-r--r-- | libjava/java/lang/natSystem.cc | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index e376ec2..2d82c89 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -11,16 +11,9 @@ details. */ #include <config.h> #include <string.h> -#include <time.h> #include <stdlib.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#endif +#include "posix.h" #ifdef HAVE_PWD_H #include <pwd.h> @@ -48,10 +41,6 @@ extern java::lang::Class SystemClass; -#if defined (ECOS) -extern "C" unsigned long long _clock (void); -#endif - void java::lang::System::setErr (java::io::PrintStream *newErr) { @@ -152,24 +141,9 @@ java::lang::System::currentTimeMillis (void) { jlong r; -#if defined (HAVE_GETTIMEOFDAY) struct timeval tv; - gettimeofday (&tv, NULL); - r = (jlong) tv.tv_sec * 1000 + tv.tv_usec / 1000; -#elif defined (HAVE_TIME) - r = time (NULL) * 1000; -#elif defined (HAVE_FTIME) - struct timeb t; - ftime (&t); - r = t.time * 1000 + t.millitm; -#elif defined (ECOS) - r = _clock(); -#else - // In the absence of any function, time remains forever fixed. - r = 23; -#endif - - return r; + _Jv_gettimeofday (&tv); + return (jlong) tv.tv_sec * 1000 + tv.tv_usec / 1000; } jint |
