packages/unix.git
3 years agoKill `-fwarn-unused-imports`-induced silliness
Herbert Valerio Riedel [Mon, 16 Nov 2015 18:37:56 +0000 (19:37 +0100)] 
Kill `-fwarn-unused-imports`-induced silliness

This all started in e968172cb0c9f4fc653c775faf3ecb661f5b1948 which tried
to get rid of redundant import warnings. But we should rather err on
having to tolerate a few warnings on exotic configurations rather than
breaking a build...

This hopefully fixes #36

3 years agoDon't assume existence of termios constants beyond `B38400`
Herbert Valerio Riedel [Mon, 16 Nov 2015 18:03:12 +0000 (19:03 +0100)] 
Don't assume existence of termios constants beyond `B38400`

This patch does not modify the `BaudRate` structure but rather causes
some functions taking a `BaudRate` to throw exceptions on systems which
don't provide `B57600` and/or `B115200`. I'm not totally happy with this
patch yet, but this unbreaks compilation on platforms which don't define
at least of these constants.

This fixes #51

3 years agoDon't assume non-POSIX `WCOREDUMP(x)` macro exists
Herbert Valerio Riedel [Mon, 16 Nov 2015 17:49:46 +0000 (18:49 +0100)] 
Don't assume non-POSIX `WCOREDUMP(x)` macro exists

This fixes #50

3 years agoRelax upper bound on `base` for base-4.9
Herbert Valerio Riedel [Wed, 28 Oct 2015 21:34:34 +0000 (22:34 +0100)] 
Relax upper bound on `base` for base-4.9

4 years agoMerge pull request #42 from argiopetech/master
Elliot Robinson [Mon, 9 Mar 2015 08:09:37 +0000 (04:09 -0400)] 
Merge pull request #42 from argiopetech/master

Adds a more comprehensive check for fdatasync

4 years agoAdds a more comprehensive check for fdatasync
Elliot Robinson [Sun, 8 Mar 2015 19:55:05 +0000 (15:55 -0400)] 
Adds a more comprehensive check for fdatasync

Some versions of OS X have fdatasync in the headers but don't include implementations in the standard library. This leads to a compile failure in configure.ac when using AC_CHECK_FUNCS.

This change explicitly attempts to compile a file containing a call to fdatasync and properly sets the AC_CHECK_FUNCS flags depending on the result of compilation.

4 years agoAdd GHC 7.8.4 to test-matrix
Herbert Valerio Riedel [Sat, 27 Dec 2014 18:18:50 +0000 (19:18 +0100)] 
Add GHC 7.8.4 to test-matrix

4 years agoMerge pull request #32 from redneb/getcwd-exn-safe
Gregory Collins [Wed, 24 Dec 2014 00:51:17 +0000 (19:51 -0500)] 
Merge pull request #32 from redneb/getcwd-exn-safe

rewrite getWorkingDirectory to use allocaBytes for exception safety

4 years agoAdd GHC 7.10.1 to test-matrix
Herbert Valerio Riedel [Tue, 23 Dec 2014 10:17:22 +0000 (11:17 +0100)] 
Add GHC 7.10.1 to test-matrix

4 years agorewrite getWorkingDirectory to use allocaBytes for exception safety
Marios Titas [Tue, 23 Dec 2014 06:21:57 +0000 (06:21 +0000)] 
rewrite getWorkingDirectory to use allocaBytes for exception safety

4 years agoAdd /Since/ annotation to System.Posix.Fcntl v2.7.1.0
Herbert Valerio Riedel [Fri, 19 Dec 2014 09:51:27 +0000 (10:51 +0100)] 
Add /Since/ annotation to System.Posix.Fcntl

4 years agoPrepare for 2.7.1.0 release
Herbert Valerio Riedel [Fri, 19 Dec 2014 09:02:18 +0000 (10:02 +0100)] 
Prepare for 2.7.1.0 release

4 years agoTweak markdown markup again [skip ci]
Herbert Valerio Riedel [Fri, 19 Dec 2014 09:01:32 +0000 (10:01 +0100)] 
Tweak markdown markup again [skip ci]

