<commit_before>diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Files/Common.hsc boot/pkg/unix/System/Posix/Files/Common.hsc
--- upstream/pkg/unix/System/Posix/Files/Common.hsc	2001-09-09 13:46:40.000000000 +1200
+++ boot/pkg/unix/System/Posix/Files/Common.hsc	2021-06-10 20:42:21.000000000 +1200
@@ -520,7 +520,7 @@
 -- Note: calls @ftruncate@.
 setFdSize :: Fd -> FileOffset -> IO ()
 setFdSize (Fd fd) off =
-  throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd off)
+  throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd (fromIntegral off))
 
 -- -----------------------------------------------------------------------------
 -- pathconf()/fpathconf() support
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/IO/Common.hsc boot/pkg/unix/System/Posix/IO/Common.hsc
--- upstream/pkg/unix/System/Posix/IO/Common.hsc	2001-09-09 13:46:40.000000000 +1200
+++ boot/pkg/unix/System/Posix/IO/Common.hsc	2021-06-10 20:42:21.000000000 +1200
@@ -281,7 +281,7 @@
 -- | May throw an exception if this is an invalid descriptor.
 fdSeek :: Fd -> SeekMode -> FileOffset -> IO FileOffset
 fdSeek (Fd fd) mode off =
-  throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
+  throwErrnoIfMinus1 "fdSeek" (fmap fromIntegral $ Base.c_lseek fd (fromIntegral off) (mode2Int mode))
 
 -- -----------------------------------------------------------------------------
 -- Locking
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Process/Internals.hs boot/pkg/unix/System/Posix/Process/Internals.hs
--- upstream/pkg/unix/System/Posix/Process/Internals.hs	2001-09-09 13:46:40.000000000 +1200
+++ boot/pkg/unix/System/Posix/Process/Internals.hs	2021-06-10 20:42:21.000000000 +1200
@@ -1,5 +1,6 @@
 {-# LANGUAGE CApiFFI #-}
 {-# LANGUAGE Trustworthy #-}
+{-# LANGUAGE CPP #-}
 
 module System.Posix.Process.Internals (
        pPrPr_disableITimers, c_execvpe,
@@ -9,7 +10,12 @@
 import Foreign.C
 import System.Exit
 import System.IO.Error
+
+#ifdef ghcjs_HOST_OS
+type Signal = CInt
+#else
 import GHC.Conc (Signal)
+#endif
 
 -- | The exit status of a process
 data ProcessStatus
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Signals.hsc boot/pkg/unix/System/Posix/Signals.hsc
--- upstream/pkg/unix/System/Posix/Signals.hsc	2001-09-09 13:46:40.000000000 +1200
+++ boot/pkg/unix/System/Posix/Signals.hsc	2021-06-10 20:42:21.000000000 +1200
@@ -349,11 +349,10 @@
                -> Maybe SignalSet       -- ^ other signals to block
                -> IO Handler            -- ^ old handler
 
-#ifdef __PARALLEL_HASKELL__
+##if defined(__PARALLEL_HASKELL__)
 installHandler =
   error "installHandler: not available for Parallel Haskell"
-#else
-
+##else
 installHandler sig handler _maybe_mask = do
   ensureIOManagerIsRunning  -- for the threaded RTS
 
@@ -441,7 +440,7 @@
         siginfoError  = Errno errno,
         siginfoSpecific = extra }
 
-#endif /* !__PARALLEL_HASKELL__ */
+##endif /* !__PARALLEL_HASKELL__ */
 
 -- -----------------------------------------------------------------------------
 -- Alarms
<commit_msg>update unix patch<commit_after>diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Files/Common.hsc boot/pkg/unix/System/Posix/Files/Common.hsc
--- upstream/pkg/unix/System/Posix/Files/Common.hsc	2001-09-09 03:46:40.000000000 +0200
+++ boot/pkg/unix/System/Posix/Files/Common.hsc	2021-06-10 22:32:23.930000000 +0200
@@ -520,7 +520,7 @@
 -- Note: calls @ftruncate@.
 setFdSize :: Fd -> FileOffset -> IO ()
 setFdSize (Fd fd) off =
-  throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd off)
+  throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd (fromIntegral off))
 
 -- -----------------------------------------------------------------------------
 -- pathconf()/fpathconf() support
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/IO/Common.hsc boot/pkg/unix/System/Posix/IO/Common.hsc
--- upstream/pkg/unix/System/Posix/IO/Common.hsc	2001-09-09 03:46:40.000000000 +0200
+++ boot/pkg/unix/System/Posix/IO/Common.hsc	2021-06-10 22:32:23.930000000 +0200
@@ -281,7 +281,7 @@
 -- | May throw an exception if this is an invalid descriptor.
 fdSeek :: Fd -> SeekMode -> FileOffset -> IO FileOffset
 fdSeek (Fd fd) mode off =
-  throwErrnoIfMinus1 "fdSeek" (Base.c_lseek fd off (mode2Int mode))
+  throwErrnoIfMinus1 "fdSeek" (fmap fromIntegral $ Base.c_lseek fd (fromIntegral off) (mode2Int mode))
 
 -- -----------------------------------------------------------------------------
 -- Locking
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Process/Internals.hs boot/pkg/unix/System/Posix/Process/Internals.hs
--- upstream/pkg/unix/System/Posix/Process/Internals.hs	2001-09-09 03:46:40.000000000 +0200
+++ boot/pkg/unix/System/Posix/Process/Internals.hs	2021-06-10 22:32:23.930000000 +0200
@@ -1,5 +1,6 @@
 {-# LANGUAGE CApiFFI #-}
 {-# LANGUAGE Trustworthy #-}
+{-# LANGUAGE CPP #-}
 
 module System.Posix.Process.Internals (
        pPrPr_disableITimers, c_execvpe,
@@ -9,7 +10,12 @@
 import Foreign.C
 import System.Exit
 import System.IO.Error
+
+#ifdef ghcjs_HOST_OS
+type Signal = CInt
+#else
 import GHC.Conc (Signal)
+#endif
 
 -- | The exit status of a process
 data ProcessStatus
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/System/Posix/Signals.hsc boot/pkg/unix/System/Posix/Signals.hsc
--- upstream/pkg/unix/System/Posix/Signals.hsc	2001-09-09 03:46:40.000000000 +0200
+++ boot/pkg/unix/System/Posix/Signals.hsc	2021-06-10 22:32:23.930000000 +0200
@@ -349,11 +349,10 @@
                -> Maybe SignalSet       -- ^ other signals to block
                -> IO Handler            -- ^ old handler
 
-#ifdef __PARALLEL_HASKELL__
+##if defined(__PARALLEL_HASKELL__)
 installHandler =
   error "installHandler: not available for Parallel Haskell"
-#else
-
+##else
 installHandler sig handler _maybe_mask = do
   ensureIOManagerIsRunning  -- for the threaded RTS
 
@@ -441,7 +440,7 @@
         siginfoError  = Errno errno,
         siginfoSpecific = extra }
 
-#endif /* !__PARALLEL_HASKELL__ */
+##endif /* !__PARALLEL_HASKELL__ */
 
 -- -----------------------------------------------------------------------------
 -- Alarms
diff -X ../utils/updatePatches.excludes -Nru upstream/pkg/unix/config.sub boot/pkg/unix/config.sub
--- upstream/pkg/unix/config.sub	2001-09-09 03:46:40.000000000 +0200
+++ boot/pkg/unix/config.sub	2021-06-11 14:49:50.712651100 +0200
@@ -1169,6 +1169,7 @@
 			| arm | arm[lb]e | arme[lb] | armv* \
 			| avr | avr32 \
 			| asmjs \
+			| js \
 			| ba \
 			| be32 | be64 \
 			| bfin | bpf | bs2000 \
@@ -1728,7 +1729,7 @@
 	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
 	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
 	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
-	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* | ghcjs* \
 	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
 		;;
 	# This one is extra strict with allowed versions

{'fraction_non_alphanumeric': 0.20918797415004214, 'fraction_numerical': 0.08682214105085698, 'mean_word_length': 2.517292490118577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 17, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2321545', 'n_tokens_mistral': 3122, 'n_tokens_neox': 2604, 'n_words': 495}