Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
unix
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
unix
Commits
71e56488
Commit
71e56488
authored
1 year ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Fix detection of statx.stx_mnt_id on buggy glibc
*
ghc/ghc#24072
*
https://lore.kernel.org/all/20220223111835.00ef0e83@bahia/T/
parent
3e7dcbc1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
System/Posix/Files/Common.hsc
+3
-3
3 additions, 3 deletions
System/Posix/Files/Common.hsc
changelog.md
+1
-0
1 addition, 0 deletions
changelog.md
configure.ac
+17
-0
17 additions, 0 deletions
configure.ac
with
21 additions
and
3 deletions
System/Posix/Files/Common.hsc
+
3
−
3
View file @
71e56488
...
...
@@ -940,7 +940,7 @@ pattern StatxBtime = StatxMask 0
-- | Want @stx_mnt_id@.
pattern StatxMntId :: StatxMask
#ifdef STATX_MNT_ID
#ifdef
HAVE_
STATX_MNT_ID
pattern StatxMntId = StatxMask (#const STATX_MNT_ID)
#else
pattern StatxMntId = StatxMask 0
...
...
@@ -1160,11 +1160,11 @@ specialDeviceIDX (ExtendedFileStatus statx) = unsafePerformIO $ do
{-# WARNING specialDeviceIDX "specialDeviceIDX: not available on this platform, will throw error (CPP guard: @#if HAVE_SYS_SYSMACROS_H@)" #-}
specialDeviceIDX _ = error "specialDeviceIDX not available on this platform"
#endif
#ifdef STATX_MNT_ID
#ifdef
HAVE_
STATX_MNT_ID
mountIDX (ExtendedFileStatus statx) =
unsafePerformIO $ withForeignPtr statx $ (#peek struct statx, stx_mnt_id)
#else
{-# WARNING mountIDX "mountIDX: not available on this platform, will throw error (CPP guard: @#if STATX_MNT_ID@)" #-}
{-# WARNING mountIDX "mountIDX: not available on this platform, will throw error (CPP guard: @#if
HAVE_
STATX_MNT_ID@)" #-}
mountIDX _ = error "mountIDX not available on this platform"
#endif
fileBlockSizeX (ExtendedFileStatus statx) = unsafePerformIO $ do
...
...
This diff is collapsed.
Click to expand it.
changelog.md
+
1
−
0
View file @
71e56488
...
...
@@ -3,6 +3,7 @@
## 2.8.4.0 *??? 2023*
*
add
`haveStatx`
*
fix
`statx.stx_mnt_id`
detection on buggy glibc, see
[
GHC #24072
](
https://gitlab.haskell.org/ghc/ghc/-/issues/24072
)
## 2.8.3.0 *Oct 2023*
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
17
−
0
View file @
71e56488
...
...
@@ -50,6 +50,23 @@ AC_CHECK_TYPE([struct rlimit],[AC_DEFINE([HAVE_STRUCT_RLIMIT],[1],[HAVE_STRUCT_R
# check for statx
AC_CHECK_FUNC([statx], [AC_DEFINE([HAVE_STATX_FUN],[1],[HAVE_STATX_FUN])],[],[#include <sys/stat.h>])
AC_CHECK_TYPE([struct statx],[AC_DEFINE([HAVE_STRUCT_STATX],[1],[HAVE_STRUCT_STATX])],[],[#include <sys/stat.h>])
AC_MSG_CHECKING(for statx.stx_mnt_id)
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <sys/stat.h>]],
[[
struct statx statxbuf;
statx(0, "", 0, STATX_BASIC_STATS | STATX_MNT_ID, &statxbuf);
return statxbuf.stx_mnt_id;
]])],
[
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_STATX_MNT_ID], [1], [Define to 1 if statx.stx_mnt_id is available.])
],
[
AC_MSG_RESULT(no)
]
)
AC_MSG_CHECKING(for F_GETLK from fcntl.h)
AC_EGREP_CPP(yes,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment