2 % (c) The GRASP/AQUA Project, Glasgow University, 1995-1996
4 \section[PosixUtil]{Haskell 1.3 POSIX utilities}
10 import PrelIOBase -- IOError representation
14 First, all of the major Posix data types, to avoid any recursive dependencies
25 type ProcessGroupID = ProcessID
29 instance CReturnable Fd
32 (FD# x#) == (FD# y#) = x# ==# y#
36 intToFd (I# fd#) = FD# fd#
39 fdToInt (FD# x#) = I# x#
42 Now some local functions that shouldn't go outside this library.
44 Fail with a SystemError. Normally, we do not try to re-interpret
45 POSIX error numbers, so most routines in this file will only fail
46 with SystemError. The only exceptions are (1) those routines where
47 failure of some kind may be considered ``normal''...e.g. getpwnam()
48 for a non-existent user, or (2) those routines which do not set
52 syserr :: String -> IO a
53 syserr str = fail (IOError Nothing -- ToDo: better
58 -- common templates for system calls
60 nonzero_error :: IO Int -> String -> IO ()
61 nonzero_error io err = do
67 minusone_error :: IO Int -> String -> IO ()
68 minusone_error io err = do