-{-# OPTIONS -optc-DNON_POSIX_SOURCE #-}
+{-# OPTIONS -fno-implicit-prelude -optc-DNON_POSIX_SOURCE #-}
-- ---------------------------------------------------------------------------
--- $Id: PrelPosix.hsc,v 1.1 2001/05/18 16:54:05 simonmar Exp $
+-- $Id: PrelPosix.hsc,v 1.2 2001/05/18 18:27:20 qrczak Exp $
--
-- POSIX support layer for the standard libraries
--
#include "HsStd.h"
-import Monad
+import PrelBase
+import PrelNum
+import PrelReal
+import PrelMaybe
import PrelCString
import PrelPtr
import PrelWord
(#poke struct termios, c_lflag) p_tios (new_c_lflag :: CTcflag)
-- set VMIN & VTIME to 1/0 respectively
- when cooked $
- do let c_cc = (#ptr struct termios, c_cc) p_tios
- vmin = c_cc `plusPtr` (#const VMIN) :: Ptr Word8
+ if cooked
+ then do
+ let c_cc = (#ptr struct termios, c_cc) p_tios
+ vmin = c_cc `plusPtr` (#const VMIN) :: Ptr Word8
vtime = c_cc `plusPtr` (#const VTIME) :: Ptr Word8
poke vmin 1
poke vtime 0
-
+ else return ()
+
tcSetAttr fd (#const TCSANOW) p_tios
-- tcsetattr() when invoked by a background process causes the process