[GHC] #12572: `readdir_r` is deprecated
GHC
ghc-devs at haskell.org
Sun Sep 4 22:39:03 UTC 2016
#12572: `readdir_r` is deprecated
-------------------------------------+-------------------------------------
Reporter: erikd | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Core | Version: 8.1
Libraries |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: Building GHC
Unknown/Multiple | failed
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
When building GHC git HEAD on Debian Testing I get:
{{{
libraries/unix/cbits/HsUnix.c: In function ‘__hscore_readdir’:
libraries/unix/cbits/HsUnix.c:64:3: error:
error: ‘readdir_r’ is deprecated [-Werror=deprecated-declarations]
res = readdir_r(dirPtr, p, pDirEnt);
^~~
In file included from libraries/unix/include/HsUnix.h:71:0: error:
0,
from libraries/unix/cbits/HsUnix.c:9:
/usr/include/dirent.h:183:12: error:
note: declared here
extern int readdir_r (DIR *__restrict __dirp,
^~~~~~~~~
}}}
According to the man page:
> This function is deprecated; use readdir(3) instead.
>
> The readdir_r() function was invented as a reentrant version of
readdir(3). It reads the next directory entry from the directory stream
dirp, and returns it in the caller-allocated buffer pointed to by
entry.
>
> It is expected that a future version of POSIX.1 will make readdir_r()
obsolete, and require that readdir() be thread-safe when concurrently
employed on different directory streams.
In order to support all of the various *nix systems, we probably need to
detect if `readdir_r` is deprecated and only use `readdir` where
`readdir_r` is in fact deprecated.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12572>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list