Unused character device major numbers

Jeff Licquia <[email protected]> Tue, 15 Nov 2005 11:06:34 -0500
Newsgroups gmane.linux.lsb.test-suite
Message-ID <1132070794.4111.13.camel@laptop1>
I've been fighting with another ia64 problem for DCC, and thought I
should get some feedback (plus document the problem in case someone else
sees it).

Recent test results for ia64 have had a new problem: when opening the
nonexistent character device, the tests were getting ENODEV back instead
of ENXIO.  After pounding my head on the problem for a while, I noticed
that it started showing up right when devfs was turned on.  This
affected the allocation of major numbers by the kernel, and the pcmcia
character device (which I didn't even know existed) was bumped down from
252 to 251.  That, of course, is the major number assigned by default
to /home/tet/test_sets/nonexistc.  As I read the spec, the behavior I'm
seeing is therefore correct (because the device exists, but opens are
not supported on it).

It seems to me that I can work around this problem by
recreating /home/tet/test_sets/nonexistc with a different major number.
The actual major number doesn't seem to matter for the purpose of LSB
certification, just that it doesn't have a driver.  Is that correct?

Also, has the LSB considered checking for the major number of
nonexist{b,c} when creating the devices?  Something like this pseudocode
seems workable:

dev = 254
while (dev not in /proc/devices{first half})
do
  dev -= 1
done
mknod nonexistc c $dev 1