4 years agoFix markdown markup [skip ci]
Herbert Valerio Riedel [Fri, 19 Dec 2014 08:59:44 +0000 (09:59 +0100)] 
Fix markdown markup [skip ci]

4 years agoTighten SafeHaskell
Herbert Valerio Riedel [Fri, 19 Dec 2014 08:57:00 +0000 (09:57 +0100)] 
Tighten SafeHaskell

This was forgotten in e14fbe2cb3bbd604dadcc3847882ca37edf548b3

4 years agoFix SIGINFO and SIGWINCH.
Erik de Castro Lopo [Fri, 19 Dec 2014 03:47:43 +0000 (14:47 +1100)] 
Fix SIGINFO and SIGWINCH.

It seems these two signals have not been working since at least
2009. Detection of these signals seems to have never been added to
the configure.ac script and the code guarded by #ifdef then bit-rotted
(the idiom used to handle these signals seems to have been abandoned
for something simpler/better in 2009). This fix simply handles these
signals the same way the other signals are handled in
System/Posix/Signals.hsc.

Closes #30 and #31

4 years agoBe more explicit in WARNING what will be thrown
Herbert Valerio Riedel [Mon, 15 Dec 2014 22:33:15 +0000 (23:33 +0100)] 
Be more explicit in WARNING what will be thrown

4 years agoAdd since-annotations to new fileSync ops
Herbert Valerio Riedel [Mon, 15 Dec 2014 22:28:20 +0000 (23:28 +0100)] 
Add since-annotations to new fileSync ops

4 years agoWrap posix_fadvise(2) and posix_fallocate(2)
Herbert Valerio Riedel [Mon, 15 Dec 2014 22:25:26 +0000 (23:25 +0100)] 
Wrap posix_fadvise(2) and posix_fallocate(2)

This adds two new functions in `System.Posix.Unistd`

 - `fileAdvise` (aka `posix_fadvise(2)`), and
 - `fileAllocate` (aka `posix_fallocate(2)`)

This is based in part on #7 and has been heavily refactored from its
original patch submission by Ricardo Catalinas Jiménez.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
4 years agoMerge pull request #29 from haskell/safefixes710again
Herbert Valerio Riedel [Tue, 9 Dec 2014 16:46:41 +0000 (17:46 +0100)] 
Merge pull request #29 from haskell/safefixes710again

More fixes for Safe Haskell bounds under GHC 7.10

4 years agoMore fixes for Safe Haskell bounds under GHC 7.10 safefixes710again
David Terei [Tue, 9 Dec 2014 06:03:15 +0000 (22:03 -0800)] 
More fixes for Safe Haskell bounds under GHC 7.10

4 years agoTweak execvpe.h hack (see 256b19184bcb) some more
Herbert Valerio Riedel [Sun, 7 Dec 2014 15:01:51 +0000 (16:01 +0100)] 
Tweak execvpe.h hack (see 256b19184bcb) some more

4 years agoWrap fsync(2) and fdatasync(2)
Herbert Valerio Riedel [Sun, 7 Dec 2014 14:29:10 +0000 (15:29 +0100)] 
Wrap fsync(2) and fdatasync(2)

This adds two new functions in `System.Posix.Unistd`

 - `fileSynchronise` (aka `fsync(2)`), and
 - `fileSynchroniseDataOnly` (aka `fdatasync(2)`)

This is based on part of #7 and has been heavily refactored from its
original patch submission by Ricardo Catalinas Jiménez.

This also bumps version to 2.7.1.0 as a minor version bump is now needed.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
4 years agoRepeat execvpe(3) prototype (fup to 7bad9d7d52d)
Herbert Valerio Riedel [Sat, 6 Dec 2014 21:29:51 +0000 (22:29 +0100)] 
Repeat execvpe(3) prototype (fup to 7bad9d7d52d)

This is needed in case `<unistd.h>` was included before "execvpe.h"
w/o `_GNU_SOURCE` set (on Glibc systems)

