[project @ 1998-04-10 10:54:14 by simonm]
[ghc-hetmet.git] / ghc / lib / std / cbits / getLock.c
similarity index 87%
rename from ghc/lib/std/cbits/getLock.lc
rename to ghc/lib/std/cbits/getLock.c
index 1ed0dbf..c2b4762 100644 (file)
@@ -1,11 +1,12 @@
-%
-% (c) The GRASP/AQUA Project, Glasgow University, 1994
-%
-\subsection[getLock.lc]{stdin/stout/stderr Runtime Support}
-
-\begin{code}
-
-#include "rtsdefs.h"
+/* 
+ * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
+ *
+ * $Id: getLock.c,v 1.1 1998/04/10 10:54:39 simonm Exp $
+ *
+ * stdin/stout/stderr Runtime Support
+ */
+
+#include "Rts.h"
 #include "stgio.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -41,9 +42,7 @@ static int readLocks = 0;
 static int writeLocks = 0;
 
 int
-lockFile(fd, exclusive)
-int fd;
-int exclusive;
+lockFile(int fd, int exclusive)
 {
     int i;
     struct stat sb;
@@ -86,8 +85,7 @@ int exclusive;
 }
 
 int
-unlockFile(fd)
-int fd;
+unlockFile(int fd)
 {
     int i, rc;
 
@@ -111,9 +109,7 @@ int fd;
 }
 
 StgInt
-getLock(fp, exclusive)
-StgForeignObj fp;
-StgInt exclusive;
+getLock(StgAddr fp, StgInt exclusive)
 {
     if (lockFile(fileno((FILE *) fp), exclusive) < 0) {
        if (errno == EBADF)
@@ -137,4 +133,3 @@ StgInt exclusive;
     return 1;
 }
 
-\end{code}