Re: /dev ??

From: Andy Valencia <vandys_at_nospam.org>
Date: Mon Nov 27 2000 - 17:46:57 PST

["Sandro Magi" <naasking@hotmail.com> writes:]

>What does '/dev' do in VSTa? I do a 'ls -l' and the output says 'dev: no
>entry'. I also tried 'vls -l' and that gave me 'perm' (which I believe is an
>error in VSTa right?). Everything else shows up fine, but /dev doesn't.
>Is /dev supposed to do something? Is it a device list/directory?

Well, /dev is kinda-sorta a virtual directory. It wouldn't exist at all,
except for /dev/null (most device servers aren't in the average user's
filesystem namespace at all). If you do a "fstab" command, you'll see
what's mounted in your process's filesystem namespace. You can "cat
/dev/null" and get the expected result, but what does it mean if you mount
something in a path which has "directory" entries which don't really exist?

I wrestled with this early on, and you can look at the implementation of
opendir/readdir for an idea of how I thought about this. But the shell, for
instance, wants to stat() "/dev" before it'll chdir to it, and there's no
similar emulation to fool it into thinking that there's a directory there.
If somebody wanted to do some middle-weight hacking in the C library, that
might be a useful enhancement. See open() in vsta/src/lib/open.c for where
most of this would happen.

BTW, try "echo /dev/*"... this is made possible by the opendir/readdir
emulation of these pseudo-directories. *Some* of the logic is already
present in the system.

Regards,
Andy Valencia
Received on Mon Nov 27 17:45:43 2000

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:57 PDT