X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FPosix.hs;h=819f2f419fca22f695964bff6e7b6afd097cf6c2;hb=d5db6c9042041e88502be3ba755db6a85822d304;hp=fa40cefe7dfbb4203b65a0ceea81cb2ee54c366c;hpb=1c64ce96fc5e52ce66abd849b7463c4c1ce537d8;p=haskell-directory.git diff --git a/GHC/Posix.hs b/GHC/Posix.hs index fa40cef..819f2f4 100644 --- a/GHC/Posix.hs +++ b/GHC/Posix.hs @@ -23,6 +23,7 @@ module GHC.Posix where #include "config.h" import Control.Monad +import System.Posix.Types import Foreign import Foreign.C @@ -53,24 +54,6 @@ type CTms = () type CUtimbuf = () type CUtsname = () -type CDev = HTYPE_DEV_T -type CIno = HTYPE_INO_T -type CMode = HTYPE_MODE_T -type COff = HTYPE_OFF_T -type CPid = HTYPE_PID_T - -#ifdef mingw32_TARGET_OS -type CSsize = HTYPE_SIZE_T -#else -type CGid = HTYPE_GID_T -type CNlink = HTYPE_NLINK_T -type CSsize = HTYPE_SSIZE_T -type CUid = HTYPE_UID_T -type CCc = HTYPE_CC_T -type CSpeed = HTYPE_SPEED_T -type CTcflag = HTYPE_TCFLAG_T -#endif - -- --------------------------------------------------------------------------- -- stat()-related stuff @@ -230,6 +213,7 @@ tcSetAttr fd options p_tios = do throwErrnoIfMinus1Retry_ "tcSetAttr" $ c_tcsetattr (fromIntegral fd) options p_tios c_sigprocmask const_sig_setmask p_old_sigset nullPtr + return () #else @@ -379,12 +363,12 @@ foreign import ccall unsafe "fcntl" foreign import ccall unsafe "fork" c_fork :: IO CPid +foreign import ccall unsafe "getpid" + c_getpid :: IO CPid + foreign import ccall unsafe "fpathconf" c_fpathconf :: CInt -> CInt -> IO CLong -foreign import ccall unsafe "__hscore_sigemptyset" - c_sigemptyset :: Ptr CSigset -> IO () - foreign import ccall unsafe "link" c_link :: CString -> CString -> IO CInt @@ -397,11 +381,14 @@ foreign import ccall unsafe "pathconf" foreign import ccall unsafe "pipe" c_pipe :: Ptr CInt -> IO CInt +foreign import ccall unsafe "__hscore_sigemptyset" + c_sigemptyset :: Ptr CSigset -> IO CInt + foreign import ccall unsafe "__hscore_sigaddset" c_sigaddset :: Ptr CSigset -> CInt -> IO CInt foreign import ccall unsafe "sigprocmask" - c_sigprocmask :: CInt -> Ptr CSigset -> Ptr CSigset -> IO () + c_sigprocmask :: CInt -> Ptr CSigset -> Ptr CSigset -> IO CInt foreign import ccall unsafe "tcgetattr" c_tcgetattr :: CInt -> Ptr CTermios -> IO CInt