Skip to content

GHCJS patches. #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

alexanderkjeldaas
Copy link

Patches from the GHCJS project.

@@ -520,7 +520,7 @@ foreign import ccall unsafe "fchown"
-- Note: calls @ftruncate@.
setFdSize :: Fd -> FileOffset -> IO ()
setFdSize (Fd fd) off =
throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd off)
throwErrnoIfMinus1_ "setFdSize" (c_ftruncate fd (fromIntegral off))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this impedance mismatch occur? I'm reluctant to use a non-statically checked fromIntegral conversion which have been a common source of fileoffset overflow bugs... :-/

@@ -316,7 +316,7 @@ mode2Int SeekFromEnd = (#const SEEK_END)
-- | 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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as above

@@ -9,7 +10,12 @@ import Foreign
import Foreign.C
import System.Exit
import System.IO.Error

#ifdef ghcjs_HOST_OS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems the wrong place to kludge this around; why can't ghcjs' GHC.Conc (Signal) be used/fixed?

@@ -432,11 +432,10 @@ installHandler :: Signal
-> Maybe SignalSet -- ^ other signals to block
-> IO Handler -- ^ old handler

#ifdef __PARALLEL_HASKELL__
##if defined(__PARALLEL_HASKELL__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it necessarily to delay the macro expansion?

@Bodigrim
Copy link
Contributor

Closing as stalled and supposedly superseded by a more modern effort in #205.

@Bodigrim Bodigrim closed this Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants