Re: [RFC][5/11][MANUX] Kernel compatibility : major/minor numbers

One Thousand Gnomes
2014-04-15T15:40:40Z

> Why is it? I mean, as far as userspace is concerned, they do have a
> unique identifier : their name. How would it be problematic that the

No - a name is never a unique identifier in a Unix system. The
fundamental object is the file handle. If I want to be able to answer the
question

"are these two file handles pointing to the same device"

I need the major/minor to do so. Even if I know the name I don't know if
two opens of the same name produced references to the same object,
because another process may have changed it under me.

Most code doesn't care. You can happily replace /dev/null with something
else (or accidentally make it a file and then a year later wonder why
your disk is full).

Names are very much second class citizens. An object can have a file
handle without a name, or with many names

Alan