[project @ 1998-11-26 09:17:22 by sof]
[ghc-hetmet.git] / ghc / lib / std / cbits / setCurrentDirectory.lc
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
3 %
4 \subsection[setCurrentDirectory.lc]{setCurrentDirectory Runtime Support}
5
6 \begin{code}
7
8 #include "rtsdefs.h"
9 #include "stgio.h"
10
11 StgInt
12 setCurrentDirectory(path)
13 StgByteArray path;
14 {
15     while (chdir(path) != 0) {
16         if (errno != EINTR) {
17             cvtErrno();
18             stdErrno();
19             return -1;
20         }
21     }
22     return 0;
23 }
24
25 \end{code}