home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!comp.vuw.ac.nz!zl2tnm!toyunix!don
- Newsgroups: comp.os.vms
- Subject: Re: VMS 5.5 MoveFile primitive
- Message-ID: <17057003@zl2tnm.gen.nz>
- From: don@zl2tnm.gen.nz (Don Stokes)
- Date: 4 Jan 93 14:42:49 GMT
- Sender: news@zl2tnm.gen.nz (GNEWS Version 2.0 news poster.)
- References: <1993Jan4.100117.40@elmrd6.ineab.ikea.se>
- Distribution: world
- Organization: The Wolery
- Lines: 53
-
- anos@elmrd6.ineab.ikea.se writes:
- > $qiow_s chan = indexf,- ; Volume channel
- > func = movfunc,- ; MOVEFILE function
- > p1 = fibdsc2 ; Our FIB pointer
- > blbs r0,30$
- > $exit_s r0
- > 30$:
- > ret
- >
- > The code fragment above never exits with errors as I said. If anybody out
- > there has any info on additional status fields, please send me a e-mail.
-
- Well, to put it bluntly, you've made a fairly fundamental cock-up.
-
- $QIO and $QIOW (and other things that operate asynchronously) have an
- IOSB parameter. It's optional, but ignore that. Consider it mandatory.
-
- There are two reasons for this: The big one is that the status code
- returned is the status for _queueing the I/O_ (or $GETJPI or ...), not
- for the whole job. Sure, the I/O was queued, but did it _work_?
- To find out, you need to check the low-order word of the IOSB.
-
- The second reason is very important for the 'W' forms of async calls
- ($QIOW, $GETJPIW & friends): the IOSB is checked for completion. A
- $QIOW is actually implemented as $QIO/$SYNCH, but only if you specify an
- IOSB (since $SYNCH takes asn IOSB as its parameter). If you don't, the
- only indication that the service has completed is the event flag -- since
- you've not specified the efn parameter, it's using efn 0. If anything
- else sets efn 0 (async QIOs etc), your $QIOW call will terminate
- prematurely.
-
- So, to do your QIO properly, change your code to:
-
- (somewhere else)
- iosb: .blkw 4 ; IOSB for QIOs
-
- > $qiow_s chan = indexf,- ; Volume channel
- > func = movfunc,- ; MOVEFILE function
- iosb = iosb,-
- > p1 = fibdsc2 ; Our FIB pointer
- > blbs r0,30$
- > 35$: $exit_s r0
- > 30$:
- cvtwl iosb, R0 ; Status from I/O
- blbc R0, 35$ ; OK?
- > ret
-
- Check out the I/O users guide for more infoi on IOSBs.
-
- --
- Don Stokes, ZL2TNM (DS555) don@zl2tnm.gen.nz (home)
- Network Manager, Computing Services Centre don@vuw.ac.nz (work)
- Victoria University of Wellington, New Zealand +64-4-495-5052
-