unix 2.7.0.0 → 2.7.0.1
raw patch · 5 files changed
+87/−79 lines, 5 filesdep ~time
Dependency ranges changed: time
Files
- System/Posix/Files.hsc +29/−28
- System/Posix/Files/ByteString.hsc +1/−1
- changelog +0/−47
- changelog.md +54/−0
- unix.cabal +3/−3
System/Posix/Files.hsc view
@@ -6,7 +6,7 @@ -- Module : System.Posix.Files -- Copyright : (c) The University of Glasgow 2002 -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : libraries@haskell.org -- Stability : provisional -- Portability : non-portable (requires POSIX)@@ -60,7 +60,7 @@ isDirectory, isSymbolicLink, isSocket, -- * Creation- createNamedPipe, + createNamedPipe, createDevice, -- * Hard links@@ -96,6 +96,7 @@ import System.Posix.Types import System.Posix.Files.Common+import System.Posix.Error import System.Posix.Internals import Data.Time.Clock.POSIX@@ -134,26 +135,26 @@ -- -- Note: calls @access@. fileExist :: FilePath -> IO Bool-fileExist name = +fileExist name = withFilePath name $ \s -> do r <- c_access s (#const F_OK) if (r == 0)- then return True- else do err <- getErrno- if (err == eNOENT)- then return False- else throwErrnoPath "fileExist" name+ then return True+ else do err <- getErrno+ if (err == eNOENT)+ then return False+ else throwErrnoPath "fileExist" name access :: FilePath -> CMode -> IO Bool-access name flags = +access name flags = withFilePath name $ \s -> do r <- c_access s (fromIntegral flags) if (r == 0)- then return True- else do err <- getErrno- if (err == eACCES)- then return False- else throwErrnoPath "fileAccess" name+ then return True+ else do err <- getErrno+ if (err == eACCES || err == eROFS || err == eTXTBSY)+ then return False+ else throwErrnoPath "fileAccess" name -- | @getFileStatus path@ calls gets the @FileStatus@ information (user ID,@@ -162,10 +163,10 @@ -- Note: calls @stat@. getFileStatus :: FilePath -> IO FileStatus getFileStatus path = do- fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) + fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) withForeignPtr fp $ \p ->- withFilePath path $ \s -> - throwErrnoPathIfMinus1_ "getFileStatus" path (c_stat s p)+ withFilePath path $ \s ->+ throwErrnoPathIfMinus1Retry_ "getFileStatus" path (c_stat s p) return (FileStatus fp) -- | Acts as 'getFileStatus' except when the 'FilePath' refers to a symbolic@@ -175,9 +176,9 @@ -- Note: calls @lstat@. getSymbolicLinkStatus :: FilePath -> IO FileStatus getSymbolicLinkStatus path = do- fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) + fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) withForeignPtr fp $ \p ->- withFilePath path $ \s -> + withFilePath path $ \s -> throwErrnoPathIfMinus1_ "getSymbolicLinkStatus" path (c_lstat s p) return (FileStatus fp) @@ -193,7 +194,7 @@ -- Note: calls @mkfifo@. createNamedPipe :: FilePath -> FileMode -> IO () createNamedPipe name mode = do- withFilePath name $ \s -> + withFilePath name $ \s -> throwErrnoPathIfMinus1_ "createNamedPipe" name (c_mkfifo s mode) -- | @createDevice path mode dev@ creates either a regular or a special file@@ -209,7 +210,7 @@ withFilePath path $ \s -> throwErrnoPathIfMinus1_ "createDevice" path (c_mknod s mode dev) -foreign import ccall unsafe "__hsunix_mknod" +foreign import ccall unsafe "__hsunix_mknod" c_mknod :: CString -> CMode -> CDev -> IO CInt -- -----------------------------------------------------------------------------@@ -268,8 +269,8 @@ readSymbolicLink file = allocaArray0 (#const PATH_MAX) $ \buf -> do withFilePath file $ \s -> do- len <- throwErrnoPathIfMinus1 "readSymbolicLink" file $ - c_readlink s buf (#const PATH_MAX)+ len <- throwErrnoPathIfMinus1 "readSymbolicLink" file $+ c_readlink s buf (#const PATH_MAX) peekFilePathLen (buf,fromIntegral len) foreign import ccall unsafe "readlink"@@ -316,7 +317,7 @@ setSymbolicLinkOwnerAndGroup name uid gid = do withFilePath name $ \s -> throwErrnoPathIfMinus1_ "setSymbolicLinkOwnerAndGroup" name- (c_lchown s uid gid)+ (c_lchown s uid gid) foreign import ccall unsafe "lchown" c_lchown :: CString -> CUid -> CGid -> IO CInt@@ -415,7 +416,7 @@ -- -- Note: calls @truncate@. setFileSize :: FilePath -> FileOffset -> IO ()-setFileSize file off = +setFileSize file off = withFilePath file $ \s -> throwErrnoPathIfMinus1_ "setFileSize" file (c_truncate s off) @@ -434,9 +435,9 @@ -- Note: calls @pathconf@. getPathVar :: FilePath -> PathVar -> IO Limit getPathVar name v = do- withFilePath name $ \ nameP -> - throwErrnoPathIfMinus1 "getPathVar" name $ + withFilePath name $ \ nameP ->+ throwErrnoPathIfMinus1 "getPathVar" name $ c_pathconf nameP (pathVarConst v) -foreign import ccall unsafe "pathconf" +foreign import ccall unsafe "pathconf" c_pathconf :: CString -> CInt -> IO CLong
System/Posix/Files/ByteString.hsc view
@@ -172,7 +172,7 @@ fp <- mallocForeignPtrBytes (#const sizeof(struct stat)) withForeignPtr fp $ \p -> withFilePath path $ \s -> - throwErrnoPathIfMinus1_ "getFileStatus" path (c_stat s p)+ throwErrnoPathIfMinus1Retry_ "getFileStatus" path (c_stat s p) return (FileStatus fp) -- | Acts as 'getFileStatus' except when the 'RawFilePath' refers to a symbolic
− changelog
@@ -1,47 +0,0 @@--*-changelog-*---2.7.0.0 Nov 2013-- * New `forkProcessWithUnmask` function in the style of `forkIOWithUnmask`-- * Change `forkProcess` to inherit the exception masking state of its caller-- * Add new `Bool` flag to `ProcessStatus(Terminated)` constructor- indicating whether a core dump occured-- * New functions in "System.Posix.Files(.ByteString)" for operating- on high resolution file timestamps:-- + `setFdTimesHiRes :: Fd -> POSIXTime -> POSIXTime -> IO ()`- + `setFileTimesHiRes :: FilePath -> POSIXTime -> POSIXTime -> IO ()`- + `setSymbolicLinkTimesHiRes :: FilePath -> POSIXTime -> POSIXTime -> IO ()`- + `touchFd :: Fd -> IO ()`- + `touchSymbolicLink :: FilePath -> IO ()`-- * Export `SignalInfo(..)` and `SignalSpecificInfo(..)` as well as- the two `Handler` constructors `CatchInfo` and `CatchInfoOnce`- from "System.Posix.Signals".-- * Don't export `seekDirStream` and `tellDirStream` if the- underlying `seekdir(3)`/`telldir(3)` system calls are not- available (as on Android).-- * Fix library detection of `shm*` on openSUSE (#8350)-- * Minor documentation fixes/updates-- * Update package to `cabal-version >= 1.10` format--2.6.0.1 Jan 2013-- * Bundled with GHC 7.6.2- * Fix memory corruption issue in `putEnv`- * Use `pthread_kill(3)` instead of `raise(2)` on OS X too--2.6.0.0 Sep 2012-- * Bundled with GHC 7.6.1- * New functions `mkdtemp` and `mkstemps` in "System.Posix.Temp"- * New functions `setEnvironment` and `cleanEnv`- * New functions `accessTimeHiRes`, `modificationTimeHiRes`, and- `statusChangeTimeHiRes` for accessing high resolution timestamps
+ changelog.md view
@@ -0,0 +1,54 @@+## 2.7.0.1 *Mar 2014*++ * Bundled with GHC 7.8.1++ * Handle `EROFS` and `ETXTBSY` as (non-exceptional) permission denied in+ `fileAccess`++ * Fix `getFileStatus` to retry `stat(2)` when it returns `EAGAIN`+ (this can happen on Solaris)++## 2.7.0.0 *Nov 2013*++ * New `forkProcessWithUnmask` function in the style of `forkIOWithUnmask`++ * Change `forkProcess` to inherit the exception masking state of its caller++ * Add new `Bool` flag to `ProcessStatus(Terminated)` constructor+ indicating whether a core dump occured++ * New functions in `System.Posix.Files{,.ByteString}` for operating+ on high resolution file timestamps:++ setFdTimesHiRes :: Fd -> POSIXTime -> POSIXTime -> IO ()+ setFileTimesHiRes :: FilePath -> POSIXTime -> POSIXTime -> IO ()+ setSymbolicLinkTimesHiRes :: FilePath -> POSIXTime -> POSIXTime -> IO ()+ touchFd :: Fd -> IO ()+ touchSymbolicLink :: FilePath -> IO ()++ * Export `SignalInfo(..)` and `SignalSpecificInfo(..)` as well as+ the two `Handler` constructors `CatchInfo` and `CatchInfoOnce`+ from `System.Posix.Signals`++ * Don't export `seekDirStream` and `tellDirStream` if the underlying+ `seekdir(3)`/`telldir(3)` system calls are not available (as on Android)++ * Fix library detection of `shm*` on openSUSE (#8350)++ * Minor documentation fixes/updates++ * Update package to `cabal-version >= 1.10` format++## 2.6.0.1 *Jan 2013*++ * Bundled with GHC 7.6.2+ * Fix memory corruption issue in `putEnv`+ * Use `pthread_kill(3)` instead of `raise(2)` on OS X too++## 2.6.0.0 *Sep 2012*++ * Bundled with GHC 7.6.1+ * New functions `mkdtemp` and `mkstemps` in `System.Posix.Temp`+ * New functions `setEnvironment` and `cleanEnv`+ * New functions `accessTimeHiRes`, `modificationTimeHiRes`, and+ `statusChangeTimeHiRes` for accessing high resolution timestamps
unix.cabal view
@@ -1,5 +1,5 @@ name: unix-version: 2.7.0.0+version: 2.7.0.1 -- GHC 7.6.1 released with 2.6.0.0 license: BSD3 license-file: LICENSE@@ -19,7 +19,7 @@ The package is not supported under Windows (except under Cygwin). extra-source-files:- changelog+ changelog.md config.guess config.sub configure@@ -43,7 +43,7 @@ source-repository this type: git location: http://git.haskell.org/packages/unix.git- tag: unix-2.7.0.0-release+ tag: unix-2.7.0.1-release library default-language: Haskell2010