source: branches/libc-0.6/src/gcc/libjava/posix.cc@ 2813

Last change on this file since 2813 was 1392, checked in by bird, 22 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.1 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#include <stdio.h>
19
20#include <jvm.h>
21#include <java/lang/Thread.h>
22#include <java/io/InterruptedIOException.h>
23#include <java/util/Properties.h>
24
25#if defined (ECOS)
26extern "C" unsigned long long _clock (void);
27#endif
28
29#if defined(HAVE_PROC_SELF_EXE)
30static char exec_name[20];
31 // initialized in _Jv_platform_initialize()
32#endif
33
34const char *_Jv_ThisExecutable (void)
35{
36#if defined(DISABLE_MAIN_ARGS)
37 return "[Embedded App]";
38#elif defined(HAVE_PROC_SELF_EXE)
39 return exec_name;
40 // initialized in _Jv_platform_initialize()
41#else
42 return _Jv_GetSafeArg (0);
43#endif
44}
45
46// gettimeofday implementation.
47jlong
48_Jv_platform_gettimeofday ()
49{
50#if defined (HAVE_GETTIMEOFDAY)
51 timeval tv;
52 gettimeofday (&tv, NULL);
53 return (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000LL);