[project @ 1998-04-10 10:54:14 by simonm]
[ghc-hetmet.git] / ghc / lib / std / cbits / setCurrentDirectory.c
1 /* 
2  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
3  *
4  * $Id: setCurrentDirectory.c,v 1.1 1998/04/10 10:54:52 simonm Exp $
5  *
6  * setCurrentDirectory Runtime Support
7  */
8
9 #include "Rts.h"
10 #include "stgio.h"
11
12 StgInt
13 setCurrentDirectory(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 }