This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add /proc/devices


On Fri, Aug 19, 2011 at 02:50:24PM -0500, Yaakov (Cygwin/X) wrote:
>On Fri, 2011-08-19 at 10:44 -0400, Christopher Faylor wrote:
>> On Fri, Aug 19, 2011 at 01:52:53PM +0200, Corinna Vinschen wrote:
>> >On Aug 18 20:54, Yaakov (Cygwin/X) wrote:
>> >> 2011-08-18  Yaakov Selkowitz  <yselkowitz@...>
>> >> 
>> >> 	* devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR,
>> >> 	DEV_SOUND_MAJOR.  Use throughout.
>> >> 	* fhandler_proc.cc (proc_tab): Add /proc/devices and /proc/misc
>> >> 	virtual files.
>> >> 	(format_proc_devices): New function.
>> >> 	(format_proc_misc): New function.
>> >
>> >Yes, I think that's ok.
>> 
>> Isn't it somehow possible to just iterate over dev_storage and generate
>> this automatically rather than hard-coding the names of devices?
>
>I don't think so.  For the most part, /proc/devices doesn't list
>individual devices but only groups thereof, and there is the "misc"
>major device which is only descriptive and not an actual device name.
>There is also the matter of distinguishing between block and character
>devices.
>
>As for /proc/misc, technically it could be done as you describe, but is
>it worth the price of iterating over a 2581-member array to find the two
>matching cases?  If the misc devices would vary based on configuration
>as on Linux, I would see your point, but as we only and always have
>these two, I'm not so sure.

It's not just two matching names.  You could infer most of the device
abbreviations from the list or you could conceivably change what is
generated by devices.in so that a table was output automatically.

But, I'm not looking for work for you to do.  I was just trying
to brainstorm.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]