Mail Archives: djgpp-workers/1999/10/14/18:09:57
Hello.
Eli Zaretskii wrote:
> I suggest to use the same method used by termios: introduce a special
> hook that I/O functions know about, and which gets called after user's
> FSEXTs, but before the DOS function calls. It is possible that you
> can use the same hook already used by termios, just extend it with
> some flags and add the calls that implement /dev/zero support.
>
> Another, possibly simpler, alternative would be to make /dev/zero be
> mapped to the null device, the same way /dev/null is handled, but mark
> the handle in some special way, so that _read will return a block of
> zeroes instead of actually reading.
You've convinced me a hook is a better solution. I think making a generic
solution would be a good idea, because then it would make implementing
other /dev/* devices simpler. I think this would be a neater solution than
the special handle method, but I haven't looked at the code yet, so this
is just speculation.
'Tis a shame I can't use a File System Extension, because that would be
very simple. Ah well.
> > A grep of the DJGPP libc sources didn't yield anything that looked
> > like /dev/null support.
>
> Somehow, you didn't grep it all, or maybe you looked for a literal
> "/dev/null" (you won't find it). The support for /dev/* is in
> src/libc/dos/io/putpath.c.
I grepped for /dev/null hopefully, but also just null. I guess it helps if
you know what to look for ;) I'll examine this code.
Thanks - that was exactly the guidance I was hoping for!
--
Richard Dawe
richdawe AT bigfoot DOT com ICQ 47595498 http://www.bigfoot.com/~richdawe/
- Raw text -