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