summaryrefslogtreecommitdiff
path: root/ghc/lib/haskell-1.3
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/lib/haskell-1.3')
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime.lhs15
-rw-r--r--ghc/lib/haskell-1.3/LibPosix.hi12
-rw-r--r--ghc/lib/haskell-1.3/LibPosix.lhs9
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles.lhs3
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mc.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mg.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mp.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_p.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_t.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim.hi4
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi4
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi4
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi4
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi4
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mc.hi12
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mg.hi8
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mp.hi12
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_p.hi12
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_t.hi12
-rw-r--r--ghc/lib/haskell-1.3/LibSystem.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mc.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mp.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_p.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_t.hi2
-rw-r--r--ghc/lib/haskell-1.3/LibTime.lhs21
26 files changed, 99 insertions, 59 deletions
diff --git a/ghc/lib/haskell-1.3/LibCPUTime.lhs b/ghc/lib/haskell-1.3/LibCPUTime.lhs
index c3db93ed45..5cba859708 100644
--- a/ghc/lib/haskell-1.3/LibCPUTime.lhs
+++ b/ghc/lib/haskell-1.3/LibCPUTime.lhs
@@ -10,12 +10,14 @@ import PreludeGlaST
getCPUTime :: IO Integer
getCPUTime =
- _ccall_ getCPUTime `thenPrimIO` \ ptr@(A# ptr#) ->
- if ptr /= ``NULL'' then
- return (fromInt (I# (indexIntOffAddr# ptr# 0#)) * 1000000000 +
- fromInt (I# (indexIntOffAddr# ptr# 1#)) +
- fromInt (I# (indexIntOffAddr# ptr# 2#)) * 1000000000 +
- fromInt (I# (indexIntOffAddr# ptr# 3#)))
+ newIntArray (0,3) `thenPrimIO` \ marr ->
+ unsafeFreezeByteArray marr `thenPrimIO` \ barr@(_ByteArray _ frozen#) ->
+ _ccall_ getCPUTime barr `thenPrimIO` \ ptr ->
+ if (ptr::_Addr) /= ``NULL'' then
+ return (fromInt (I# (indexIntArray# frozen# 0#)) * 1000000000 +
+ fromInt (I# (indexIntArray# frozen# 1#)) +
+ fromInt (I# (indexIntArray# frozen# 2#)) * 1000000000 +
+ fromInt (I# (indexIntArray# frozen# 3#)))
else
failWith (UnsupportedOperation "can't get CPU time")
@@ -29,3 +31,4 @@ implementation-dependent.
+
diff --git a/ghc/lib/haskell-1.3/LibPosix.hi b/ghc/lib/haskell-1.3/LibPosix.hi
index a6ec46fc80..6b61f3bda5 100644
--- a/ghc/lib/haskell-1.3/LibPosix.hi
+++ b/ghc/lib/haskell-1.3/LibPosix.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
@@ -654,13 +658,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosix.lhs b/ghc/lib/haskell-1.3/LibPosix.lhs
index e97215efb4..46b66a6518 100644
--- a/ghc/lib/haskell-1.3/LibPosix.lhs
+++ b/ghc/lib/haskell-1.3/LibPosix.lhs
@@ -27,9 +27,12 @@ module LibPosix (
ProcessGroupID(..),
UserID(..),
- ExitCode
- ) where
+ ExitCode,
+
+ -- make interface complete:
+ setCurrentDirectory{-pragmas-}, getCurrentDirectory{-pragmas-}
+ ) where
import LibPosixDB
import LibPosixErr
@@ -43,7 +46,7 @@ import LibPosixUtil
-- runProcess is our candidate for the high-level OS-independent primitive
-- If accepted, it will be moved out of LibPosix into LibSystem.
-import LibDirectory ( setCurrentDirectory )
+import LibDirectory ( setCurrentDirectory, getCurrentDirectory{-pragmas-} )
import PreludeGlaST
import PreludePrimIO ( takeMVar, putMVar, _MVar )
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles.hi b/ghc/lib/haskell-1.3/LibPosixFiles.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles.lhs b/ghc/lib/haskell-1.3/LibPosixFiles.lhs
index f2caeb4069..d885c16719 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles.lhs
+++ b/ghc/lib/haskell-1.3/LibPosixFiles.lhs
@@ -247,7 +247,8 @@ openChannel name how maybe_mode append excl noctty nonblock trunc =
creat# = case creat of { W# x -> x }
flags = W# (creat# `or#` append# `or#` excl# `or#`
- noctty# `or#` nonblock# `or#` trunc#)
+ noctty# `or#` nonblock# `or#` trunc# `or#` how#)
+ how# = case (case how of { ReadOnly -> ``O_RDONLY'';WriteOnly -> ``O_WRONLY'';ReadWrite -> ``O_RDWR''}) of { W# x -> x }
append# = case (if append then ``O_APPEND'' else ``0'') of { W# x -> x }
excl# = case (if excl then ``O_EXCL'' else ``0'') of { W# x -> x }
noctty# = case (if noctty then ``O_NOCTTY'' else ``0'') of { W# x -> x }
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_p.hi b/ghc/lib/haskell-1.3/LibPosixFiles_p.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles_p.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_p.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_t.hi b/ghc/lib/haskell-1.3/LibPosixFiles_t.hi
index 335aecc9a9..c27d8e1778 100644
--- a/ghc/lib/haskell-1.3/LibPosixFiles_t.hi
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_t.hi
@@ -77,7 +77,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim.hi
index b02e2ef1ab..3c57a24709 100644
--- a/ghc/lib/haskell-1.3/LibPosixProcPrim.hi
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim.hi
@@ -180,13 +180,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi
index b02e2ef1ab..3c57a24709 100644
--- a/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi
@@ -180,13 +180,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi
index 866badf8c5..22cabc13f0 100644
--- a/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi
@@ -180,13 +180,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi
index b02e2ef1ab..3c57a24709 100644
--- a/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi
@@ -180,13 +180,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi
index b02e2ef1ab..3c57a24709 100644
--- a/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi
@@ -180,13 +180,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosix_mc.hi b/ghc/lib/haskell-1.3/LibPosix_mc.hi
index a6ec46fc80..6b61f3bda5 100644
--- a/ghc/lib/haskell-1.3/LibPosix_mc.hi
+++ b/ghc/lib/haskell-1.3/LibPosix_mc.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
@@ -654,13 +658,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosix_mg.hi b/ghc/lib/haskell-1.3/LibPosix_mg.hi
index a6ec46fc80..2f7d0f01c5 100644
--- a/ghc/lib/haskell-1.3/LibPosix_mg.hi
+++ b/ghc/lib/haskell-1.3/LibPosix_mg.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
diff --git a/ghc/lib/haskell-1.3/LibPosix_mp.hi b/ghc/lib/haskell-1.3/LibPosix_mp.hi
index 2019d507dc..2a3026b941 100644
--- a/ghc/lib/haskell-1.3/LibPosix_mp.hi
+++ b/ghc/lib/haskell-1.3/LibPosix_mp.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
@@ -654,13 +658,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosix_p.hi b/ghc/lib/haskell-1.3/LibPosix_p.hi
index a6ec46fc80..6b61f3bda5 100644
--- a/ghc/lib/haskell-1.3/LibPosix_p.hi
+++ b/ghc/lib/haskell-1.3/LibPosix_p.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
@@ -654,13 +658,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibPosix_t.hi b/ghc/lib/haskell-1.3/LibPosix_t.hi
index a6ec46fc80..6b61f3bda5 100644
--- a/ghc/lib/haskell-1.3/LibPosix_t.hi
+++ b/ghc/lib/haskell-1.3/LibPosix_t.hi
@@ -1,6 +1,6 @@
{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
interface LibPosix where
-import LibDirectory(removeDirectory)
+import LibDirectory(getCurrentDirectory, removeDirectory, setCurrentDirectory)
import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
@@ -54,6 +54,8 @@ type ProcessGroupID = Int
type ProcessID = Int
type UserID = Int
data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
@@ -271,7 +273,7 @@ modificationTime :: _ByteArray () -> Int
nullFileMode :: _Word
{-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
- {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ {-# GHC_PRAGMA _A_ 9 _U_ 212111112 _N_ _S_ "SESEEEEEL" _N_ _N_ #-}
openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
{-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
otherExecuteMode :: _Word
@@ -318,6 +320,8 @@ readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int
{-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
{-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
userGroupID :: UserEntry -> Int
{-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
userID :: UserEntry -> Int
@@ -654,13 +658,13 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ProcessStatus
{-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibSystem.hi b/ghc/lib/haskell-1.3/LibSystem.hi
index 5569655960..a82df1a972 100644
--- a/ghc/lib/haskell-1.3/LibSystem.hi
+++ b/ghc/lib/haskell-1.3/LibSystem.hi
@@ -28,7 +28,7 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibSystem_mc.hi b/ghc/lib/haskell-1.3/LibSystem_mc.hi
index 5569655960..a82df1a972 100644
--- a/ghc/lib/haskell-1.3/LibSystem_mc.hi
+++ b/ghc/lib/haskell-1.3/LibSystem_mc.hi
@@ -28,7 +28,7 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibSystem_mp.hi b/ghc/lib/haskell-1.3/LibSystem_mp.hi
index 5569655960..a82df1a972 100644
--- a/ghc/lib/haskell-1.3/LibSystem_mp.hi
+++ b/ghc/lib/haskell-1.3/LibSystem_mp.hi
@@ -28,7 +28,7 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibSystem_p.hi b/ghc/lib/haskell-1.3/LibSystem_p.hi
index 5569655960..a82df1a972 100644
--- a/ghc/lib/haskell-1.3/LibSystem_p.hi
+++ b/ghc/lib/haskell-1.3/LibSystem_p.hi
@@ -28,7 +28,7 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibSystem_t.hi b/ghc/lib/haskell-1.3/LibSystem_t.hi
index 5569655960..a82df1a972 100644
--- a/ghc/lib/haskell-1.3/LibSystem_t.hi
+++ b/ghc/lib/haskell-1.3/LibSystem_t.hi
@@ -28,7 +28,7 @@ instance Ord ExitCode
_tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
instance Text ExitCode
{-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
- readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readsPrec = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
diff --git a/ghc/lib/haskell-1.3/LibTime.lhs b/ghc/lib/haskell-1.3/LibTime.lhs
index 36b2b287b5..e3d6607fcf 100644
--- a/ghc/lib/haskell-1.3/LibTime.lhs
+++ b/ghc/lib/haskell-1.3/LibTime.lhs
@@ -24,6 +24,7 @@ module LibTime (
import PreludeIOError
import PreludeGlaST
import PS
+import LibPosixUtil (allocWords, allocChars)
\end{code}
@@ -47,7 +48,8 @@ we use the C library routines based on 32 bit integers.
instance Text ClockTime where
showsPrec p (TOD sec@(J# a# s# d#) nsec) =
showString (unsafePerformPrimIO (
- _ccall_ showTime (I# s#) (_ByteArray (error "ClockTime.show") d#)
+ allocChars 32 `thenPrimIO` \ buf ->
+ _ccall_ showTime (I# s#) (_ByteArray (error "ClockTime.show") d#) buf
`thenPrimIO` \ str ->
_ccall_ strlen str `thenPrimIO` \ len ->
_packCBytesST len str `thenStrictlyST` \ ps ->
@@ -155,7 +157,10 @@ ignored.
\begin{code}
toCalendarTime :: ClockTime -> CalendarTime
toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
- _ccall_ toLocalTime (I# s#) (_ByteArray (error "toCalendarTime") d#)
+ allocWords (``sizeof(struct tm)''::Int) `thenPrimIO` \ res ->
+ allocChars 32 `thenPrimIO` \ zoneNm ->
+ _casm_ ``SETZONE((struct tm *)%0,(char *)%1); '' res zoneNm `thenPrimIO` \ () ->
+ _ccall_ toLocalTime (I# s#) (_ByteArray (error "toCalendarTime") d#) res
`thenPrimIO` \ tm ->
if tm == (``NULL''::_Addr) then
error "toCalendarTime{LibTime}: out of range"
@@ -178,8 +183,8 @@ toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
`thenPrimIO` \ yday ->
_casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm
`thenPrimIO` \ isdst ->
- _ccall_ ZONE tm `thenPrimIO` \ zone ->
- _ccall_ GMTOFF tm `thenPrimIO` \ tz ->
+ _ccall_ ZONE tm `thenPrimIO` \ zone ->
+ _ccall_ GMTOFF tm `thenPrimIO` \ tz ->
_ccall_ strlen zone `thenPrimIO` \ len ->
_packCBytesST len zone `thenStrictlyST` \ tzname ->
returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec
@@ -188,7 +193,10 @@ toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
toUTCTime :: ClockTime -> CalendarTime
toUTCTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
- _ccall_ toUTCTime (I# s#) (_ByteArray (error "toCalendarTime") d#)
+ allocWords (``sizeof(struct tm)''::Int) `thenPrimIO` \ res ->
+ allocChars 32 `thenPrimIO` \ zoneNm ->
+ _casm_ ``SETZONE((struct tm *)%0,(char *)%1); '' res zoneNm `thenPrimIO` \ () ->
+ _ccall_ toUTCTime (I# s#) (_ByteArray (error "toCalendarTime") d#) res
`thenPrimIO` \ tm ->
if tm == (``NULL''::_Addr) then
error "toUTCTime{LibTime}: out of range"
@@ -221,7 +229,8 @@ toClockTime (CalendarTime year mon mday hour min sec psec wday yday tzname tz is
error "toClockTime{LibTime}: timezone offset out of range"
else
unsafePerformPrimIO (
- _ccall_ toClockSec year mon mday hour min sec tz
+ allocWords (``sizeof(time_t)'') `thenPrimIO` \ res ->
+ _ccall_ toClockSec year mon mday hour min sec tz res
`thenPrimIO` \ ptr@(A# ptr#) ->
if ptr /= ``NULL'' then
returnPrimIO (TOD (int2Integer# (indexIntOffAddr# ptr# 0#)) psec)