4 years agoHave "execvpe.h" provide execvpe() again
Herbert Valerio Riedel [Sat, 6 Dec 2014 20:11:59 +0000 (21:11 +0100)] 
Have "execvpe.h" provide execvpe() again

Turns out `process` reuses `unix`'s execvpe() implementation,
and the refactoring in f24ba78f68b2cbc4f4afadc8dd60fc2935357255
broke process.

4 years ago`M-x untabify` && `M-x delete-trailing-whitespace`
Herbert Valerio Riedel [Sat, 6 Dec 2014 16:08:06 +0000 (17:08 +0100)] 
`M-x untabify` && `M-x delete-trailing-whitespace`

4 years agoRetry process execution in case of ENOTDIR
Iku Iwasa [Sat, 2 Aug 2014 13:02:23 +0000 (22:02 +0900)] 
Retry process execution in case of ENOTDIR

If `PATH` environment variable contains non directory component,
`__hsunix_execvpe()` failed by `ENOTDIR`.

This fixes #11 for all platforms.

4 years agoRefactor local `execvpe(3)` implementation
Herbert Valerio Riedel [Sat, 6 Dec 2014 14:39:12 +0000 (15:39 +0100)] 
Refactor local `execvpe(3)` implementation

The previous code was prone to conflicts with when the platform happens
to expose a `execvpe(3)` implementation in its libc.

This commit renames the internal implementation to `__hsunix_execvpe` as
well as adding an autoconf-detection for the presence of `execvpe(3)`,
in which case `__hsunix_execvpe()` forwards the call to `execvpe(3)`.

Moreover, the code has been cleaned up to remove likely bitrotted CPP
conditionals.

This should fix #22

(This also partially addresses #11 on platforms which have a
libc-provided `execvpe(3)`)

4 years agoDo not blindly add libdl to extra libraries
Igor Pashev [Tue, 19 Aug 2014 12:23:35 +0000 (16:23 +0400)] 
Do not blindly add libdl to extra libraries

On some systems dlopen() is available without libdl (illumos, solaris).
Sometimes libdl.so cannot be loaded by runtime linker, see
https://ghc.haskell.org/trac/ghc/ticket/8713

Closes #8

4 years agoTighten Safe Haskell bounds, fixes new warning in GHC 7.10.
David Terei [Thu, 13 Nov 2014 02:12:18 +0000 (18:12 -0800)] 
Tighten Safe Haskell bounds, fixes new warning in GHC 7.10.

Closes #27

4 years agoKill spurious line from changelog
Herbert Valerio Riedel [Sat, 6 Dec 2014 12:50:30 +0000 (13:50 +0100)] 
Kill spurious line from changelog

[skip ci]

4 years agofixup Travis CI job
Herbert Valerio Riedel [Sat, 6 Dec 2014 12:48:10 +0000 (13:48 +0100)] 
fixup Travis CI job

4 years agoUpdate Travis CI Job
Herbert Valerio Riedel [Sat, 6 Dec 2014 12:19:20 +0000 (13:19 +0100)] 
Update Travis CI Job

4 years agoMerge pull request #18 from neverpanic/master
Herbert Valerio Riedel [Fri, 7 Nov 2014 10:16:25 +0000 (11:16 +0100)] 
Merge pull request #18 from neverpanic/master

`System.Posix.Files.fileAccess` fails inside OS X sandbox

4 years agoAdd hackage-shield to README.md
Herbert Valerio Riedel [Thu, 23 Oct 2014 07:36:57 +0000 (09:36 +0200)] 
Add hackage-shield to README.md

4 years agoMerge pull request #5 from hvr/pr-LFS
Herbert Valerio Riedel [Sat, 18 Oct 2014 15:08:52 +0000 (17:08 +0200)] 
Merge pull request #5 from hvr/pr-LFS

Fix potential LFS related issues

4 years agofix _FILE_OFFSET_BITS redefined warning on Solaris/x86
Karel Gardas [Fri, 25 Jul 2014 21:42:00 +0000 (23:42 +0200)] 
fix _FILE_OFFSET_BITS redefined warning on Solaris/x86

