Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cwjcc!hal!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: How do I tell physio that my device has reached EOF? Message-ID: <1989Nov17.004138.4551@NCoast.ORG> Date: 17 Nov 89 00:41:38 GMT References: <6705@portia.Stanford.EDU> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: North Coast Public Access UN*X, Cleveland, OH Lines: 25 As quoted from <6705@portia.Stanford.EDU> by name@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@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi) uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp *(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)* *Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)* expnet.all: Experiments in *net management and organization. Mail me for info.