diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index 1822294c..b377b9a7 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -380,6 +380,9 @@ setSymbolicLinkTimesHiRes name atime mtime = throwErrnoPathIfMinus1_ "setSymbolicLinkTimesHiRes" name $ c_lutimes s times #else +{-# WARNING setSymbolicLinkTimesHiRes + "System.Posix.Files.setSymbolicLinkTImesHiRes: not available on this platform" + #-} setSymbolicLinkTimesHiRes = error "setSymbolicLinkTimesHiRes: not available on this platform" #endif @@ -406,6 +409,9 @@ touchSymbolicLink name = withFilePath name $ \s -> throwErrnoPathIfMinus1_ "touchSymbolicLink" name (c_lutimes s nullPtr) #else +{-# + WARNING touchSymbolicLink "System.Posix.Files.touchSymbolicLink: not available on this platform" + #-} touchSymbolicLink = error "touchSymbolicLink: not available on this platform" #endif diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc index cb68668c..f2ae1fea 100644 --- a/System/Posix/Files/ByteString.hsc +++ b/System/Posix/Files/ByteString.hsc @@ -382,6 +382,7 @@ setSymbolicLinkTimesHiRes name atime mtime = throwErrnoPathIfMinus1_ "setSymbolicLinkTimesHiRes" name $ c_lutimes s times #else +{-# WARNING setSymbolicLinkTimesHiRes "setSymbolicLinkTimesHiRes: not available on this platform" #-} setSymbolicLinkTimesHiRes = error "setSymbolicLinkTimesHiRes: not available on this platform" #endif @@ -406,6 +407,7 @@ touchSymbolicLink name = withFilePath name $ \s -> throwErrnoPathIfMinus1_ "touchSymbolicLink" name (c_lutimes s nullPtr) #else +{-# WARNING touchSymbolicLink "touchSymbolicLink: not available on this platform" #-} touchSymbolicLink = error "touchSymbolicLink: not available on this platform" #endif diff --git a/System/Posix/Files/Common.hsc b/System/Posix/Files/Common.hsc index 62fff6bc..8161f710 100644 --- a/System/Posix/Files/Common.hsc +++ b/System/Posix/Files/Common.hsc @@ -486,6 +486,7 @@ setFdTimesHiRes (Fd fd) atime mtime = withArray [toCTimeVal atime, toCTimeVal mtime] $ \times -> throwErrnoIfMinus1_ "setFdTimesHiRes" (c_futimes fd times) #else +{-# WARNING setFdTimesHiRes "setFdTimesHiRes: not available on this platform" #-} setFdTimesHiRes = error "setSymbolicLinkTimesHiRes: not available on this platform" #endif @@ -502,6 +503,7 @@ touchFd :: Fd -> IO () touchFd (Fd fd) = throwErrnoIfMinus1_ "touchFd" (c_futimes fd nullPtr) #else +{-# WARNING touchFd "touchFd: not available on this platform" #-} touchFd = error "touchFd: not available on this platform" #endif diff --git a/System/Posix/SharedMem.hsc b/System/Posix/SharedMem.hsc index c85e4b7f..ec180c23 100644 --- a/System/Posix/SharedMem.hsc +++ b/System/Posix/SharedMem.hsc @@ -65,6 +65,7 @@ shmOpen name flags mode = shm_open cname cflags mode return $ Fd fd #else +{-# WARNING shmOpen "System.Posix.SharedMem: shm_open: not available" #-} shmOpen = error "System.Posix.SharedMem:shm_open: not available" #endif @@ -75,6 +76,7 @@ shmUnlink name = withCAString name shmUnlink' where shmUnlink' cname = throwErrnoIfMinus1_ "shmUnlink" $ shm_unlink cname #else +{-# WARNING shmUnlink "System.Posix.SharedMem:shm_unlink: not available" #-} shmUnlink = error "System.Posix.SharedMem:shm_unlink: not available" #endif diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc index d4c6d517..fbd29230 100644 --- a/System/Posix/Signals.hsc +++ b/System/Posix/Signals.hsc @@ -358,6 +358,8 @@ installHandler :: Signal -> IO Handler -- ^ old handler #ifdef __PARALLEL_HASKELL__ +{-# WARNING installHandler "installHandler: not available for Parallel Haskell" + - #-} installHandler = error "installHandler: not available for Parallel Haskell" #else diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index c27645fa..d4bd9cd5 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -83,6 +83,7 @@ mkstemps prefix suffix = do h <- fdToHandle (Fd fd) return (name, h) #else +{-# WARNING mkstemps "System.Posix.Temp.mkstemps: not available on this platform" #-} mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform" #endif diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc index 73230123..f376d1b5 100644 --- a/System/Posix/Temp/ByteString.hsc +++ b/System/Posix/Temp/ByteString.hsc @@ -84,6 +84,7 @@ mkstemps prefix suffix = do h <- fdToHandle (Fd fd) return (name, h) #else +{-# WARNING mkstemps "System.Posix.Temp.mkstemps: not available on this platform" #-} mkstemps = error "System.Posix.Temp.mkstemps: not available on this platform" #endif diff --git a/System/Posix/Terminal.hsc b/System/Posix/Terminal.hsc index be2d040b..d25420bf 100644 --- a/System/Posix/Terminal.hsc +++ b/System/Posix/Terminal.hsc @@ -121,6 +121,7 @@ foreign import ccall unsafe "__hsunix_ptsname" #else getSlaveTerminalName _ = ioError (errnoToIOError "getSlaveTerminalName" eNOSYS Nothing Nothing) +{-# WARNING getSlaveTerminalName "getSlaveTerminalName: not available on this platform" #-} #endif -- ----------------------------------------------------------------------------- @@ -159,6 +160,10 @@ openPseudoTerminal = do # endif /* __hpux */ return (Fd master, slave) +# ifndef HAVE_PTSNAME +{-# WARNING openPseudoTerminal "openPseudoTerminal: not available on this platform (neither OPENPTY nor PTSNAME available)" #-} +# endif /* HAVE_PTSNAME */ + -- Push a STREAMS module, for System V systems. pushModule :: Fd -> String -> IO () pushModule (Fd fd) name = diff --git a/System/Posix/Terminal/ByteString.hsc b/System/Posix/Terminal/ByteString.hsc index ad2dd26c..5c4ef5f2 100644 --- a/System/Posix/Terminal/ByteString.hsc +++ b/System/Posix/Terminal/ByteString.hsc @@ -128,6 +128,7 @@ getSlaveTerminalName (Fd fd) = do foreign import ccall unsafe "__hsunix_ptsname" c_ptsname :: CInt -> IO CString #else +{-# WARNING getSlaveTerminalName "getSlaveTerminalName: not available on this platform" #-} getSlaveTerminalName _ = ioError (errnoToIOError "getSlaveTerminalName" eNOSYS Nothing Nothing) #endif diff --git a/System/Posix/Unistd.hsc b/System/Posix/Unistd.hsc index db69bc23..59af0f96 100644 --- a/System/Posix/Unistd.hsc +++ b/System/Posix/Unistd.hsc @@ -145,6 +145,7 @@ foreign import ccall safe "usleep" -- /GHC Note/: the comment for 'usleep' also applies here. nanosleep :: Integer -> IO () #ifndef HAVE_NANOSLEEP +{-# WARNING nanosleep "nanosleep: not available on this platform" #-} nanosleep = error "nanosleep: not available on this platform" #else nanosleep 0 = return () diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc index 50c9f41d..237b8984 100644 --- a/System/Posix/User.hsc +++ b/System/Posix/User.hsc @@ -211,6 +211,7 @@ foreign import capi unsafe "HsUnix.h getgrgid_r" c_getgrgid_r :: CGid -> Ptr CGroup -> CString -> CSize -> Ptr (Ptr CGroup) -> IO CInt #else +{-# WARNING getGroupEntryForID "System.Posix.User.getGroupEntryForID: not supported" #-} getGroupEntryForID = error "System.Posix.User.getGroupEntryForID: not supported" #endif @@ -230,6 +231,7 @@ foreign import capi unsafe "HsUnix.h getgrnam_r" c_getgrnam_r :: CString -> Ptr CGroup -> CString -> CSize -> Ptr (Ptr CGroup) -> IO CInt #else +{-# WARNING getGroupEntryForName "System.Posix.User.getGroupEntryForName: not supported" #-} getGroupEntryForName = error "System.Posix.User.getGroupEntryForName: not supported" #endif @@ -261,6 +263,7 @@ foreign import ccall unsafe "setgrent" foreign import ccall unsafe "endgrent" c_endgrent :: IO () #else +{-# WARNING getAllGroupEntries "System.Posix.User.getAllGroupEntries: not supported" #-} getAllGroupEntries = error "System.Posix.User.getAllGroupEntries: not supported" #endif @@ -332,6 +335,7 @@ getUserEntryForID uid = do foreign import ccall unsafe "getpwuid" c_getpwuid :: CUid -> IO (Ptr CPasswd) #else +{-# WARNING getUserEntryForID "System.Posix.User.getUserEntryForID: not supported" #-} getUserEntryForID = error "System.Posix.User.getUserEntryForID: not supported" #endif @@ -360,6 +364,7 @@ getUserEntryForName name = do foreign import ccall unsafe "getpwnam" c_getpwnam :: CString -> IO (Ptr CPasswd) #else +{-# WARNING getUserEntryForName "System.Posix.User.getUserEntryForName: not supported" #-} getUserEntryForName = error "System.Posix.User.getUserEntryForName: not supported" #endif @@ -385,6 +390,7 @@ foreign import ccall unsafe "setpwent" foreign import ccall unsafe "endpwent" c_endpwent :: IO () #else +{-# WARNING getAllUserEntries "System.Posix.User.getAllUserEntries: not supported" #-} getAllUserEntries = error "System.Posix.User.getAllUserEntries: not supported" #endif