Merge from subtype.
[cacao.git] / src / toolbox / util.c
index 610e6aa955aea3cdbf084ba27ae2f064eca83924..2e26c259b6c1be35205db5583e73d469480cd6f7 100644 (file)
@@ -1,9 +1,7 @@
 /* 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 4357 2006-01-22 23:33:38Z twisti $
-
 */
 
 
+#include "config.h"
+
 #include <assert.h>
 #include <errno.h>
 #include <stdarg.h>
 #include "vm/types.h"
 
 #include "mm/memory.h"
-#include "vm/exceptions.h"
-#include "vm/stringlocal.h"
+#include "vm/vm.hpp"
+
 
+/* _Jv_getcwd ******************************************************************
 
-/* getcwd **********************************************************************
+   Return the current working directory.
 
-   XXX
+   RETURN VALUE:
+       pointer to a char array allocated by MNEW, or
+          NULL if memory could not be allocated.
 
 *******************************************************************************/
 
@@ -69,8 +64,7 @@ char *_Jv_getcwd(void)
                /* 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 */