System calls need to be retried if they return EINTR (unless this was due to them being cancelled; you don't always get ECANCELED in that case).
There is some handling already, e.g. here's eio_linux handling EINTR for rw ops:
|
begin match Fiber_context.get_error action.fiber with |
|
| Some e -> Suspended.discontinue action e (* If cancelled, report that instead. *) |
|
| None -> |
|
if errno_is_retry e then ( |
|
submit_rw_req st req; |
|
schedule st |
|
) else ( |
|
Suspended.continue action e |
|
) |
Check if we need this in more places, and also check the eio_luv backend.
@hannesm notes in mirage/mirage-crypto#155 (comment) that getrandom needs this too.
System calls need to be retried if they return EINTR (unless this was due to them being cancelled; you don't always get
ECANCELEDin that case).There is some handling already, e.g. here's eio_linux handling EINTR for rw ops:
eio/lib_eio_linux/eio_linux.ml
Lines 519 to 527 in 85841dc
Check if we need this in more places, and also check the eio_luv backend.
@hannesm notes in mirage/mirage-crypto#155 (comment) that
getrandomneeds this too.