stat() call on a mounted directory point

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Dec 14 19:06:38 AEST 1989


In article <1279 at nih-csl.UUCP> ted at nih-csl.UUCP (ted persky) writes:
>When I issue a stat() call on any directory which happens to be a mount
>point for a partition (as indicated by 'df'), the inode number that comes
>back is '2', which is identical to the inode of the root directory.

That's what you're supposed to see; it's part of the semantics of mounting.

>Issuing an 'ls -il /' gives you the actual inode number of /usr, which is
>what I want stat() to do.

That's too bad.  "ls" merely reports the inumber stored in its directory
entry, and that is not altered when a filesystem is mounted on the inode.

>P.S. E-mail would be appreciated.  This is kind of urgent.

It can't be TOO urgent since UNIX has always worked like that.



More information about the Comp.unix.wizards mailing list