We need to do this as it has a (, ...) type, which we aren't allowed to
directly call with the FFI.
c_getpid :: IO CPid
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
-foreign import ccall unsafe "HsBase.h fcntl"
+foreign import ccall unsafe "HsBase.h fcntl_read"
c_fcntl_read :: CInt -> CInt -> IO CInt
-foreign import ccall unsafe "HsBase.h fcntl"
+foreign import ccall unsafe "HsBase.h fcntl_write"
c_fcntl_write :: CInt -> CInt -> CLong -> IO CInt
-foreign import ccall unsafe "HsBase.h fcntl"
+foreign import ccall unsafe "HsBase.h fcntl_lock"
c_fcntl_lock :: CInt -> CInt -> Ptr CFLock -> IO CInt
foreign import ccall unsafe "HsBase.h fork"
void errorBelch2(const char*s, char *t);
void debugBelch2(const char*s, char *t);
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
+
+INLINE int fcntl_read(int fd, int cmd) {
+ fcntl(fd, cmd);
+}
+INLINE int fcntl_write(int fd, int cmd, long arg) {
+ fcntl(fd, cmd, arg);
+}
+INLINE int fcntl_lock(int fd, int cmd, struct flock *lock) {
+ fcntl(fd, cmd, lock);
+}
+
+#endif
+
#endif /* __HSBASE_H__ */