source: trunk/src/gcc/libjava/posix.cc@ 853

Last change on this file since 853 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.6 KB
Line 
1// posix.cc -- Helper functions for POSIX-flavored OSs.
2
3/* Copyright (C) 2000, 2001, 2002 Free Software Foundation
4
5 This file is part of libgcj.
6
7This software is copyrighted work licensed under the terms of the
8Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9details. */
10
11#include <config.h>
12
13#include "posix.h"
14
15#include <stdlib.h>
16#include <errno.h>
17#include <signal.h>
18
19#include <jvm.h>
20#include <java/lang/Thread.h>
21#include <java/io/InterruptedIOException.h>
22#include <java/util/Properties.h>
23
24#if defined (ECOS)
25extern "C" unsigned long long _clock (void);
26#endif
27
28// gettimeofday implementation.
29jlong
30_Jv_platform_gettimeofday ()
31{
32#if defined (HAVE_GETTIMEOFDAY)
33 timeval tv;
34 gettimeofday (&tv, NULL);
35 return (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL);
36#elif defined (HAVE_TIME)
37 return time (NULL) * 1000LL;
38#elif defined (HAVE_FTIME)
39 struct timeb t;
40 ftime (&t);
41 return (t.time * 1000LL) + t.millitm;
42#elif defined (ECOS)