X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FPosix.hs;h=3c0553d4b32a630a842bc8451dc4f7f00617aeaf;hb=b706340c451952adf230b5b8daecad8a1f34d714;hp=ab7686210c1938c89fa0be38866186e352314209;hpb=7de50399a42ee49b0473b7b6eea2b44a2f941a12;p=ghc-base.git diff --git a/GHC/Posix.hs b/GHC/Posix.hs index ab76862..3c0553d 100644 --- a/GHC/Posix.hs +++ b/GHC/Posix.hs @@ -1,12 +1,21 @@ {-# OPTIONS -fno-implicit-prelude #-} --- --------------------------------------------------------------------------- --- $Id: Posix.hs,v 1.1 2002/02/05 17:32:26 simonmar Exp $ +----------------------------------------------------------------------------- +-- | +-- Module : GHC.Posix +-- Copyright : (c) The University of Glasgow, 1992-2002 +-- License : see libraries/base/LICENSE +-- +-- Maintainer : cvs-ghc@haskell.org +-- Stability : internal +-- Portability : non-portable -- -- POSIX support layer for the standard libraries -- -- Non-posix compliant in order to support the following features: -- * S_ISSOCK (no sockets in POSIX) +-- +----------------------------------------------------------------------------- module GHC.Posix where @@ -242,9 +251,6 @@ foreign import ccall unsafe "chmod" foreign import ccall unsafe "chdir" c_chdir :: CString -> IO CInt -foreign import ccall unsafe "chown" - c_chown :: CString -> CUid -> CGid -> IO CInt - foreign import ccall unsafe "close" c_close :: CInt -> IO CInt @@ -260,9 +266,6 @@ foreign import ccall unsafe "dup" foreign import ccall unsafe "dup2" c_dup2 :: CInt -> CInt -> IO CInt -foreign import ccall unsafe "fpathconf" - c_fpathconf :: CInt -> CInt -> IO CLong - foreign import ccall unsafe "fstat" c_fstat :: CInt -> Ptr CStat -> IO CInt @@ -272,9 +275,6 @@ foreign import ccall unsafe "getcwd" foreign import ccall unsafe "isatty" c_isatty :: CInt -> IO CInt -foreign import ccall unsafe "link" - c_link :: CString -> CString -> IO CInt - foreign import ccall unsafe "lseek" c_lseek :: CInt -> COff -> CInt -> IO COff @@ -290,15 +290,6 @@ foreign import ccall unsafe "opendir" foreign import ccall unsafe "__hscore_mkdir" mkdir :: CString -> CInt -> IO CInt -foreign import ccall unsafe "mkfifo" - c_mkfifo :: CString -> CMode -> IO CInt - -foreign import ccall unsafe "pathconf" - c_pathconf :: CString -> CInt -> IO CLong - -foreign import ccall unsafe "pipe" - c_pipe :: Ptr CInt -> IO CInt - foreign import ccall unsafe "read" c_read :: CInt -> Ptr CChar -> CSize -> IO CSsize @@ -320,12 +311,12 @@ foreign import ccall unsafe "stat" foreign import ccall unsafe "umask" c_umask :: CMode -> IO CMode -foreign import ccall unsafe "utime" - c_utime :: CString -> Ptr CUtimbuf -> IO CMode - foreign import ccall unsafe "write" c_write :: CInt -> Ptr CChar -> CSize -> IO CSsize +foreign import ccall unsafe "unlink" + c_unlink :: CString -> IO CInt + #ifndef mingw32_TARGET_OS foreign import ccall unsafe "fcntl" c_fcntl_read :: CInt -> CInt -> IO CInt @@ -339,11 +330,26 @@ foreign import ccall unsafe "fcntl" foreign import ccall unsafe "fork" c_fork :: 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 "sigaddset" - c_sigaddset :: Ptr CSigset -> CInt -> IO () +foreign import ccall unsafe "link" + c_link :: CString -> CString -> IO CInt + +foreign import ccall unsafe "mkfifo" + c_mkfifo :: CString -> CMode -> IO CInt + +foreign import ccall unsafe "pathconf" + c_pathconf :: CString -> CInt -> IO CLong + +foreign import ccall unsafe "pipe" + c_pipe :: Ptr CInt -> 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 () @@ -357,8 +363,8 @@ foreign import ccall unsafe "tcsetattr" foreign import ccall unsafe "uname" c_uname :: Ptr CUtsname -> IO CInt -foreign import ccall unsafe "unlink" - c_unlink :: CString -> IO CInt +foreign import ccall unsafe "utime" + c_utime :: CString -> Ptr CUtimbuf -> IO CMode foreign import ccall unsafe "waitpid" c_waitpid :: CPid -> Ptr CInt -> CInt -> IO CPid @@ -389,10 +395,6 @@ foreign import ccall unsafe "__hscore_st_mtime" st_mtime :: Ptr CStat -> IO CTim foreign import ccall unsafe "__hscore_st_size" st_size :: Ptr CStat -> IO COff foreign import ccall unsafe "__hscore_st_mode" st_mode :: Ptr CStat -> IO CMode -foreign import ccall unsafe "__hscore_lflag" c_lflag :: Ptr CTermios -> IO CTcflag -foreign import ccall unsafe "__hscore_poke_lflag" poke_c_lflag :: Ptr CTermios -> CTcflag -> IO () -foreign import ccall unsafe "__hscore_ptr_c_cc" ptr_c_cc :: Ptr CTermios -> IO (Ptr Word8) - foreign import ccall unsafe "__hscore_echo" const_echo :: CInt foreign import ccall unsafe "__hscore_tcsanow" const_tcsanow :: CInt foreign import ccall unsafe "__hscore_icanon" const_icanon :: CInt @@ -407,6 +409,10 @@ foreign import ccall unsafe "__hscore_f_setfl" const_f_setfl :: CInt #ifndef mingw32_TARGET_OS foreign import ccall unsafe "__hscore_sizeof_termios" sizeof_termios :: Int foreign import ccall unsafe "__hscore_sizeof_sigset_t" sizeof_sigset_t :: Int + +foreign import ccall unsafe "__hscore_lflag" c_lflag :: Ptr CTermios -> IO CTcflag +foreign import ccall unsafe "__hscore_poke_lflag" poke_c_lflag :: Ptr CTermios -> CTcflag -> IO () +foreign import ccall unsafe "__hscore_ptr_c_cc" ptr_c_cc :: Ptr CTermios -> IO (Ptr Word8) #endif #ifndef mingw32_TARGET_OS