Skip to content

Commit

Permalink
Add unix-2.8.1.0.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Aug 25, 2023
1 parent 0721f35 commit 07ed631
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions patches/unix-2.8.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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

0 comments on commit 07ed631

Please sign in to comment.