* src/toolbox/util.c (_Jv_getcwd): Moved convenience function to os wrapper.
[cacao.git] / src / toolbox / util.c
index 4adb970f5f00d0c0ffa97d1a37f8d8a6a13eedb0..fc5a1c4b3696038f631ab257d1740abe72688c1b 100644 (file)
 #include "vm/vm.hpp"
 
 
-/* _Jv_getcwd ******************************************************************
-
-   Return the current working directory.
-
-   RETURN VALUE:
-       pointer to a char array allocated by MNEW, or
-          NULL if memory could not be allocated.
-
-*******************************************************************************/
-
-char *_Jv_getcwd(void)
-{
-       char *buf;
-       s4    size;
-
-       size = 1024;
-
-       buf = MNEW(char, size);
-
-       while (buf) {
-               if (getcwd(buf, size) != NULL)
-                       return buf;
-
-               MFREE(buf, char, size);
-
-               /* too small buffer or a more serious problem */
-
-               if (errno != ERANGE)
-                       vm_abort("getcwd failed: %s", strerror(errno));
-
-               /* double the buffer size */
-
-               size *= 2;
-
-               buf = MNEW(char, size);
-       }
-
-       return NULL;
-}
-
-
 /* get_variable_message_length *************************************************
 
    This function simluates the print of a variable message and