diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-04-26 23:26:48 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-10-14 16:55:29 -0400 |
commit | 8d6078ff89f1a1bc2727181f8cb157120d15f80e (patch) | |
tree | e8605d01c8fae1a01882a7ac7b90300260e3f093 | |
parent | e13863944a1391870dab88823daa9baccf20e022 (diff) | |
download | haskell-8d6078ff89f1a1bc2727181f8cb157120d15f80e.tar.gz |
Drop blocking support in submit
-rw-r--r-- | libraries/base/System/Linux/IO/URing/Ring.hsc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libraries/base/System/Linux/IO/URing/Ring.hsc b/libraries/base/System/Linux/IO/URing/Ring.hsc index 59d6b33427..d74303e05f 100644 --- a/libraries/base/System/Linux/IO/URing/Ring.hsc +++ b/libraries/base/System/Linux/IO/URing/Ring.hsc @@ -135,19 +135,18 @@ cqePtr uring (CqeIndex i) = off = fromIntegral i * cqeSize cqeSize = Foreign.Storable.sizeOf (undefined :: Cqe) --- | Notify the kernel of new SQ submissions, optionally blocking until some --- have completed. +-- | Notify the kernel of new SQ submissions. submit :: URing -> Int -- ^ number to submit - -> Maybe Int -- ^ minimum to complete -> IO Int -submit uring to_submit min_complete = do - let flags = if isJust min_complete then #{const IORING_ENTER_GETEVENTS} else 0 +submit uring to_submit = do + let min_complete = 0 + flags = 0 fmap fromIntegral $ throwErrnoIfMinus1 "io_uring_enter" $ c_io_uring_enter_unsafe (uringFd uring) (fromIntegral to_submit) - (maybe 0 fromIntegral min_complete) + min_complete flags nullPtr @@ -186,7 +185,7 @@ freeSqe uring sqeIdx = do pokeSqeLink (sqePtr uring sqeIdx) old writePVar (uringFreeSqe uring) sqeIdx --- | Push a SQE on to the submission queue. Returns 'False' if the SQ is full. +-- | Push a SQE onto the submission queue. Returns 'False' if the SQ is full. pushSqe :: URing -> SqeIndex -> IO Bool pushSqe uring sqeIdx = do tail0 <- peek (uringSQTail $ uringSQ uring) |