diff -ur ghc4-4.08.1/ghc/compiler/Makefile ghc4-4.08.1-igl/ghc/compiler/Makefile --- ghc4-4.08.1/ghc/compiler/Makefile Sat Sep 2 21:26:47 2000 +++ ghc4-4.08.1-igl/ghc/compiler/Makefile Fri Jan 5 02:42:25 2001 @@ -140,7 +140,7 @@ # Avoids Bug in 3.02, it seems usageSP/UsageSPInf_HC_OPTS = -Onot -prelude/PrimOp_HC_OPTS = -H12m -K3m +prelude/PrimOp_HC_OPTS = -H23m -K3m prelude/PrelRules_HC_OPTS = -fvia-C parser/Lex_HC_OPTS = -fvia-C -K2m -H16m diff -ur ghc4-4.08.1/hslibs/posix/PosixFiles.lhs ghc4-4.08.1-igl/hslibs/posix/PosixFiles.lhs --- ghc4-4.08.1/hslibs/posix/PosixFiles.lhs Sat Apr 29 21:55:43 2000 +++ ghc4-4.08.1-igl/hslibs/posix/PosixFiles.lhs Mon Jan 8 12:41:05 2001 @@ -20,7 +20,7 @@ ownerReadMode, ownerWriteMode, ownerExecuteMode, ownerModes, groupReadMode, groupWriteMode, groupExecuteMode, groupModes, otherReadMode, otherWriteMode, otherExecuteMode, otherModes, - setUserIDMode, setGroupIDMode, + setUserIDMode, setGroupIDMode, stickyBitMode, stdFileMode, accessModes, unionFileModes, intersectFileModes, @@ -40,21 +40,23 @@ -- FileStatus FileStatus, - getFileStatus, getFdStatus, + getFileStatus, getlFileStatus, getFdStatus, fileExist, fileAccess, setFileMode, fileMode, fileID, FileID, - deviceID, DeviceID, + deviceID, rdeviceID, DeviceID, linkCount, fileOwner, fileGroup, fileSize, + fileBlockSize, fileBlocks, accessTime, modificationTime, statusChangeTime, isDirectory, isCharacterDevice, isBlockDevice, isRegularFile, - isNamedPipe, + isNamedPipe, isSocket, + isLink, setOwnerAndGroup, -- chown (might be restricted) setFileTimes, -- set access and modification time @@ -205,6 +207,9 @@ setGroupIDMode :: FileMode setGroupIDMode = FileMode ``S_ISGID'' +stickyBitMode :: FileMode +stickyBitMode = FileMode ``S_ISVTX'' + stdFileMode :: FileMode stdFileMode = FileMode ``(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)'' @@ -375,10 +380,22 @@ fileGroup stat = unsafePerformIO $ _casm_ ``%r = ((struct stat *)%0)->st_gid;'' stat +rdeviceID :: FileStatus -> DeviceID +rdeviceID stat = unsafePerformIO $ + _casm_ ``%r = ((struct stat *)%0)->st_rdev;'' stat + fileSize :: FileStatus -> FileOffset fileSize stat = unsafePerformIO $ _casm_ ``%r = ((struct stat *)%0)->st_size;'' stat +fileBlockSize :: FileStatus -> FileBlockSize +fileBlockSize stat = unsafePerformIO $ + _casm_ ``%r = ((struct stat *)%0)->st_blksize;'' stat + +fileBlocks :: FileStatus -> FileBlocks +fileBlocks stat = unsafePerformIO $ + _casm_ ``%r = ((struct stat *)%0)->st_blocks;'' stat + accessTime :: FileStatus -> EpochTime accessTime stat = unsafePerformIO $ _casm_ ``%r = ((struct stat *)%0)->st_atime;'' stat @@ -416,6 +433,16 @@ _casm_ ``%r = S_ISFIFO(((struct stat *)%0)->st_mode);'' stat >>= \ rc -> return (rc /= (0::Int)) +isSocket :: FileStatus -> Bool +isSocket stat = unsafePerformIO $ + _casm_ ``%r = S_ISSOCK(((struct stat *)%0)->st_mode);'' stat >>= \ rc -> + return (rc /= (0::Int)) + +isLink :: FileStatus -> Bool +isLink stat = unsafePerformIO $ + _casm_ ``%r = S_ISLNK(((struct stat *)%0)->st_mode);'' stat >>= \ rc -> + return (rc /= (0::Int)) + getFileStatus :: FilePath -> IO FileStatus getFileStatus name = do bytes <- allocChars ``sizeof(struct stat)'' @@ -425,6 +452,16 @@ stat <- freeze bytes return stat else syserr "getFileStatus" + +getlFileStatus :: FilePath -> IO FileStatus +getlFileStatus name = do + bytes <- allocChars ``sizeof(struct stat)'' + rc <- _casm_ ``%r = lstat(%0,(struct stat *)%1);'' (packString name) bytes + if rc == (0::Int) + then do + stat <- freeze bytes + return stat + else syserr "getlFileStatus" getFdStatus :: Fd -> IO FileStatus getFdStatus fd = do diff -ur ghc4-4.08.1/hslibs/posix/PosixUtil.lhs ghc4-4.08.1-igl/hslibs/posix/PosixUtil.lhs --- ghc4-4.08.1/hslibs/posix/PosixUtil.lhs Tue Apr 11 22:53:23 2000 +++ ghc4-4.08.1-igl/hslibs/posix/PosixUtil.lhs Sun Jan 7 17:53:53 2001 @@ -18,6 +18,8 @@ type ClockTick = Int type EpochTime = Int type FileOffset = Int +type FileBlockSize = Int +type FileBlocks = Int type GroupID = Int type Limit = Int type LinkCount = Int diff -ur ghc4-4.08.1/hslibs/posix/cbits/libposix.h ghc4-4.08.1-igl/hslibs/posix/cbits/libposix.h --- ghc4-4.08.1/hslibs/posix/cbits/libposix.h Thu Nov 25 17:10:13 1999 +++ ghc4-4.08.1-igl/hslibs/posix/cbits/libposix.h Mon Dec 4 16:43:41 2000 @@ -19,6 +19,7 @@ #include #endif /* HAVE_DIRENT_H */ +#define __USE_BSD 1 #ifdef HAVE_SYS_STAT_H #include #endif /* HAVE_SYS_STAT_H */