module Main where import System.Posix.IO.Select import System.Posix.IO.Select.Types import System.Posix.IO import System.Posix.Types import System.IO main :: IO () main = do fd <- handleToFd stdin n <- select'' [fd] [] [] (finite 5 500000) case n of 0 -> print "timeout" -1 -> error "select failed" _ -> print "event" return ()