Duncan Coutts pushed to branch wip/dcoutts/io-manager-io-primop-exceptions at Glasgow Haskell Compiler / GHC Commits: 765afda7 by Duncan Coutts at 2026-08-28T23:25:35+01:00 FIXUP Change the encoding of results from the I/O manager to I/O primops - - - - - 1 changed file: - rts/PrimOps.cmm Changes: ===================================== rts/PrimOps.cmm ===================================== @@ -2314,32 +2314,32 @@ stg_waitReadyFd ( W_ fd, CInt rw ) (result) = ccall syncIOWaitReady(Capability_iomgr(MyCapability()) "ptr", CurrentTSO "ptr", rw, fd); - /* See Note [Encoding of I/O manager operation results to primops] */ + /* See Note [Encoding of result of I/O manager operations] */ /* case IOSubmitResultAsyncContinue */ - if (result == 0) (likely: True) { + if (result == 0::CInt) (likely: True) { /* See Note [Thread blocking for new I/O primops] */ jump stg_block_io_unit(); } /* case IOSubmitResultSyncSuccess*/ - if (result == 1) { + if (result == 1::CInt) { /* Success, don't even go via scheduler. */ return (); } /* negative numbers are -errno error codes */ - if (result < 0) { + if (result < 0::CInt) { /* See Note [Calling convention for raisePrimIOException] */ W_ dummyR1; W_ errno; dummyR1 = 0; - errno = -result; + errno = TO_W_(-result); jump %ENTRY_CODE(HsIface_raisePrimIOException_info(W_[ghc_hs_iface])) - (dummyR1, result); + (dummyR1, errno); } /* case IOSubmitResultHeapOverflow */ - if (result == 2) { + if (result == 2::CInt) { jump stg_raisezh(HsIface_heapOverflow_closure(W_[ghc_hs_iface])); } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/765afda7934e972b2da8f96ecbaaf60b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/765afda7934e972b2da8f96ecbaaf60b... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help