Wolfgang Jeltsch pushed to branch wip/jeltsch/obtaining-os-handles at Glasgow Haskell Compiler / GHC
Commits:
-
0319831e
by Wolfgang Jeltsch at 2025-12-13T20:50:37+02:00
1 changed file:
Changes:
| ... | ... | @@ -316,27 +316,8 @@ withWindowsHandleWritingBiasedRaw |
| 316 | 316 | -- ** Caveats
|
| 317 | 317 | |
| 318 | 318 | {-$with-ref-caveats
|
| 319 | - #with-ref-caveats#There are the following caveats regarding the above
|
|
| 320 | - operations:
|
|
| 321 | - |
|
| 322 | - * Flushing of buffers can fail if the given handle is readable but not
|
|
| 323 | - seekable.
|
|
| 324 | - |
|
| 325 | - * If one of these operations is performed as part of an action executed by
|
|
| 326 | - 'System.IO.Unsafe.unsafePerformIO',
|
|
| 327 | - 'System.IO.Unsafe.unsafeInterleaveIO', or one of their “dupable”
|
|
| 328 | - variants and the user-provided action receives an asychnchronous
|
|
| 329 | - exception and does not catch it, then the following happens:
|
|
| 330 | - |
|
| 331 | - - Before the overall computation is suspended, the blocking of handle
|
|
| 332 | - operations is removed.
|
|
| 333 | - |
|
| 334 | - - When the computation is later resumed due to another evaluation
|
|
| 335 | - attempt, the blocking of handle operations is reinstantiated, the
|
|
| 336 | - Haskell-managed buffers are flushed again, and the user-provided
|
|
| 337 | - action is run from the beginning.
|
|
| 338 | - |
|
| 339 | - Repeating the previously executed part of the user-provided action
|
|
| 340 | - cannot be avoided apparently. See the @[async]@ note in the source code
|
|
| 341 | - of "GHC.Internal.IO.Handle.Internals" for further explanation.
|
|
| 319 | + #with-ref-caveats#This subsection is just a dummy, whose purpose is to serve
|
|
| 320 | + as the target of the hyperlinks above. The real documentation of the caveats
|
|
| 321 | + is in the /Caveats/ subsection in the @base@ module @System.IO.OS@, which
|
|
| 322 | + re-exports the above operations.
|
|
| 342 | 323 | -} |