{-# LINE 1 "System/Posix/Env/Internal.hsc" #-}
module System.Posix.Env.Internal where



import Foreign
import Foreign.C

getEnvironmentPrim :: IO [Ptr CChar]
getEnvironmentPrim = do
  c_environ <- getCEnviron
  if c_environ == nullPtr
    then return []
    else do
      peekArray0 nullPtr c_environ

getCEnviron :: IO (Ptr CString)

{-# LINE 25 "System/Posix/Env/Internal.hsc" #-}
getCEnviron = peek c_environ_p

foreign import ccall unsafe "&environ"
   c_environ_p :: Ptr (Ptr CString)

{-# LINE 30 "System/Posix/Env/Internal.hsc" #-}