2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
4 \subsection[getCurrentDirectory.lc]{getCurrentDirectory Runtime Support}
13 #define PATH_MAX MAXPATHLEN
20 getCurrentDirectory(STG_NO_ARGS)
26 if ((pwd = malloc(alloc)) == NULL) {
27 ghc_errtype = ERR_RESOURCEEXHAUSTED;
28 ghc_errstr = "not enough virtual memory";
31 while (getcwd(pwd, alloc) == NULL) {
32 if (errno == ERANGE) {
34 if ((pwd = realloc(pwd, alloc)) == NULL) {
35 ghc_errtype = ERR_RESOURCEEXHAUSTED;
36 ghc_errstr = "not enough virtual memory";
39 } else if (errno != EINTR) {