Mail Archives: djgpp-workers/2001/01/16/05:04:27
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 <sys/xdevices.h>
> >
> > 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.
- Raw text -