Skip to content
Snippets Groups Projects
Commit 716eccb1 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Drop bitrotting HUGS support

It's very unlikely the current `unix` code stands any chance of even
remotely work with Hugs...
parent 4c25a0d4
No related branches found
No related tags found
No related merge requests found
......@@ -79,11 +79,6 @@ import GHC.IO.Exception
import Data.Typeable (cast)
#endif
#ifdef __HUGS__
import Hugs.Prelude (IOException(..), IOErrorType(..))
import qualified Hugs.IO (handleToFd, openFd)
#endif
#include "HsUnix.h"
-- -----------------------------------------------------------------------------
......@@ -239,16 +234,6 @@ handleToFd' h h_@Handle__{haType=_,..} = do
fdToHandle fd = FD.fdToHandle (fromIntegral fd)
#endif
#ifdef __HUGS__
handleToFd h = do
fd <- Hugs.IO.handleToFd h
return (fromIntegral fd)
fdToHandle fd = do
mode <- fdGetMode (fromIntegral fd)
Hugs.IO.openFd (fromIntegral fd) False mode True
#endif
-- -----------------------------------------------------------------------------
-- Fd options
......
......@@ -78,10 +78,6 @@ import System.Posix.Process.Internals
import System.Posix.Process.Common
import System.Posix.Internals ( withFilePath )
#ifdef __HUGS__
{-# CFILES cbits/HsUnix.c #-}
#endif
-- | @'executeFile' cmd args env@ calls one of the
-- @execv*@ family, depending on whether or not the current
-- PATH is to be searched for the command, and whether or not an
......
......@@ -90,10 +90,6 @@ import qualified Data.ByteString.Char8 as BC
import System.Posix.ByteString.FilePath
#ifdef __HUGS__
{-# CFILES cbits/HsUnix.c #-}
#endif
-- | @'executeFile' cmd args env@ calls one of the
-- @execv*@ family, depending on whether or not the current
-- PATH is to be searched for the command, and whether or not an
......
......@@ -88,10 +88,6 @@ import GHC.TopHandler ( runIO )
import GHC.IO ( unsafeUnmask, uninterruptibleMask_ )
#endif
#ifdef __HUGS__
{-# CFILES cbits/HsUnix.c #-}
#endif
-- -----------------------------------------------------------------------------
-- Process environment
......
......@@ -602,16 +602,7 @@ awaitSignal maybe_sigset = do
foreign import ccall unsafe "sigsuspend"
c_sigsuspend :: Ptr CSigset -> IO CInt
#ifdef __HUGS__
foreign import ccall unsafe "sigdelset"
c_sigdelset :: Ptr CSigset -> CInt -> IO CInt
foreign import ccall unsafe "sigfillset"
c_sigfillset :: Ptr CSigset -> IO CInt
foreign import ccall unsafe "sigismember"
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
#elif defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706
#if defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706
-- see http://ghc.haskell.org/trac/ghc/ticket/7359#comment:3
-- To be removed when support for GHC 7.4.x is dropped
foreign import ccall unsafe "__hscore_sigdelset"
......@@ -631,7 +622,7 @@ foreign import capi unsafe "signal.h sigfillset"
foreign import capi unsafe "signal.h sigismember"
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
#endif /* __HUGS__ */
#endif
foreign import ccall unsafe "sigpending"
c_sigpending :: Ptr CSigset -> IO CInt
......@@ -33,7 +33,7 @@ import System.Posix.IO
import System.Posix.Types
import System.Posix.Internals (withFilePath, peekFilePath)
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
#if defined(__GLASGOW_HASKELL__)
foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
c_mkstemp :: CString -> IO CInt
#endif
......@@ -48,7 +48,7 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
mkstemp :: String -> IO (FilePath, Handle)
mkstemp template' = do
let template = template' ++ "XXXXXX"
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
#if defined(__GLASGOW_HASKELL__)
withFilePath template $ \ ptr -> do
fd <- throwErrnoIfMinus1 "mkstemp" (c_mkstemp ptr)
name <- peekFilePath ptr
......@@ -114,7 +114,7 @@ mkdtemp template' = do
return name
#endif
#if (!defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)) || !HAVE_MKDTEMP
#if !defined(__GLASGOW_HASKELL__) || !HAVE_MKDTEMP
foreign import ccall unsafe "mktemp"
c_mktemp :: CString -> IO CString
......
......@@ -38,7 +38,7 @@ import System.Posix.Directory (createDirectory)
import System.Posix.IO
import System.Posix.Types
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
#if defined(__GLASGOW_HASKELL__)
foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
c_mkstemp :: CString -> IO CInt
#endif
......@@ -53,7 +53,7 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemp"
mkstemp :: ByteString -> IO (RawFilePath, Handle)
mkstemp template' = do
let template = template' `B.append` (BC.pack "XXXXXX")
#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
#if defined(__GLASGOW_HASKELL__)
withFilePath template $ \ ptr -> do
fd <- throwErrnoIfMinus1 "mkstemp" (c_mkstemp ptr)
name <- peekFilePath ptr
......@@ -114,7 +114,7 @@ mkdtemp template' = do
return name
#endif
#if (!defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)) || !HAVE_MKDTEMP
#if !defined(__GLASGOW_HASKELL__) || !HAVE_MKDTEMP
foreign import ccall unsafe "mktemp"
c_mktemp :: CString -> IO CString
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment