| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
| |
Closes #27
|
|
|
|
|
|
|
|
|
| |
CPP conditional code sections have been carefully taken into account
while performing this warning cleanup. Most `OPTIONS_GHC` declarations
could be dropped (now only a lonely `{-# OPTIONS_GHC -fno-cse #-}`
remains in `Posix.Signals`).
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
| |
Only language extensions not active when `-XHaskell2010` is enabled are
declared, this way we can drop many redundant
`{-# LANGUAGE ForeignFunctionInterface #-}` occurences. This commit also
removes/replaces some `{-# OPTIONS_GHC -XRecordWildCards #-}` pragmas.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
| |
and remove code to support older versions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new module System.Posix.ByteString provides exactly the same API
as System.Posix, except that:
- There is a new type: RawFilePath = ByteString
- All functions mentioning FilePath in the System.Posix API
use RawFilePath in the System.Posix.ByteString API
- RawFilePaths are not subject to Unicode locale encoding and
decoding, unlike FilePaths. They are the exact bytes passed to and
returned from the underlying POSIX API.
- Similarly for functions that deal in environment
strings (System.Posix.Env): these use untranslated ByteStrings
in System.Posix.Environment
- There is a new function
System.Posix.ByteString.getArgs :: [ByteString]
returning the raw untranslated arguments as passed to exec() when
the program was started.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
by copying foreign imports here from System.Posix.Internals
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-- | Read data from an 'Fd' into memory. This is exactly equivalent
-- to the POSIX @read@ function.
fdReadBuf :: Fd
-> Ptr Word8 -- ^ Memory in which to put the data
-> ByteCount -- ^ Maximum number of bytes to read
-> IO Bytecount -- ^ Number of bytes read (zero for EOF)
-- | Write data from memory to an 'Fd'. This is exactly equivalent
-- to the POSIX @write@ function.
fdWriteBuf :: Fd
-> Ptr Word8 -- ^ Memory containing the data to write
-> ByteCount -- ^ Maximum number of bytes to write
-> IO ByteCount -- ^ Number of bytes written
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(of the dubiously exported c_access and c_fcntl_write)
|
|
|
|
| |
some Haddock docs, from Isaac Jones.
|
|
|
|
| |
Fix queryFdOption
|
|
|
|
| |
Doc for handleToFd and fdToHandle
|
|
|
|
|
|
|
|
|
| |
Add filenames to all errors where it makes sense. I've added
System.Posix.Error with a new family of error-throwing functions,
throwErrnoPath*. This seemed to make the most sense: they don't
belong in Foreign.C.Error (C by itself has no notion of paths).
Fixes: [ 954378 ] getFileStatus does not include the file name in IO-Error
|
|
|
|
|
|
|
| |
- fix typo in error message
- a bit of manual CSE for fcntl-flags
- use Data.Bits instead of brains
- make (unexported) function names a bit more consistent
|
|
|
|
|
|
| |
fdRead: drop superfluous array copying
merge to stable
|
|
|
|
| |
Hugs only: add handleToFd
|
|
|
|
| |
Hugs only: make fdToHandle available
|
|
|
|
| |
use System.Posix.Internals
|
|
|
|
| |
wibble: add a newline at the end of the file
|
|
|
|
|
| |
- Add documentation for fd{Read,Write} & createPipe
- Unbreak setFdOption which didn't set any options at all
|
|
|
|
|
| |
Move fd{Read,Write} to new layout. Use of memcpy() should bring a large
performance increase compared to the old version.
|
|
|
|
|
|
|
|
|
| |
Fill in some more bits in the new Unix library: specifically the
contents of PosixTTY and PosixDB (now System.Posix.Terminal and
System.Posix.User respectively).
We're now about 95% complete w.r.t. the old posix library. I've
identified the reminaing bits to do in System/Posix.hs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes to the exception interface, as discussed on the libraries list.
1) Move bracket and bracket_ from GHC.Exception (and hence System.IO)
to haskell98/IO.hs. These two should now never be used (except in
all-H98 programs), and this will save users of the new libraries from
having to hide them. Use the ones in Control.Exception instead.
2) Define
type IOError = IOException -- was Exception
leaving the type of Prelude.ioError as IOError -> IO a,
but adding to Control.Exception
throwIO :: Exception -> IO a
The result is a type distinction between the variants of catch and try:
Prelude.catch :: IO a -> (IOError -> IO a) -> IO a
Control.Exception.catch :: IO a -> (Exception -> IO a) -> IO a
System.IO.Error.try :: IO a -> IO (Either IOError a)
Control.Exception.try :: IO a -> IO (Either Exception a)
These are breaking changes: the first one affects only import lists,
but the second will bite in the following situations:
- using ioError on general Exceptions: use throwIO instead.
- using throw on IOErrors: if in the IO monad, use ioError instead.
Otherwise, use throw (IOException e), but why are you throwing
IO exceptions outside of the IO monad?
Minor changes:
- System.IO.Error now exports catch and try
- moved try from GHC.Exception to System.IO.Error, because it's
portable and can be shared by Hugs.
|
|
|
|
|
|
|
|
|
| |
Make the new Posix bindings compile on Mac OS X.
Most notable, Mac OS X lacks
*) lchown
*) SIGPOLL
I don't know of a replacement of either, so they are just left out when
they are not detected by configure.
|
|
|
|
|
| |
4th attempt to get a working RPM, but again: Make Haddock happy. Is
doing a "make html" that hard before committing...? :-]
|
|
More POSIX bits... we're getting there.
|