The issue is that sys/types.h header on Solaris includes somehow
/usr/include/sys/feature_tests.h which tests if _FILE_OFFSET_BITS
is defined and if not, then it defines it to 32 if we're compiling
32 bit code (x86). This is simply wrong since we'd like to have it
defined to 64. The issue is solved by including HsUnixConfig.h first
which defines _FILE_OFFSET_BITS to 64 and feature_tests.h is later
OK with that.

4 years agoUse CAPI FFI imports for `truncate`
Herbert Valerio Riedel [Thu, 7 Aug 2014 10:33:51 +0000 (12:33 +0200)] 
Use CAPI FFI imports for `truncate`

This makes sure we pick up the LFS version of `truncate` in case `off_t`
is affected by CPP defines such as `_FILE_OFFSET_BITS`.

4 years agoUse correct POSIX offset-type for tell/seekdir
Herbert Valerio Riedel [Thu, 7 Aug 2014 10:23:07 +0000 (12:23 +0200)] 
Use correct POSIX offset-type for tell/seekdir

This fixes the FFI imports to use the proper `CLong` type over the
previous incorrect `COff` type, as using the wrong argument type can
cause problems when the `long` and `off_t` types have different size.

Historic note from the manual page:

  In glibc up to version 2.1.1, the return type of telldir() was off_t.
  POSIX.1-2001 specifies long, and this is the type used since glibc
  2.1.2 (released in 1999).

4 years agoReplace obsolete `defaultUserHooks` by `autoconfUserHooks`
Herbert Valerio Riedel [Sat, 27 Sep 2014 07:52:28 +0000 (09:52 +0200)] 
Replace obsolete `defaultUserHooks` by `autoconfUserHooks`

4 years agoMerge pull request #19 from thomie/master
Herbert Valerio Riedel [Fri, 26 Sep 2014 17:32:15 +0000 (19:32 +0200)] 
Merge pull request #19 from thomie/master

