[PATCH] D142224: [Support] Emulate SIGPIPE handling in raw_fd_ostream write for Windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 05:21:37 PST 2023


mstorsjo accepted this revision.
mstorsjo added a comment.

In D142224#4102406 <https://reviews.llvm.org/D142224#4102406>, @andrewng wrote:

> In D142224#4101799 <https://reviews.llvm.org/D142224#4101799>, @mstorsjo wrote:
>
>> I did a bit more digging on the unix side, and https://github.com/llvm/llvm-project/issues/59037 and https://reviews.llvm.org/D138244 fixed the issue for `clang -E` on the unix side. Is there something that we could do about the default handler here, not specific to `raw_ostream`?
>
> This patch now also fixes the `clang -E` related issue on Windows. Was more complicated than expected...

Thanks - this now seems to work great! Sorry for adding the extra detour, but it was much appreciated!



================
Comment at: llvm/lib/Support/Windows/Signals.inc:832
+  int RetCode = (int)EP->ExceptionRecord->ExceptionCode;
+  if (RetCode == (0xE0000000 | EX_IOERR))
+    return;
----------------
Do you have any reference for/comment about what `0xE0000000` is here?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142224/new/

https://reviews.llvm.org/D142224



More information about the llvm-commits mailing list