From 93546fbf96212b6d6bc86f8c7de3b54d3a25f799 Mon Sep 17 00:00:00 2001 From: high on tantor Date: Tue, 16 Jun 2026 00:02:38 -0400 Subject: [PATCH 1/2] Add GNU/Hurd Support to `cwd()`/`exe()` The `/proc` filesystem approach will only work in more recent versions of GNU/Hurd. There are ways to do it on this platform even when the `/proc` filesystem isn't mounted, good for use as a fallback solution, but I don't feel like adding that right now. --- src/ext/cwd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ext/cwd.cpp b/src/ext/cwd.cpp index 2a3ea8859..73650824d 100644 --- a/src/ext/cwd.cpp +++ b/src/ext/cwd.cpp @@ -31,7 +31,7 @@ #endif #endif -#if (defined(BOOST_PROCESS_V2_WINDOWS) || defined(__linux__) || defined(__ANDROID__) || defined(__sun)) +#if (defined(BOOST_PROCESS_V2_WINDOWS) || defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__) || defined(__sun)) #include #endif @@ -115,11 +115,11 @@ filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec) return ""; } -#elif (defined(__linux__) || defined(__ANDROID__) || defined(__sun)) +#elif (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__) || defined(__sun)) filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec) { -#if (defined(__linux__) || defined(__ANDROID__)) +#if (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__)) return filesystem::canonical( filesystem::path("/proc") / std::to_string(pid) / "cwd", ec ); From a7716acad5898c6acf62374ad761276b8237de2b Mon Sep 17 00:00:00 2001 From: high on tantor Date: Tue, 16 Jun 2026 00:04:16 -0400 Subject: [PATCH 2/2] Add `exe()` support to GNU/Hurd --- src/ext/exe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ext/exe.cpp b/src/ext/exe.cpp index 645724811..28fb1accd 100644 --- a/src/ext/exe.cpp +++ b/src/ext/exe.cpp @@ -32,7 +32,7 @@ #endif #endif -#if (defined(BOOST_PROCESS_V2_WINDOWS) || defined(__linux__) || defined(__ANDROID__) || defined(__sun)) +#if (defined(BOOST_PROCESS_V2_WINDOWS) || defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__) || defined(__sun)) #include #endif @@ -132,11 +132,11 @@ filesystem::path exe(boost::process::v2::pid_type pid, error_code & ec) return ""; } -#elif (defined(__linux__) || defined(__ANDROID__) || defined(__sun)) +#elif (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__) || defined(__sun)) filesystem::path exe(boost::process::v2::pid_type pid, error_code & ec) { -#if (defined(__linux__) || defined(__ANDROID__)) +#if (defined(__linux__) || defined(__ANDROID__) || defined(__gnu_hurd__)) return filesystem::canonical( filesystem::path("/proc") / std::to_string(pid) / "exe", ec );