Disable getlogin tests for the moment (#1487)

4 years agoDisable getlogin tests for the moment (#1487)
Thomas Miedema [Fri, 26 Sep 2014 17:03:05 +0000 (19:03 +0200)] 
Disable getlogin tests for the moment (#1487)

4 years agoAccept EPERM as valid error code for access(2)
Clemens Lang [Sun, 21 Sep 2014 15:49:16 +0000 (17:49 +0200)] 
Accept EPERM as valid error code for access(2)

This is useful on OS X when its sandboxing mechanism is used, because
that will set errno = EPERM when a file can't be written due to
sandboxing (as opposed to setting it to EACCES when file permissions
deny writing).

4 years agoUnify accepted errno flags for access
Clemens Lang [Sun, 21 Sep 2014 15:45:56 +0000 (17:45 +0200)] 
Unify accepted errno flags for access

The ByteString variant of the access function didn't accept the same
flags as the non-ByteString one, but it makes sense that the OS doesn't
care about which one is being used and returns all error codes for both
variants.

4 years agoUnify whitespace in System/Posix/Files/ByteString
Clemens Lang [Sun, 21 Sep 2014 15:45:01 +0000 (17:45 +0200)] 
Unify whitespace in System/Posix/Files/ByteString

4 years agoUpdate config.{guess,sub} to GNU automake 1.14.1
Herbert Valerio Riedel [Tue, 16 Sep 2014 10:05:40 +0000 (12:05 +0200)] 
Update config.{guess,sub} to GNU automake 1.14.1

4 years agoRelax upper bound to allow `time-1.5`
Herbert Valerio Riedel [Wed, 10 Sep 2014 20:51:21 +0000 (22:51 +0200)] 
Relax upper bound to allow `time-1.5`

4 years agoUse import list for `Data.Time.Clock.POSIX`
Herbert Valerio Riedel [Wed, 10 Sep 2014 20:48:39 +0000 (22:48 +0200)] 
Use import list for `Data.Time.Clock.POSIX`

This makes it more obvious why `unix` depends on `time` in the first
place, i.e. for the sole purpose of reusing the `POSIXTime` type.

4 years agoMerge branch 'sol-fix-getgrgid_r-v3' of https://github.com/kgardas/unix into kgardas...
Herbert Valerio Riedel [Wed, 10 Sep 2014 09:34:44 +0000 (11:34 +0200)] 
Merge branch 'sol-fix-getgrgid_r-v3' of https://github.com/kgardas/unix into kgardas-sol-fix-getgrgid_r-v3

Conflicts:
changelog.md

4 years agofix getGroupEntryForID/Name on Solaris
Karel Gardas [Mon, 8 Sep 2014 18:17:47 +0000 (20:17 +0200)] 
fix getGroupEntryForID/Name on Solaris

This patch fixes getGroupEntryForID and getGroupEntryForName on Solaris
The issue on Solaris is that it defines both required getgrgid_r
and getgrnam_r functions as CPP macros which depending on configuration
are mapped to real function implementations with different names.
The issue is solved by using C API calling convention instead of platform
C ABI calling convention.

4 years agoBump `base` constraint for AMP
Herbert Valerio Riedel [Tue, 9 Sep 2014 15:32:01 +0000 (17:32 +0200)] 
Bump `base` constraint for AMP

5 years agoMerge pull request #10 from ezyang/ezyang-dev
Herbert Valerio Riedel [Fri, 22 Aug 2014 22:05:29 +0000 (00:05 +0200)] 
Merge pull request #10 from ezyang/ezyang-dev

Ignore test output created by GHC test suite.

5 years agoIgnore test output created by GHC test suite.
Edward Z. Yang [Fri, 22 Aug 2014 13:20:06 +0000 (14:20 +0100)] 
Ignore test output created by GHC test suite.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoMerge pull request #1 from thomie/master
Gregory Collins [Tue, 15 Jul 2014 11:16:07 +0000 (13:16 +0200)] 
Merge pull request #1 from thomie/master

Enable test for getLoginName (Fixes #1487)

5 years agoMerge pull request #2 from thomie/T8902
Bryan O'Sullivan [Fri, 11 Jul 2014 15:39:07 +0000 (16:39 +0100)] 
Merge pull request #2 from thomie/T8902

Add haddock comments on RTLD_NEXT and RTLD_DEFAULT

5 years agoIgnore interp.stderr/stdout.
Edward Z. Yang [Mon, 7 Jul 2014 13:58:08 +0000 (14:58 +0100)] 
Ignore interp.stderr/stdout.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoDeprecate function `haveRtldLocal`
Thomas Miedema [Fri, 4 Jul 2014 15:53:07 +0000 (17:53 +0200)] 
Deprecate function `haveRtldLocal`

The function haveRtldLocal was introduced for compatibility with Cygwin
on Mar 28 2002 in GHC commit 4740cf56c774b92e02d31b4666158d70c2e85a8f.

According to https://cygwin.com/viewvc/src/winsup/cygwin/include/dlfcn.h
RTLD_LOCAL has been available on Cygwin since Revision 1.4 (August 9 2010).

5 years agoRemove unnecessary checks for RTLD_NOW and RTLD_GLOBAL
Thomas Miedema [Fri, 4 Jul 2014 15:23:58 +0000 (17:23 +0200)] 
Remove unnecessary checks for RTLD_NOW and RTLD_GLOBAL

These checks were introduced for OpenBSD on July 16 2002 in GHC commit
03e9edb3094fd3bb38ed886b96ee9f61f39e9b53.

According to http://www.openbsd.org/cgi-bin/cvsweb/src/include/dlfcn.h
RTLD_NOW, RTLD_GLOBAL and RTLD_LOCAL have been available on OpenBSD
since Revision 1.8 (September 2 2003).

This is merely code cleanup.

5 years agoAdd haddock comments on RTLD_NEXT and RTLD_DEFAULT
Thomas Miedema [Fri, 4 Jul 2014 14:42:21 +0000 (16:42 +0200)] 
Add haddock comments on RTLD_NEXT and RTLD_DEFAULT

Related ticket: #8902.

5 years agoEnable test for getLoginName
Thomas Miedema [Thu, 26 Jun 2014 21:23:15 +0000 (23:23 +0200)] 
Enable test for getLoginName

Fixes #1487.

Make use of no_stdin test option, introduced explictly for this purpose
in fa52a8c9d8eae5e3fc4c0cf0e5672875e161e05c

5 years agoMerge https://github.com/haskell/unix
Herbert Valerio Riedel [Thu, 26 Jun 2014 22:05:14 +0000 (00:05 +0200)] 
Merge https://github.com/haskell/unix

5 years agoadd testsuite-related gitignore entries
Herbert Valerio Riedel [Thu, 26 Jun 2014 21:20:54 +0000 (23:20 +0200)] 
add testsuite-related gitignore entries

5 years agoUpdate URLs to point to GitHub
Herbert Valerio Riedel [Mon, 28 Apr 2014 08:38:51 +0000 (10:38 +0200)] 
Update URLs to point to GitHub

5 years agoTypo in comment
Gabor Greif [Sun, 23 Mar 2014 20:27:14 +0000 (21:27 +0100)] 
Typo in comment

5 years agoMerge branch 'ghc-7.8'
Herbert Valerio Riedel [Sat, 22 Mar 2014 16:37:02 +0000 (17:37 +0100)] 
Merge branch 'ghc-7.8'

Re-unite branches which diverged for now good reason

Conflicts:
changelog.md

5 years agoUpdate changelog and prepare for 2.7.0.1 release ghc-7.8 ghc-7.8.1-release ghc-7.8.2-release unix-2.7.0.1-release
Herbert Valerio Riedel [Sat, 22 Mar 2014 16:28:41 +0000 (17:28 +0100)] 
Update changelog and prepare for 2.7.0.1 release

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agofix getFileStatus: interrupted (Interrupted system call) build failure on Solaris
Karel Gardas [Wed, 26 Feb 2014 11:14:26 +0000 (12:14 +0100)] 
fix getFileStatus: interrupted (Interrupted system call) build failure on Solaris

Patch provided by Christian Maeder <Christian.Maeder@dfki.de>

Signed-off-by: Karel Gardas <karel.gardas@centrum.cz>
Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit f4d0e106f237d767156b3c751f1b9f4598f2a6a1)

5 years agofix getFileStatus: interrupted (Interrupted system call) build failure on Solaris
Karel Gardas [Wed, 26 Feb 2014 11:14:26 +0000 (12:14 +0100)] 
fix getFileStatus: interrupted (Interrupted system call) build failure on Solaris

Patch provided by Christian Maeder <Christian.Maeder@dfki.de>

Signed-off-by: Karel Gardas <karel.gardas@centrum.cz>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoM-x delete-trailing-whitespace & M-x untabify
Herbert Valerio Riedel [Thu, 6 Feb 2014 11:33:55 +0000 (12:33 +0100)] 
M-x delete-trailing-whitespace & M-x untabify

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 86d798975357c55fd0e5303c83f09844411c3837)

5 years agoHandle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741)
Alain O'Dea [Wed, 5 Feb 2014 21:24:28 +0000 (21:24 +0000)] 
Handle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741)

