Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!icdoc!sot-ecs!efp90 From: efp90@ecs.soton.ac.uk (Pritchard EF) Newsgroups: comp.sys.amiga.programmer Subject: Re: Question on AbortIO() and WaitIO() Message-ID: <7753@ecs.soton.ac.uk> Date: 21 May 91 11:49:49 GMT References: <28630@uflorida.cis.ufl.EDU> Sender: news@ecs.soton.ac.uk Lines: 61 leh@otter.cis.ufl.edu (Les Hill) writes: >I have run into a situation which is not clearly documented (to me anyways) in the >RKM's (v1.2 ?). Below I have included the relevant fragments of code: >... > struct MsgPort *read_port, *write_port; > struct IOExtSer *read_req, *write_req; >... > BYTE dev_error; > struct Message *read_msg; >... > /* Clean up */ > if (!CheckIO(read_req)) { > AbortIO(read_req); > if (dev_error = WaitIO(read_req)) { > printf("Error waiting for aborted read -- %d\n", dev_error); > goto cleanup_8; > } > read_msg = GetMsg(read_port); // not necessary? > } >... >The situation is this: a CMD_READ request *should* be queued at the device >(the CheckIO() should confirm this), the CMD_READ request is then aborted and >a WaitIO() follows as recommended in the RKMs; the WaitIO() returns a -2 >(aborted request.) >The question that comes to mind is: does WaitIO() dequeue the reply at >read_port (read_port is the reply port for read_req) regardless of the error? >Additionally, do I need the GetMsg()? Look in the Revised and Updated RKM Libraries and Devices, page 292 under AbortIO(), it states that: The AbortIO() command may fail; if it succeeds, the device will stop processing the IORequest, and ** reply to it earlier than it may have done otherwise. AbortIO() does not ** remove the IORequest from your replyport... your program must wait for the ** reply message before actually reusing the IORequest... ** If a request has already completed... no action is taken. So YES, GetMsg() is required Hope that helps! >Thanks in advance, >Les >-- >Extraordinary crimes against the people and the state have to be avenged by >agents extraordinary. Two such people are John Steed -- top professional, and >his partner, Emma Peel -- talented amateur; otherwise known as "The Avengers." >INTERNET: leh@ufl.edu UUCP: ...!gatech!uflorida!leh BITNET: vishnu@UFPINE E.F.Pritchard. efp90@uk.ac.soton.ecs Department of Computer Science, Southampton University, Southampton, Hampshire, England.