require '_h2ph_pre.ph';

unless(defined(&_SYS_BUF_H_)) {
    eval 'sub _SYS_BUF_H_ () {1;}' unless defined(&_SYS_BUF_H_);
    require 'sys/queue.ph';
    eval 'sub NOLIST () {(0x87654321);}' unless defined(&NOLIST);
    eval 'sub b_cylinder () { &b_resid;}' unless defined(&b_cylinder);
    eval 'sub b_active () { &b_bcount;}' unless defined(&b_active);
    eval 'sub b_data () { ($b_un->{b_addr});}' unless defined(&b_data);
    eval 'sub b_errcnt () { &b_resid;}' unless defined(&b_errcnt);
    eval 'sub iodone () { &biodone;}' unless defined(&iodone);
    eval 'sub iowait () { &biowait;}' unless defined(&iowait);
    eval 'sub B_AGE () {0x00000001;}' unless defined(&B_AGE);
    eval 'sub B_NEEDCOMMIT () {0x00000002;}' unless defined(&B_NEEDCOMMIT);
    eval 'sub B_ASYNC () {0x00000004;}' unless defined(&B_ASYNC);
    eval 'sub B_BAD () {0x00000008;}' unless defined(&B_BAD);
    eval 'sub B_BUSY () {0x00000010;}' unless defined(&B_BUSY);
    eval 'sub B_CACHE () {0x00000020;}' unless defined(&B_CACHE);
    eval 'sub B_CALL () {0x00000040;}' unless defined(&B_CALL);
    eval 'sub B_DELWRI () {0x00000080;}' unless defined(&B_DELWRI);
    eval 'sub B_DIRTY () {0x00000100;}' unless defined(&B_DIRTY);
    eval 'sub B_DONE () {0x00000200;}' unless defined(&B_DONE);
    eval 'sub B_EINTR () {0x00000400;}' unless defined(&B_EINTR);
    eval 'sub B_ERROR () {0x00000800;}' unless defined(&B_ERROR);
    eval 'sub B_GATHERED () {0x00001000;}' unless defined(&B_GATHERED);
    eval 'sub B_INVAL () {0x00002000;}' unless defined(&B_INVAL);
    eval 'sub B_LOCKED () {0x00004000;}' unless defined(&B_LOCKED);
    eval 'sub B_NOCACHE () {0x00008000;}' unless defined(&B_NOCACHE);
    eval 'sub B_PAGET () {0x00010000;}' unless defined(&B_PAGET);
    eval 'sub B_PGIN () {0x00020000;}' unless defined(&B_PGIN);
    eval 'sub B_PHYS () {0x00040000;}' unless defined(&B_PHYS);
    eval 'sub B_RAW () {0x00080000;}' unless defined(&B_RAW);
    eval 'sub B_READ () {0x00100000;}' unless defined(&B_READ);
    eval 'sub B_TAPE () {0x00200000;}' unless defined(&B_TAPE);
    eval 'sub B_UAREA () {0x00400000;}' unless defined(&B_UAREA);
    eval 'sub B_WANTED () {0x00800000;}' unless defined(&B_WANTED);
    eval 'sub B_WRITE () {0x00000000;}' unless defined(&B_WRITE);
    eval 'sub B_WRITEINPROG () {0x01000000;}' unless defined(&B_WRITEINPROG);
    eval 'sub B_XXX () {0x02000000;}' unless defined(&B_XXX);
    eval 'sub B_VFLUSH () {0x04000000;}' unless defined(&B_VFLUSH);
    eval 'sub clrbuf {
        local($bp) = @_;
	    eval q({  &bzero(-> &b_data, ($bp)-> &b_bcount); ($bp)-> &b_resid = 0; });
    }' unless defined(&clrbuf);
    eval 'sub B_CLRBUF () {0x01;}' unless defined(&B_CLRBUF);
    eval 'sub B_SYNC () {0x02;}' unless defined(&B_SYNC);
    if(defined(&_KERNEL)) {
	if(!defined( &UVM)) {
	}
    }
}
1;
