Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!comp.vuw.ac.nz!actrix!Bruce.Hoult From: Bruce.Hoult@bbs.actrix.gen.nz Newsgroups: comp.arch Subject: Re: Async system interface Message-ID: <1991Feb7.020237.15802@actrix.gen.nz> Date: 7 Feb 91 02:02:37 GMT References: <3177@crdos1.crd.ge.COM> <13772@lanl.gov> Sender: Bruce.Hoult@actrix.gen.nz (Bruce Hoult) Organization: Actrix Information Exchange, Wellington, New Zealand Lines: 23 Comment-To: jlg@lanl.gov Jim Giles writes: >You should never be forced to do a wait system >call if what you want is synchronous I/O. The I/O call (below, RW >stands for _either_ the read or the write system call) should be >something like the following: > >RW(fd,nw,buf,da,aflag,handle) [rest of description deleted] Once again, that is almost *exactly* the way the Mac does it. The main difference is that the Mac splits out your "da" parameter into two parameters: an offset (+ve, -ve or zero), and a positioning mode which can be "from start of file", "from where the last transfer finished", or "from end of file". Also, your "aflag" parameter is split into two: an actual anync flag, and a result code that acts in almost exactly the way you indicate -- it is +ve during the i/o, zero on success, and has a -ve error number on failure. -- Bruce.Hoult@bbs.actrix.gen.nz Twisted pair: +64 4 772 116 BIX: brucehoult Last Resort: PO Box 4145 Wellington, NZ "And they shall beat their swords into plowshares, for if you hit a man with a plowshare, he's going to know he's been hit."