Date: Tue, 16 Jan 2001 12:02:36 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: djgpp-workers AT delorie DOT com Subject: Re: /dev/zero & /dev/full FSEXTs In-Reply-To: <3A63764C.2CE7F394@phekda.freeserve.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 15 Jan 2001, Richard Dawe wrote: > Would an FSEXT hook for setmode() be useful? I agree with DJ that this seems problematic, as binary/text is handled on non-primitive level. It might be useful to have a raw/cooked mode hook (assuming we make the IOCTL call in setmode a primitive on its own right), but I'd say let's leave this alone until some application needs it. > > > + case __FSEXT_lseek: > > > + fd = va_arg(args, int); > > > + offset = va_arg(args, off_t); > > > + whence = va_arg(args, int); > > > + > > > + /* This must be emulated, since the FSEXT has been called. */ > > > + emul = 1; > > > + > > > + *rv = offset; > > > > Even if `offset' and `whence' point before the beginning? > > The handling of lseek() is a little tricky, since we have an infinitely > long non-existent file. ;) SEEK_SET is easy. SEEK_CUR and SEEK_END are > tricky, since they require some knowledge of how big the file is. > > Seeks on /dev/full are supposed to always succeed. I do not know if this > is true for /dev/zero also. For our implementation, it is. > > What do you think the behaviour for SEEK_CUR and SEEK_END should be? I didn't necessarily mean to say that what you wrote was wrong, just to make sure those decisions were not taken by default. If you think this behavior is appropriate for these special devices, I don't mind. > > > + #include > > > > Is this header used on other platforms? > > No, it just seemed like a good name. It does not exist on Linux. If other platforms have headers for these purposes, let's use the same names. If no popular platform has a header for this, it's okay to use any name you fancy, including xdevices.h. > Thanks for the comments, Eli. Thank _you_ for doing the work.