[clang] [lld] [llvm] Conditionalize use of POSIX features missing on WASI/WebAssembly (PR #92677)
James Y Knight via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 14 17:37:34 PDT 2024
================
@@ -252,13 +257,21 @@ std::error_code Process::FixupStandardFileDescriptors() {
if (NullFD == StandardFD)
FDC.keepOpen();
+#if defined(__wasi__)
+ else // WASI does not have `dup2` by design. Return EBADF.
----------------
jyknight wrote:
Does wasi have /dev/null? If not, this whole function is pointless. If so, that could be opened directly, instead. Actually, given the number of changes here for wasi, shouldn't wasi just have its own llvm/lib/Support/WASI/Process.inc file?
https://github.com/llvm/llvm-project/pull/92677
More information about the llvm-commits
mailing list