/* src/toolbox/util.c - contains some utility functions
- Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
- C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
- E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
- J. Wenninger, Institut f. Computersprachen - TU Wien
+ Copyright (C) 1996-2005, 2006, 2008
+ CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
This file is part of CACAO.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Contact: cacao@cacaojvm.org
-
- Authors: Christian Thalinger
-
- Changes:
-
- $Id: util.c 5104 2006-07-10 17:22:18Z twisti $
-
*/
#include <errno.h>
#include <stdarg.h>
#include <unistd.h>
-#include <sys/time.h>
#include "vm/types.h"
#include "mm/memory.h"
-#include "vm/exceptions.h"
-#include "vm/stringlocal.h"
-#include "vm/vm.h"
+#include "vm/vm.hpp"
/* _Jv_getcwd ******************************************************************
/* too small buffer or a more serious problem */
if (errno != ERANGE)
- throw_cacao_exception_exit(string_java_lang_InternalError,
- strerror(errno));
+ vm_abort("getcwd failed: %s", strerror(errno));
/* double the buffer size */
}
-/* util_current_time_millis ****************************************************
-
- Return the current time in milliseconds.
-
-*******************************************************************************/
-
-s8 util_current_time_millis(void)
-{
- struct timeval tv;
- s8 result;
-
- if (gettimeofday(&tv, NULL) == -1)
- vm_abort("gettimeofday failed: %s", strerror(errno));
-
- result = (s8) tv.tv_sec;
- result *= 1000;
- result += (tv.tv_usec / 1000);
-
- return result;
-}
-
-
/*
* These are local overrides for various environment variables in Emacs.
* Please do not remove this and leave it at the end of the file, where