From 1f6ef53d6a92c3de2720b6e07f801eed79fe331e Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sun, 14 Jul 2024 18:50:25 +0200
Subject: [PATCH] gh-121731: Fix mimalloc compile error on GNU/Hurd (GH-121732)
 (cherry picked from commit d005f2c1861dbf0ab3d9f80b54d05d0c0b522c3c)

Co-authored-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 .../next/Build/2024-07-14-01-29-47.gh-issue-121731.RMPGP3.rst    | 1 +
 Objects/mimalloc/prim/unix/prim.c                                | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 Misc/NEWS.d/next/Build/2024-07-14-01-29-47.gh-issue-121731.RMPGP3.rst

diff --git a/Misc/NEWS.d/next/Build/2024-07-14-01-29-47.gh-issue-121731.RMPGP3.rst b/Misc/NEWS.d/next/Build/2024-07-14-01-29-47.gh-issue-121731.RMPGP3.rst
new file mode 100644
index 00000000000000..36e0f86a0ae455
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2024-07-14-01-29-47.gh-issue-121731.RMPGP3.rst
@@ -0,0 +1 @@
+Fix mimalloc compile error on GNU/Hurd
diff --git a/Objects/mimalloc/prim/unix/prim.c b/Objects/mimalloc/prim/unix/prim.c
index c6ea05bbe7a2ac..c4816af1a0d6e5 100644
--- a/Objects/mimalloc/prim/unix/prim.c
+++ b/Objects/mimalloc/prim/unix/prim.c
@@ -27,6 +27,7 @@ terms of the MIT license. A copy of the license can be found in the file
 
 #include <sys/mman.h>  // mmap
 #include <unistd.h>    // sysconf
+#include <fcntl.h>     // open, close, read, access
 
 #if defined(__linux__)
   #include <features.h>