2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Start an IO request and wait until it completes.
8 #include <exec/execbase.h>
11 #include <aros/libcall.h>
12 #include <proto/exec.h>
14 /*****************************************************************************
21 struct IORequest
* iORequest
,
24 struct ExecBase
* SysBase
)
27 It's like the exec's DoIO, but this one handles CTRL-C.
30 iORequest - Pointer to iorequest structure.
41 OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
45 ******************************************************************************/
48 return DoIO(iORequest
);
51 Prepare the message. Tell the device that it is OK to wait in the
52 BeginIO() call by setting the quick bit.
54 iORequest
->io_Flags
=IOF_QUICK
;
55 iORequest
->io_Message
.mn_Node
.ln_Type
=0;
57 /* Call BeginIO() vector */
58 AROS_LVO_CALL1NR(void,
59 AROS_LCA(struct IORequest
*,iORequest
,A1
),
60 struct Device
*,iORequest
->io_Device
,5,
63 /* If the quick flag is cleared it wasn't done quick. Wait for completion. */
64 if(!(iORequest
->io_Flags
&IOF_QUICK
))
66 ULONG iosigf
= 1<<iORequest
->io_Message
.mn_ReplyPort
->mp_SigBit
;
73 !(sigs
& SIGBREAKF_CTRL_C
) &&
75 !(iORequest
->io_Flags
&IOF_QUICK
) &&
76 iORequest
->io_Message
.mn_Node
.ln_Type
==NT_MESSAGE
79 sigs
= Wait(iosigf
| SIGBREAKF_CTRL_C
);
82 if(iORequest
->io_Message
.mn_Node
.ln_Type
==NT_REPLYMSG
)
84 /* Arbitrate for the message queue. */
87 /* Remove the message */
88 Remove(&iORequest
->io_Message
.mn_Node
);
92 if (sigs
& SIGBREAKF_CTRL_C
)
101 /* All done. Get returncode. */
102 return iORequest
->io_Error
;