This extends `System.Posix.Files.`access` to map EROFS & ETXTBSY to
mean permission denied just like EACCESS.

Based on a patch by Alain O'Dea and comments by Duncan Coutts

Authored-by: Alain O'Dea <alain.odea@verafin.com>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit ecc92abad017cf12d8eb83509d4d57ae14ad47f9)

5 years agoConvert `changelog` to markdown format
Herbert Valerio Riedel [Sun, 2 Feb 2014 10:03:00 +0000 (11:03 +0100)] 
Convert `changelog` to markdown format

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 4a08984afe5390d91f10f9b1caf7365e6a93595b)

5 years agoM-x delete-trailing-whitespace & M-x untabify
Herbert Valerio Riedel [Thu, 6 Feb 2014 11:33:55 +0000 (12:33 +0100)] 
M-x delete-trailing-whitespace & M-x untabify

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoHandle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741)
Alain O'Dea [Wed, 5 Feb 2014 21:24:28 +0000 (21:24 +0000)] 
Handle EROFS/ETXTBSY as permission denied in `fileAccess` (re #8741)

This extends `System.Posix.Files.`access` to map EROFS & ETXTBSY to
mean permission denied just like EACCESS.

Based on a patch by Alain O'Dea and comments by Duncan Coutts

Authored-by: Alain O'Dea <alain.odea@verafin.com>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoConvert `changelog` to markdown format
Herbert Valerio Riedel [Sun, 2 Feb 2014 10:03:00 +0000 (11:03 +0100)] 
Convert `changelog` to markdown format

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoExport `forkProcessWithUnmask` from `System.Posix.Process` unix-2.7.0.0-release
Herbert Valerio Riedel [Fri, 8 Nov 2013 15:33:11 +0000 (16:33 +0100)] 
Export `forkProcessWithUnmask` from `System.Posix.Process`

