On Thu, 08.01.2009 at 21:50:47 -0800, per...@pluto.rain.com wrote:
> Ulrich Spoerlein <gmail.com!uspoerl...@agora.rdrop.com> wrote:

Ummm, out of curiosity, are your receiving your mail via UUCP? :)

> > Please run
> > % cat /dev/sndstat
> > % ls -l /dev/dsp0 /dev/dsp0.0
> >
> > The reason you are not seeing them with 'ls /dev/dsp*' is because
> > devfs is creating the nodes when they are open(2)'ed. Using shell
> > globbing will search the output of readdir(2) for matches to dsp*
> > where devfs has no way of dynamically creating nodes (which ones
> > should it create anyway?)
> 
> In principle, everything that would be successfully created if
> open(2)'ed.  It doesn't necessarily need to actually create them,
> but the results from readdir(2) should be as if they had been
> created.  The whole point of things like ls(1) and readdir(2) is
> to find out what-all is available to be opened, without having to
> already know the answer.

Not according to my understanding, which may be flawed of course.
devfs(4) would have to create all devices, which may be open(2)ed up
front, for dsp that would have to be 32 instances (for my system):

% ll /dev/dsp0.{0,9,11,21,31}
crw-rw-rw-  1 root  wheel    0, 142 Jan  9 20:57 /dev/dsp0.0
crw-rw-rw-  1 root  wheel    0, 153 Jan  9 20:20 /dev/dsp0.11
crw-rw-rw-  1 root  wheel    0, 154 Jan  9 20:20 /dev/dsp0.21
crw-rw-rw-  1 root  wheel    0, 151 Jan  9 20:20 /dev/dsp0.31
crw-rw-rw-  1 root  wheel    0, 152 Jan  9 20:20 /dev/dsp0.9

It would also cloud the information about devices in-use.

> > This is a FAQ really.
> 
> It may be an FAQ, but it is also a bug, granted one that may not be
> easy to fix.

You really want all cloneable instances to show up with a readdir, which
would mean that they would have to created upon device attachment? I
really don't think so ... For /dev/dsp0 the semantics are pretty clear:
try to open /dev/dsp0, if it succeeds fine, if not, there is no vchan
available and you're SOL. No need to play the guess-a-free-dsp-device
game.

Cheers,
Ulrich Spoerlein
-- 
It is better to remain silent and be thought a fool,
than to speak, and remove all doubt.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to