Proper x86_64 mnemonics
[cacao.git] / src / toolbox / util.c
index e7123d156c5887eab2f5e81c64a08051da95d48b..82acc8ff7f517543a2999cb0fd9af244295f7f15 100644 (file)
@@ -1,9 +1,9 @@
 /* src/toolbox/util.c - contains some utility functions
 
-   Copyright (C) 1996-2005 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 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
 
    This file is part of CACAO.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
-   Contact: cacao@complang.tuwien.ac.at
+   Contact: cacao@cacaojvm.org
 
    Authors: Christian Thalinger
 
    Changes:
 
-   $Id: util.c 3216 2005-09-19 13:07:54Z 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.h"
+
 
+/* _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 +72,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 */