require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MISCFS_UNION_H_)) {
    eval 'sub _MISCFS_UNION_H_ () {1;}' unless defined(&_MISCFS_UNION_H_);
    eval 'sub UNMNT_ABOVE () {0x1;}' unless defined(&UNMNT_ABOVE);
    eval 'sub UNMNT_BELOW () {0x2;}' unless defined(&UNMNT_BELOW);
    eval 'sub UNMNT_REPLACE () {0x3;}' unless defined(&UNMNT_REPLACE);
    eval 'sub UNMNT_OPMASK () {0x3;}' unless defined(&UNMNT_OPMASK);
    eval 'sub UNMNT_BITS () {"\\177\\20" "b\\00above\\0b\\01below\\0b\\02replace\\0";}' unless defined(&UNMNT_BITS);
    if(defined(&_KERNEL)) {
	eval 'sub UN_DIRMODE () {( &S_IRWXU| &S_IRWXG| &S_IRWXO);}' unless defined(&UN_DIRMODE);
	eval 'sub UN_FILEMODE () {( &S_IRUSR| &S_IWUSR| &S_IRGRP| &S_IWGRP| &S_IROTH| &S_IWOTH);}' unless defined(&UN_FILEMODE);
	eval 'sub UN_CACHED () {0x10;}' unless defined(&UN_CACHED);
	eval 'sub MOUNTTOUNIONMOUNT {
	    my($mp) = @_;
    	    eval q(((($mp)-> &mnt_data)));
	}' unless defined(&MOUNTTOUNIONMOUNT);
	eval 'sub VTOUNION {
	    my($vp) = @_;
    	    eval q((($vp)-> &v_data));
	}' unless defined(&VTOUNION);
	eval 'sub UNIONTOV {
	    my($un) = @_;
    	    eval q((($un)-> &un_vnode));
	}' unless defined(&UNIONTOV);
	eval 'sub LOWERVP {
	    my($vp) = @_;
    	    eval q(( &VTOUNION($vp)-> &un_lowervp));
	}' unless defined(&LOWERVP);
	eval 'sub UPPERVP {
	    my($vp) = @_;
    	    eval q(( &VTOUNION($vp)-> &un_uppervp));
	}' unless defined(&UPPERVP);
	eval 'sub OTHERVP {
	    my($vp) = @_;
    	    eval q(( &UPPERVP($vp) ?  &UPPERVP($vp) :  &LOWERVP($vp)));
	}' unless defined(&OTHERVP);
	eval 'sub LOCKVP {
	    my($vp) = @_;
    	    eval q(( &UPPERVP($vp) ?  &UPPERVP($vp) : ($vp)));
	}' unless defined(&LOCKVP);
    }
}
1;
