Interface KERNEL$CIO

Function

SpaceUser/kernel
ContextSync/async
May blockNo
SPLAny
Dynamic memoryNo

#include <SPAD/AC.H>

void KERNEL$CIO(IORQ *iorq);

Description

This function requests cancel of a pending IORQ. KERNEL$CIO will return immediatelly but the cancel may take some time and the caller must wait for an AST to arrive. If the IORQ was canceled, AST will be called with status -EINTR. Even after a call to KERNEL$CIO AST may return with status different from -EINTR — in this case the request was completed normally.
When KERNEL$CIO is called after the status has been set and AST posted, it performs nothing.

KERNEL$CIO guarantees that the request will terminate in finite time, but it doesn't force immediate cancel. The cancelation possibility differs from device to device.
For example, when canceling a direct IO request on disk, there is very little possibility to stop already running bus-master controller — thus the request is not canceled immediatelly and normal transferred byte count is returned. In this case, the specification is not violated because we know that the transfer must finish in finite time.
When canceling read request on a network socket, the request can take infinite time (when the other side is not sending anything) and cancel possibility must be implemented.
The caller of KERNEL$CIO shouldn't expect one of these cases happen — it is up to the device driver to choose if it wants to cancel the request or wants to finish it.

Arguments

See also

DECL_AST, CALL_IORQ