From 07329d65984086314201a47fcf4c52c6b9bf5ad9 Mon Sep 17 00:00:00 2001 From: panne Date: Fri, 26 Sep 2003 09:26:13 +0000 Subject: [PATCH] [project @ 2003-09-26 09:26:13 by panne] Saving/restoring termios is only done for GHC --- System/Posix/Internals.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/System/Posix/Internals.hs b/System/Posix/Internals.hs index d02b02c..464b6a7 100644 --- a/System/Posix/Internals.hs +++ b/System/Posix/Internals.hs @@ -210,6 +210,7 @@ tcSetAttr fd fun = do throwErrnoIfMinus1Retry "tcSetAttr" (c_tcgetattr (fromIntegral fd) p_tios) +#ifdef __GLASGOW_HASKELL__ -- Save a copy of termios, if this is a standard file descriptor. -- These terminal settings are restored in hs_exit(). when (fd <= 2) $ do @@ -218,6 +219,7 @@ tcSetAttr fd fun = do saved_tios <- mallocBytes sizeof_termios copyBytes saved_tios p_tios sizeof_termios set_saved_termios fd saved_tios +#endif -- tcsetattr() when invoked by a background process causes the process -- to be sent SIGTTOU regardless of whether the process has TOSTOP set @@ -235,11 +237,13 @@ tcSetAttr fd fun = do c_sigprocmask const_sig_setmask p_old_sigset nullPtr return r +#ifdef __GLASGOW_HASKELL__ foreign import ccall unsafe "HsBase.h __hscore_get_saved_termios" get_saved_termios :: Int -> IO (Ptr CTermios) foreign import ccall unsafe "HsBase.h __hscore_set_saved_termios" set_saved_termios :: Int -> (Ptr CTermios) -> IO () +#endif #else -- 1.7.10.4