2 * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
4 * $Id: getCurrentDirectory.c,v 1.1 1998/04/10 10:54:37 simonm Exp $
6 * getCurrentDirectory Runtime Support
14 #define PATH_MAX MAXPATHLEN
21 getCurrentDirectory(void)
27 if ((pwd = malloc(alloc)) == NULL) {
28 ghc_errtype = ERR_RESOURCEEXHAUSTED;
29 ghc_errstr = "not enough virtual memory";
32 while (getcwd(pwd, alloc) == NULL) {
33 if (errno == ERANGE) {
35 if ((pwd = realloc(pwd, alloc)) == NULL) {
36 ghc_errtype = ERR_RESOURCEEXHAUSTED;
37 ghc_errstr = "not enough virtual memory";
40 } else if (errno != EINTR) {