require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_DEV_FSSVAR_H)) {
    eval 'sub _SYS_DEV_FSSVAR_H () {1;}' unless defined(&_SYS_DEV_FSSVAR_H);
    require 'sys/ioccom.ph';
    eval 'sub FSS_UNCONFIG_ON_CLOSE () {0x1;}' unless defined(&FSS_UNCONFIG_ON_CLOSE);
    eval 'sub FSS_UNLINK_ON_CREATE () {0x2;}' unless defined(&FSS_UNLINK_ON_CREATE);
    eval 'sub FSSIOCSET () { &_IOW(ord(\'F\'), 5, \'struct fss_set\');}' unless defined(&FSSIOCSET);
    eval 'sub FSSIOCGET () { &_IOR(ord(\'F\'), 1, \'struct fss_get\');}' unless defined(&FSSIOCGET);
    eval 'sub FSSIOCCLR () { &_IO(ord(\'F\'), 2);}' unless defined(&FSSIOCCLR);
    eval 'sub FSSIOFSET () { &_IOW(ord(\'F\'), 3, \'int\');}' unless defined(&FSSIOFSET);
    eval 'sub FSSIOFGET () { &_IOR(ord(\'F\'), 4, \'int\');}' unless defined(&FSSIOFGET);
    if(defined(&_KERNEL)) {
	require 'compat/sys/time_types.ph';
	eval 'sub FSSIOCSET50 () { &_IOW(ord(\'F\'), 0, \'struct fss_set50\');}' unless defined(&FSSIOCSET50);
	eval 'sub FSSIOCGET50 () { &_IOR(ord(\'F\'), 1, \'struct fss_get50\');}' unless defined(&FSSIOCGET50);
	require 'sys/bufq.ph';
	eval 'sub FSS_CLUSTER_MAX () {(1<<24);}' unless defined(&FSS_CLUSTER_MAX);
	eval 'sub FSS_BTOCL {
	    my($sc, $off) = @_;
    	    eval q((($off) >> ($sc)-> &sc_clshift));
	}' unless defined(&FSS_BTOCL);
	eval 'sub FSS_CLTOB {
	    my($sc, $cl) = @_;
    	    eval q((( &off_t)($cl) << ($sc)-> &sc_clshift));
	}' unless defined(&FSS_CLTOB);
	eval 'sub FSS_CLOFF {
	    my($sc, $off) = @_;
    	    eval q((($off) & ($sc)-> &sc_clmask));
	}' unless defined(&FSS_CLOFF);
	eval 'sub FSS_CLSIZE {
	    my($sc) = @_;
    	    eval q((1<< ($sc)-> &sc_clshift));
	}' unless defined(&FSS_CLSIZE);
	eval 'sub FSS_BTOFSB {
	    my($sc, $off) = @_;
    	    eval q((($off) >> ($sc)-> &sc_bs_bshift));
	}' unless defined(&FSS_BTOFSB);
	eval 'sub FSS_FSBTOB {
	    my($sc, $blk) = @_;
    	    eval q((( &off_t)($blk) << ($sc)-> &sc_bs_bshift));
	}' unless defined(&FSS_FSBTOB);
	eval 'sub FSS_FSBOFF {
	    my($sc, $off) = @_;
    	    eval q((($off) & ($sc)-> &sc_bs_bmask));
	}' unless defined(&FSS_FSBOFF);
	eval 'sub FSS_FSBSIZE {
	    my($sc) = @_;
    	    eval q((1<< ($sc)-> &sc_bs_bshift));
	}' unless defined(&FSS_FSBSIZE);
	eval("sub FSS_READ () { 0; }") unless defined(&FSS_READ);
	eval("sub FSS_WRITE () { 1; }") unless defined(&FSS_WRITE);
	eval("sub FSS_CACHE_FREE () { 0; }") unless defined(&FSS_CACHE_FREE);
	eval("sub FSS_CACHE_BUSY () { 1; }") unless defined(&FSS_CACHE_BUSY);
	eval("sub FSS_CACHE_VALID () { 2; }") unless defined(&FSS_CACHE_VALID);
	eval("sub FSS_IDLE () { 0; }") unless defined(&FSS_IDLE);
	eval("sub FSS_CREATING () { 1; }") unless defined(&FSS_CREATING);
	eval("sub FSS_ACTIVE () { 2; }") unless defined(&FSS_ACTIVE);
	eval("sub FSS_DESTROYING () { 3; }") unless defined(&FSS_DESTROYING);
	eval 'sub FSS_ERROR () {0x1;}' unless defined(&FSS_ERROR);
	eval 'sub FSS_BS_THREAD () {0x4;}' unless defined(&FSS_BS_THREAD);
	eval 'sub FSS_PERSISTENT () {0x20;}' unless defined(&FSS_PERSISTENT);
	eval 'sub FSS_CDEV_OPEN () {0x40;}' unless defined(&FSS_CDEV_OPEN);
	eval 'sub FSS_BDEV_OPEN () {0x80;}' unless defined(&FSS_BDEV_OPEN);
    }
}
1;
