RFS/NFS file detection - possible solution

Chris Lewis clewis at eci386.uucp
Tue Feb 27 03:05:18 AEST 1990


In article <100210 at convex.convex.com> tchrist at convex.COM (Tom Christiansen) writes:
> The teststat program fails to identify NFS files on Convex
> systems.  Here's the output from a C120 OS7.1:

That's partially because my program was busted (the major should have
been bmajor), and partially because I'm not really taking account of
differing "major()" definitions.  In your teststat output, given:

> file: /usr/spool/globdata/aliases/tacunix dev: ffffff02 major: ff minor: 2
> I don't think /usr/spool/globdata/aliases/tacunix is a networked file

Note that the major has bit 7 on, which it doesn't on the local filesystems.

What I'm leaning towards is the following definitions:

    #if defined(locmajor)
    #undef locmajor
    #endif
    #define locmajor(x) (major(x)&0x7f)

    #define	REMOTEFS(dev)	(makedev(locmajor(dev),minor(dev)) != (dev))

Which should work on HPUX, AIX and now Convex, not to mention the other
systems that Larry Wall mentioned, even where major() itself masks off
the bit.

Though, the 0x7f may have to be parameterized on some systems.
-- 
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list



More information about the Comp.unix.wizards mailing list