Sender: richdawe AT bigfoot DOT com Message-ID: <3806512C.659F1CC0@tudor21.net> Date: Thu, 14 Oct 1999 22:54:52 +0100 From: Richard Dawe X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.10 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT Delorie DOT com Subject: Re: /dev/zero support References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com 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/