More error message updates
getEffectiveUserName :: IO String
getEffectiveUserName = do
getEffectiveUserName :: IO String
getEffectiveUserName = do
+ {- cuserid() is deprecated, using getpwuid() instead. -}
+ euid <- getEffectiveUserID
+ ptr <- _ccall_ getpwuid euid
+ str <- _casm_ ``%r = ((struct passwd *)%0)->pw_name;'' (ptr::Addr)
+ strcpy str
+
+{- OLD:
str <- _ccall_ cuserid (``NULL''::Addr)
if str == ``NULL''
then syserr "getEffectiveUserName"
else strcpy str
str <- _ccall_ cuserid (``NULL''::Addr)
if str == ``NULL''
then syserr "getEffectiveUserName"
else strcpy str
getProcessGroupID :: IO ProcessGroupID
getProcessGroupID = _ccall_ getpgrp
getProcessGroupID :: IO ProcessGroupID
getProcessGroupID = _ccall_ getpgrp
getControllingTerminalName = do
str <- _ccall_ ctermid (``NULL''::Addr)
if str == ``NULL''
getControllingTerminalName = do
str <- _ccall_ ctermid (``NULL''::Addr)
if str == ``NULL''
- then fail (IOError Nothing NoSuchThing "getControllingTerminalName: no controlling terminal")
+ then fail (IOError Nothing NoSuchThing "getControllingTerminalName" "no controlling terminal")
err <- try (queryTerminal fd)
either (\err -> syserr "getTerminalName")
(\succ -> if succ then fail (IOError Nothing NoSuchThing
err <- try (queryTerminal fd)
either (\err -> syserr "getTerminalName")
(\succ -> if succ then fail (IOError Nothing NoSuchThing
- "getTerminalName: no name")
+ "getTerminalName" "no name")
else fail (IOError Nothing InappropriateType
else fail (IOError Nothing InappropriateType
- "getTerminalName: not a terminal"))
+ "getTerminalName" "not a terminal"))
if rc /= -1
then return rc
else fail (IOError Nothing NoSuchThing
if rc /= -1
then return rc
else fail (IOError Nothing NoSuchThing
- "getSysVar: no such system limit or option")
+ "getSysVar"
+ "no such system limit or option")
str <- _ccall_ getenv str
if str == ``NULL''
then fail (IOError Nothing NoSuchThing
str <- _ccall_ getenv str
if str == ``NULL''
then fail (IOError Nothing NoSuchThing
- "getEnvVar: no such environment variable")
+ "getEnvVar" "no such environment variable")
else strcpy str
setEnvVar :: String -> String -> IO ()
else strcpy str
setEnvVar :: String -> String -> IO ()
-> IO Handler -- old handler
#ifdef __PARALLEL_HASKELL__
-> IO Handler -- old handler
#ifdef __PARALLEL_HASKELL__
-installHandler = error "installHandler: not available for Parallel Haskell"
+installHandler = fail (userError "installHandler: not available for Parallel Haskell")
#else
installHandler int handler maybe_mask = (
case handler of
#else
installHandler int handler maybe_mask = (
case handler of