How do I tell physio that my device has reached EOF?

Brandon S. Allbery allbery at NCoast.ORG
Fri Nov 17 11:41:38 AEST 1989


As quoted from <6705 at portia.Stanford.EDU> by name at portia.Stanford.EDU (tony cooper):
+---------------
| In the context of a raw device driver for a tape drive, physio() tells
| my strategy routine to schedule that 16 blocks of data be put into a
| buf buffer. My device transfers 14 blocks then reaches EOF. My question
| is this: How do I report back to physio() that 14 blocks have been put
| into the buf structure and that EOF has been reached.
+---------------

Combining your posting with my experience with this on the user-process end, I
conclude that your driver must remember that it hit EOF and report transfer-
ring 0 blocks on subsequent calls or until the driver is sent a command to
advance to the next file on the tape.

Related or not I don't know, not being a kernel hack, but:  from the user
process end, read() works this same way.  The last block in a file returns a
short count, then 0 is returned by subsequent reads.

++Brandon
-- 
Brandon S. Allbery    allbery at NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery at hal.cwru.edu bsa at telotech.uucp
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery at uunet.uu.net (ONLY)*
expnet.all: Experiments in *net management and organization.  Mail me for info.



More information about the Comp.unix.wizards mailing list