lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][5/11][MANUX] Kernel compatibility : major/minor numbers
> 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


\
 
 \ /
  Last update: 2014-04-15 18:21    [W:0.038 / U:13.804 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site