This is a follow-up to 17192d89e6 which missed that export.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd `cabal install` step to Travis CI script
Herbert Valerio Riedel [Fri, 8 Nov 2013 15:18:17 +0000 (16:18 +0100)] 
Add `cabal install` step to Travis CI script

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years ago`M-x untabify` & `M-x delete-trailing-whitespace`
Herbert Valerio Riedel [Fri, 8 Nov 2013 14:48:18 +0000 (15:48 +0100)] 
`M-x untabify` & `M-x delete-trailing-whitespace`

...on recently touched files

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix markup for function names in DEPRECATION messages
Herbert Valerio Riedel [Fri, 8 Nov 2013 11:54:22 +0000 (12:54 +0100)] 
Fix markup for function names in DEPRECATION messages

This helps Haddock make tose hyperlinked functions.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd `forkProcessWithUnmask` function
Herbert Valerio Riedel [Fri, 8 Nov 2013 11:48:54 +0000 (12:48 +0100)] 
Add `forkProcessWithUnmask` function

This seemed to be an obvious addition while working on #8433.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix `forkProcess` to inherit caller's `MaskingState`
Herbert Valerio Riedel [Fri, 8 Nov 2013 11:42:56 +0000 (12:42 +0100)] 
Fix `forkProcess` to inherit caller's `MaskingState`

...and while at it, use `bracket` to fix a potential resource leak due
to `freeStablePtr` not being called if `throwErrnoIfMinus1` throws an
exception.

This fixes #8433

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoKill trailing whitespace
Herbert Valerio Riedel [Thu, 7 Nov 2013 12:48:36 +0000 (13:48 +0100)] 
Kill trailing whitespace

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoRemove misleading paragraph in `fdToHandle`'s Haddock
Herbert Valerio Riedel [Thu, 7 Nov 2013 12:42:51 +0000 (13:42 +0100)] 
Remove misleading paragraph in `fdToHandle`'s Haddock

The removed paragraph is obsolete and does no longer apply to the
implementation as noted by Duncan in #8286.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix #7912 by using `CApiFFI` for `<termios.h>` imports
Herbert Valerio Riedel [Thu, 7 Nov 2013 12:22:34 +0000 (13:22 +0100)] 
Fix #7912 by using `CApiFFI` for `<termios.h>` imports

On Android, the functions imported from `<termios.h>` are actually
inlined functions, so we need to wrap them via the `capi` calling
convention.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoTemporary workaround for addressing #7359
Herbert Valerio Riedel [Thu, 7 Nov 2013 09:21:17 +0000 (10:21 +0100)] 
Temporary workaround for addressing #7359

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoUpdate bug-reports URL
Herbert Valerio Riedel [Sat, 26 Oct 2013 14:39:10 +0000 (16:39 +0200)] 
Update bug-reports URL

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoDon't include `HsUnixConfig.h` in source distribution
Herbert Valerio Riedel [Thu, 24 Oct 2013 19:18:47 +0000 (21:18 +0200)] 
Don't include `HsUnixConfig.h` in source distribution

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoMarkdown-ify README and add Travis-CI script
Herbert Valerio Riedel [Sun, 20 Oct 2013 12:14:40 +0000 (14:14 +0200)] 
Markdown-ify README and add Travis-CI script

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoUpdate aux files `config.{guess,sub}` and `install-sh`
Herbert Valerio Riedel [Sun, 20 Oct 2013 11:56:28 +0000 (13:56 +0200)] 
Update aux files `config.{guess,sub}` and `install-sh`

