delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/20/04:08:15

Date: Wed, 20 Dec 2000 11:06:31 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Dawe <richdawe AT bigfoot DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: If dd doesn't support /dev/zero, what _does_ it support?
In-Reply-To: <3A3FC60C.4AA43E9@bigfoot.com>
Message-ID: <Pine.SUN.3.91.1001220110609.14902M-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 19 Dec 2000, Richard Dawe wrote:

> Eli Zaretskii wrote:
> > The /dev/zero device is not part of the emulated devices.  The emulated
> > devices are those which have direct DOS equivalents; /dev/zero doesn't.
> > 
> > Please consider writing up a /dev/zero emulation and submitting it for
> > inclusion in a future DJGPP version.
> 
> Eli, I don't know if you remember, but we discussed adding /dev/zero and
> /dev/null a while back on djgpp-workers.

Yes, I remember.

> I seem to remember it got lost in a wider discussion about extending
> the FSEXT mechanism.

It didn't get lost: I have it in my private archive of things-to-do.
However, given my current load, it's unlikely that I get to it any
time soon, since much more important (IMHO) issues are in the queue.
Volunteers are welcome.

> > > And how do I list the supported devices?
> > 
> > You don't.
> 
> Would it be desirable to list them?

It's desirable, yes; but the costs might be prohibitive or high enough
to warrant that we wait for a motivated volunteer.

> Should this be part of the extended FSEXT mechanism? I wonder what
> extra it would require - stat() support?

It would certainly need support in `stat', but that's not the most
problematic aspect of what Damian wanted, because `stat' already
supports all emulated devices (try "ls -l /dev/tty" and you will see),
and yet "ls /dev" still didn't work.

For "ls /dev" to work, we will need the following:

  - emulate /dev as if it were an existing directory (e.g., `stat'
    should return the appropriate bits for it);
  - introduce support for emulated devices into opendir and readdir,
    so that they return these names as if they were present in /dev;
  - add to the glob function support for these devices, so that
    something like "ls /dev/*" does what you'd expect.

I'm probably missing some additional aspects, since the above is a
product of a 10-second thought.  I'm sure that whoever begins to work
on this will quickly find out the rest ;-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019