lkml.org 
[lkml]   [1999]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Devfs, was Re: Migrating to larger numbers
Jamie Lokier writes:
> Richard Gooch wrote:
> > The concept is still valid. Just extend my example code. It wasn't
> > meant to be complete, just enough to convey the idea. Did I really
> > have to spell that out?
>
> You presented it as "this is a neat way to find all the CD-ROMs".
> But it doesn't unless you can change the code to handle new
> interfaces as they come along.

I don't expect new CD-ROM interfaces to come that often. However...

> So any app you're not going to recompile regularly needs a
> configuration file. In which case, why not just list all the
> standard CD-ROM locations there?

Depends what you mean. If you're saying you have:
/dev/hdc
/dev/sr0
/dev/sr1
/dev/sr2
/dev/sr3
...

as with the existing system (open(2)ening each entry to see if there's a
device there), I don't think that's neat. You're better off
hard-coding /dev/sr%d and putting in a loop, for example.

However, if you're saying that the config file has:
/dev/ide/cd
/dev/sr
/dev/usb/cd

and each entry is treated as a directory to be opened, then I have no
problem with that. I don't care if it's hard-coded into the
application or if there is a configuration file. The important thing
is that devfs provides a device-type and interface-type grouping that
makes things very neat and simple, and you don't need to speculatively
open(2) each device entry to see if there is hardware behind it.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.703 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site