summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/base/System/Posix/Internals.hs4
-rw-r--r--libraries/base/jsbits/base.js9
2 files changed, 11 insertions, 2 deletions
diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs
index 89fa80672f..244e46f496 100644
--- a/libraries/base/System/Posix/Internals.hs
+++ b/libraries/base/System/Posix/Internals.hs
@@ -139,10 +139,10 @@ ioe_unknownfiletype = IOError Nothing UnsupportedOperation "fdType"
Nothing
fdGetMode :: FD -> IO IOMode
-#if defined(mingw32_HOST_OS)
+#if defined(mingw32_HOST_OS) || defined(javascript_HOST_ARCH)
fdGetMode _ = do
-- We don't have a way of finding out which flags are set on FDs
- -- on Windows, so make a handle that thinks that anything goes.
+ -- on Windows/JS, so make a handle that thinks that anything goes.
let flags = o_RDWR
#else
fdGetMode fd = do
diff --git a/libraries/base/jsbits/base.js b/libraries/base/jsbits/base.js
index 1a2dc3495a..b9e0b84ce1 100644
--- a/libraries/base/jsbits/base.js
+++ b/libraries/base/jsbits/base.js
@@ -450,6 +450,15 @@ function h$base_c_s_isdir(mode) {
function h$base_c_s_isfifo(mode) {
return 0;
}
+function h$base_c_fcntl_read(fd,cmd) {
+ return -1;
+}
+function h$base_c_fcntl_write(fd,cmd,value) {
+ return -1;
+}
+function h$base_c_fcntl_lock(fd,cmd,ptr,ptr_o) {
+ return -1;
+}
#ifndef GHCJS_BROWSER
// The `fileStat` is filled according to the layout of Emscripten's `stat`