This updates the files to the versions bundled with GNU automake 1.13.3

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years ago`M-x untabify` changelog and unix.cabal
Herbert Valerio Riedel [Sun, 13 Oct 2013 08:17:54 +0000 (10:17 +0200)] 
`M-x untabify` changelog and unix.cabal

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix build on OS X
Bryan O'Sullivan [Sun, 13 Oct 2013 00:02:23 +0000 (17:02 -0700)] 
Fix build on OS X

5 years agoDrop trailing whitespace
Bryan O'Sullivan [Sun, 13 Oct 2013 00:01:57 +0000 (17:01 -0700)] 
Drop trailing whitespace

5 years agoFix a type defaulting warning
Bryan O'Sullivan [Sat, 12 Oct 2013 23:51:14 +0000 (16:51 -0700)] 
Fix a type defaulting warning

(And a small matter of using != instead of /= -- how embarrassing!)

5 years agoFix assumption that RLIM_INFINITY is a simple number
Bryan O'Sullivan [Sat, 12 Oct 2013 23:45:50 +0000 (16:45 -0700)] 
Fix assumption that RLIM_INFINITY is a simple number

On MacOS X, it is defined as "(((__uint64_t)1 << 63) - 1)", and
hence cannot be used inside C preprocessor logic.

5 years agoDrop trailing whitespace
Bryan O'Sullivan [Sat, 12 Oct 2013 23:45:11 +0000 (16:45 -0700)] 
Drop trailing whitespace

5 years agoMake `-Wall` clean and drop `-fno-warn-unused-imports`
Herbert Valerio Riedel [Sat, 12 Oct 2013 21:49:25 +0000 (23:49 +0200)] 
Make `-Wall` clean and drop `-fno-warn-unused-imports`

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>
5 years agoRefactor & update `unix.cabal` to `cabal-version>=1.10`
Herbert Valerio Riedel [Sat, 12 Oct 2013 11:30:42 +0000 (13:30 +0200)] 
Refactor & update `unix.cabal` to `cabal-version>=1.10`

This also lists the GHC versions this package has been tested to compile
with in the `tested-with` Cabal field.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoMake compatible again for GHC back to 7.4.1
Herbert Valerio Riedel [Sat, 12 Oct 2013 11:24:45 +0000 (13:24 +0200)] 
Make compatible again for GHC back to 7.4.1

By avoiding `import Foreign` this accomplishes backward-compatibility
w.r.t. the `unsafePerformIO` relocation w/o resorting to CPP
conditionals.

Moreover, in order to support base<4.7 this commits needs to reintroduce
a harmless backport of `newFilePath`.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd `dist/` and `*~` to `.gitignore`
Herbert Valerio Riedel [Sat, 12 Oct 2013 11:23:31 +0000 (13:23 +0200)] 
Add `dist/` and `*~` to `.gitignore`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAdd `changelog` file and `/Since: 2.7.0.0/` notes
Herbert Valerio Riedel [Sat, 12 Oct 2013 11:21:47 +0000 (13:21 +0200)] 
Add `changelog` file and `/Since: 2.7.0.0/` notes

The changelog file will be shown on Hackage once it's included in the
source tarball.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoDeclare language extensions via `{-# LANGUAGE -#}`
Herbert Valerio Riedel [Sat, 12 Oct 2013 11:01:50 +0000 (13:01 +0200)] 
Declare language extensions via `{-# LANGUAGE -#}`

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>