https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99533
--- Comment #5 from Steffen Schuemann <ssh at pobox dot com> --- Thank you for looking into this and sorry for the namespace issue, I was to greedy when deleting the preprocessor parts that switched between my implementation and std::filesystem. First of all, I'm with you in thinking the macOS issue is more of an os problem, but knowing the chances that this gets fixed on Apples side, especially for anything older than Big Sur, I hoped that a fix/workaround on GCC/LLVM side would be a much better chance. Thanks for the changes, I'll try to test macOS later this day. And thank you for pointing out that the situation under Linux is in fact not the same. You are right. Sadly I was fooled to believe it is, while comparing the behavior with my implementation but after some debugging the reason mine iterates through /proc/1/task/1/cwd without an error is actually a bug on my side. So I have to thank you for helping me find that one. So to recap: EPERM issue is indeed macOS only, not Linux!