large device major/minor numbers not supported

Koblinger Egmont egmont at uhulinux.hu
Thu Jan 20 22:46:38 UTC 2005


> Code in question probably is in screen.c, just after line 200. How do we
> know stat is using 12 + 20 bytes and not 8 + 8?

The major() and minor() macros should know it, unfortunately I don't know
how much they're portable. To maintain compatibility with older systems, the
new st_rdev field has the bits in a completely stupid order, which is I
guess hardly system dependant so trying to duplicate the complicated
definition of major()/minor() wouldn't be a good idea IMHO. The best would
be, I think, to test from the configure script whether major()/minor() is
available, if yes then use them, otherwise use the old method which still
supports numbers only up to 255.

A harder question is _what_ to show on the screen for large device numbers
as there's no room for more than 7 characters, so e.g. a 200,1000 doesn't
fit. I don't really have any ideas, all that I think is displaying anything
that is clearly not a number (a question mark, an asterisk etc...) is much
better than displaying an incorrect number. Maybe the major number could be
always displayed, then (assuming Linux) there are at least two characters
remaining after the comma, if the minor number doesn't fit there, maybe the
most significant digits of the minor number could be replaced by the usual
'~' sign which means abbreviation all around in mc.
They could be, however, maybe displayed untruncated on the mini status bar.

Better ideas are welcome :)



-- 
Egmont



More information about the mc-devel mailing list