Device numbers in a stat entry vs. the kernel i_node table
wescott at sauron.UUCP
wescott at sauron.UUCP
Tue Sep 9 08:24:07 AEST 1986
In article <186 at dayton.UUCP> sjm at dayton.UUCP (Steven J. McDowall) writes:
> In trying to port the ofiles program which was recently posted, to a
> System V.2 release of Unix on a Tower/32.
> ...
> Ofiles gets the device number (st_dev) from a stat() of the file you
> are looking for and compares it to the device number it gets from the
> kernel inode table (sys/inode.h -> i_dev). These 2 numbers never match
> ...
> My question is this: Does anyone have an idea of why these two
> numbers are different on System V? Should they be? Does one maybe
> (somehow) point in to a mount table or something? Also, of course,
> how can I relate the two together?
st_dev == brdev(i_dev)
where brdev is a macro defined in <sys/sysmacros.h>. There are some bits
masked off of i_dev which are used to indicate whether the filesystem
uses 1024-byte blocks or 512-byte blocks. i_dev should be something like
0x2204 while st_dev would be 0x0204.
--
-Mike Wescott
ncrcae!wescott
More information about the Comp.unix.wizards
mailing list