System.Posix.User fails to build on systems without get{gr,pw}nam_r
I'm trying to build GHC for Android (using https://github.com/neurocyte/ghc-android) and according to include/HsUnixConfig.h Android doesn't have any of the _r functions in the get{gr,pw}* family.
In System/Posix/User.hsc the imports of Control.Monad and System.IO.Error are conditional on defined(HAVE_GETGRNAM_R) || defined(HAVE_GETPWNAM_R), but the use site of those modules (doubleAllocWhileERANGE) was moved outside of any #ifs by http://git.haskell.org/?p=packages/unix.git;a=commit;h=ef683c6ba703.
I would suggest just removing the conditionals around the import of those two modules, since doubleAllocWhileERANGE is by now used by four other functions. Otherwise, need to bracket the definition of doubleAllocWhileERANGE with the same conditional as the one around those imports, and should update the conditionals to reflect all four cases in which doubleAllocWhileERANGE is used.
(BTW, does Android count as "Operating System: Linux"? It is based on the Linux kernel, but with a rather peculiar user-space.)
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.7 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/unix |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |