unix 2.4.0.0 → 2.4.0.1
raw patch · 11 files changed
+75/−25 lines, 11 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- System.Posix.Temp: mkstemp :: String -> IO (String, Handle)
+ System.Posix.Temp: mkstemp :: String -> IO (FilePath, Handle)
Files
- System/Posix/Error.hs +1/−1
- System/Posix/IO.hsc +28/−2
- System/Posix/SharedMem.hsc +1/−1
- System/Posix/Signals.hsc +1/−1
- System/Posix/Temp.hsc +9/−8
- System/Posix/User.hsc +5/−1
- config.guess +3/−0
- configure +16/−4
- configure.ac +7/−3
- include/HsUnixConfig.h +2/−2
- unix.cabal +2/−2
System/Posix/Error.hs view
@@ -18,7 +18,7 @@ throwErrnoPathIf_, throwErrnoPathIfNull, throwErrnoPathIfMinus1,- throwErrnoPathIfMinus1_+ throwErrnoPathIfMinus1_, ) where import Foreign.C.Error
System/Posix/IO.hsc view
@@ -179,7 +179,7 @@ openFd name how maybe_mode (OpenFileFlags appendFlag exclusiveFlag nocttyFlag nonBlockFlag truncateFlag) = do withCString name $ \s -> do- fd <- throwErrnoPathIfMinus1 "openFd" name (c_open s all_flags mode_w)+ fd <- throwErrnoPathIfMinus1Retry "openFd" name (c_open s all_flags mode_w) return (Fd fd) where all_flags = creat .|. flags .|. open_mode@@ -200,6 +200,22 @@ WriteOnly -> (#const O_WRONLY) ReadWrite -> (#const O_RDWR) + throwErrnoPathIfMinus1Retry :: Num a => String -> FilePath -> IO a -> IO a+ throwErrnoPathIfMinus1Retry loc path f =+ throwErrnoPathIfRetry (== -1) loc path f++ throwErrnoPathIfRetry :: (a -> Bool) -> String -> FilePath -> IO a -> IO a+ throwErrnoPathIfRetry pr loc path f =+ do+ res <- f+ if pr res+ then do+ err <- getErrno+ if err == eINTR+ then throwErrnoPathIfRetry pr loc path f+ else throwErrnoPath loc path+ else return res+ foreign import ccall unsafe "__hscore_open" c_open :: CString -> CInt -> CMode -> IO CInt @@ -238,7 +254,17 @@ #ifdef __GLASGOW_HASKELL__ #if __GLASGOW_HASKELL__ >= 611-handleToFd h = withHandle "handleToFd" h $ \ h_@Handle__{haType=_,..} -> do+handleToFd h@(FileHandle _ m) = do+ withHandle' "handleToFd" h m $ handleToFd' h+handleToFd h@(DuplexHandle _ r w) = do+ _ <- withHandle' "handleToFd" h r $ handleToFd' h+ withHandle' "handleToFd" h w $ handleToFd' h+ -- for a DuplexHandle, make sure we mark both sides as closed,+ -- otherwise a finalizer will come along later and close the other+ -- side. (#3914)++handleToFd' :: Handle -> Handle__ -> IO (Handle__, Fd)+handleToFd' h h_@Handle__{haType=_,..} = do case cast haDevice of Nothing -> ioError (ioeSetErrorString (mkIOError IllegalOperation "handleToFd" (Just h) Nothing)
@@ -21,7 +21,7 @@ #include <sys/types.h> #include <sys/mman.h>-#include <sys/fcntl.h>+#include <fcntl.h> #include "HsUnix.h"
System/Posix/Signals.hsc view
@@ -295,7 +295,7 @@ raiseSignal :: Signal -> IO () raiseSignal sig = throwErrnoIfMinus1_ "raiseSignal" (c_raise sig) -#if defined(__GLASGOW_HASKELL__) && (defined(openbsd_HOST_OS) || defined(freebsd_HOST_OS))+#if defined(__GLASGOW_HASKELL__) && (defined(openbsd_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)) foreign import ccall unsafe "genericRaise" c_raise :: CInt -> IO CInt #else
System/Posix/Temp.hsc view
@@ -4,7 +4,7 @@ -- Module : System.Posix.Temp -- Copyright : (c) Volker Stolz <vs@foldr.org> -- License : BSD-style (see the file libraries/base/LICENSE)--- +-- -- Maintainer : vs@foldr.org -- Stability : provisional -- Portability : non-portable (requires POSIX)@@ -15,12 +15,12 @@ module System.Posix.Temp ( - mkstemp+ mkstemp {- Not ported (yet?):- tmpfile: can we handle FILE*?- tmpnam: ISO C, should go in base?- tempname: dito+ tmpfile: can we handle FILE*?+ tmpnam: ISO C, should go in base?+ tempname: dito -} ) where@@ -33,9 +33,10 @@ import Foreign.C -- |'mkstemp' - make a unique filename and open it for--- reading\/writing (only safe on GHC & Hugs)--mkstemp :: String -> IO (String, Handle)+-- reading\/writing (only safe on GHC & Hugs).+-- The returned 'FilePath' is the (possibly relative) path of+-- the created file.+mkstemp :: String -> IO (FilePath, Handle) mkstemp template = do #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) withCString template $ \ ptr -> do
System/Posix/User.hsc view
@@ -222,7 +222,7 @@ getAllGroupEntries :: IO [GroupEntry] #ifdef HAVE_GETGRENT getAllGroupEntries =- withMVar lock $ \_ -> worker []+ withMVar lock $ \_ -> bracket_ c_setgrent c_endgrent $ worker [] where worker accum = do resetErrno ppw <- throwErrnoIfNullAndError "getAllGroupEntries" $ @@ -234,6 +234,10 @@ foreign import ccall unsafe "getgrent" c_getgrent :: IO (Ptr CGroup)+foreign import ccall unsafe "setgrent"+ c_setgrent :: IO ()+foreign import ccall unsafe "endgrent"+ c_endgrent :: IO () #else getAllGroupEntries = error "System.Posix.User.getAllGroupEntries: not supported" #endif
config.guess view
@@ -1199,6 +1199,9 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;;+ BePC:Haiku:*:*) # BeOS running on Intel PC compatible.+ echo i586-pc-haiku+ exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;;
configure view
@@ -1268,6 +1268,11 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files +Optional Packages:+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)+C compiler+ Some influential environment variables: CC C compiler command CFLAGS C compiler flags@@ -1713,10 +1718,12 @@ # Safety check: Ensure that we are in the correct source directory. -ac_config_headers="$ac_config_headers include/HsUnixConfig.h" +# Check whether --with-cc was given.+if test "${with_cc+set}" = set; then+ withval=$with_cc; CC=$withval+fi -# Is this a Unix system? ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'@@ -2637,6 +2644,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_config_headers="$ac_config_headers include/HsUnixConfig.h"+++# Is this a Unix system?+ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'@@ -5904,7 +5916,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */-#include </usr/include/unistd.h>+#include <unistd.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |@@ -5941,7 +5953,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */-#include </usr/include/stdlib.h>+#include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
configure.ac view
@@ -3,6 +3,11 @@ # Safety check: Ensure that we are in the correct source directory. AC_CONFIG_SRCDIR([include/HsUnix.h]) +AC_ARG_WITH([cc],+ [C compiler],+ [CC=$withval])+AC_PROG_CC()+ AC_CONFIG_HEADERS([include/HsUnixConfig.h]) # Is this a Unix system?@@ -66,13 +71,12 @@ dnl ---------- usleep ---------- dnl --- stolen from guile configure ----dnl --- FIXME: /usr/include/unistd.h can't be right? ### On some systems usleep has no return value. If it does have one, ### we'd like to return it; otherwise, we'll fake it. AC_CACHE_CHECK([return type of usleep], fptools_cv_func_usleep_return_type, [AC_EGREP_HEADER(changequote(<, >)<void[ ]+usleep>changequote([, ]),- /usr/include/unistd.h,+ unistd.h, [fptools_cv_func_usleep_return_type=void], [fptools_cv_func_usleep_return_type=int])]) case "$fptools_cv_func_usleep_return_type" in@@ -85,7 +89,7 @@ ### in common use return void. AC_CACHE_CHECK([return type of unsetenv], fptools_cv_func_unsetenv_return_type, [AC_EGREP_HEADER(changequote(<, >)<void[ ]+unsetenv>changequote([, ]),- /usr/include/stdlib.h,+ stdlib.h, [fptools_cv_func_unsetenv_return_type=void], [fptools_cv_func_unsetenv_return_type=int])]) case "$fptools_cv_func_unsetenv_return_type" in
include/HsUnixConfig.h view
@@ -140,7 +140,7 @@ #define HAVE_LCHOWN 1 /* Define to 1 if you have the <libutil.h> header file. */-/* #undef HAVE_LIBUTIL_H */+#define HAVE_LIBUTIL_H 1 /* Define to 1 if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1@@ -281,7 +281,7 @@ /* #undef USLEEP_RETURNS_VOID */ /* Number of bits in a file offset, on hosts where this is settable. */-/* #undef _FILE_OFFSET_BITS */+#define _FILE_OFFSET_BITS 64 /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */
unix.cabal view
@@ -1,5 +1,5 @@ name: unix-version: 2.4.0.0+version: 2.4.0.1 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org@@ -47,7 +47,7 @@ System.Posix.Signals.Exts System.Posix.Semaphore System.Posix.SharedMem- build-depends: base >= 4.1 && < 4.3+ build-depends: base >= 4.2 && < 4.3 extensions: CPP, ForeignFunctionInterface, EmptyDataDecls include-dirs: include includes: HsUnix.h execvpe.h