require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_IOCTL_COMPAT_H_)) {
    eval 'sub _SYS_IOCTL_COMPAT_H_ () {1;}' unless defined(&_SYS_IOCTL_COMPAT_H_);
    require 'sys/ttychars.ph';
    require 'sys/ttydev.ph';
    unless(defined(&_SGTTYB_)) {
	eval 'sub _SGTTYB_ () {1;}' unless defined(&_SGTTYB_);
    }
    if(defined(&USE_OLD_TTY)) {
	undef(&TIOCGETD) if defined(&TIOCGETD);
	eval 'sub TIOCGETD () { &_IOR(ord(\'t\'), 0, \'int\');}' unless defined(&TIOCGETD);
	undef(&TIOCSETD) if defined(&TIOCSETD);
	eval 'sub TIOCSETD () { &_IOW(ord(\'t\'), 1, \'int\');}' unless defined(&TIOCSETD);
    } else {
	eval 'sub OTIOCGETD () { &_IOR(ord(\'t\'), 0, \'int\');}' unless defined(&OTIOCGETD);
	eval 'sub OTIOCSETD () { &_IOW(ord(\'t\'), 1, \'int\');}' unless defined(&OTIOCSETD);
    }
    eval 'sub TIOCHPCL () { &_IO(ord(\'t\'), 2);}' unless defined(&TIOCHPCL);
    eval 'sub TIOCGETP () { &_IOR(ord(\'t\'), 8,\'struct sgttyb\');}' unless defined(&TIOCGETP);
    eval 'sub TIOCSETP () { &_IOW(ord(\'t\'), 9,\'struct sgttyb\');}' unless defined(&TIOCSETP);
    eval 'sub TIOCSETN () { &_IOW(ord(\'t\'),10,\'struct sgttyb\');}' unless defined(&TIOCSETN);
    eval 'sub TIOCSETC () { &_IOW(ord(\'t\'),17,\'struct tchars\');}' unless defined(&TIOCSETC);
    eval 'sub TIOCGETC () { &_IOR(ord(\'t\'),18,\'struct tchars\');}' unless defined(&TIOCGETC);
    eval 'sub TANDEM () {0x1;}' unless defined(&TANDEM);
    eval 'sub CBREAK () {0x2;}' unless defined(&CBREAK);
    eval 'sub LCASE () {0x4;}' unless defined(&LCASE);
    eval 'sub ECHO () {0x8;}' unless defined(&ECHO);
    eval 'sub CRMOD () {0x10;}' unless defined(&CRMOD);
    eval 'sub RAW () {0x20;}' unless defined(&RAW);
    eval 'sub ODDP () {0x40;}' unless defined(&ODDP);
    eval 'sub EVENP () {0x80;}' unless defined(&EVENP);
    eval 'sub ANYP () {0xc0;}' unless defined(&ANYP);
    eval 'sub NLDELAY () {0x300;}' unless defined(&NLDELAY);
    eval 'sub NL0 () {0x;}' unless defined(&NL0);
    eval 'sub NL1 () {0x100;}' unless defined(&NL1);
    eval 'sub NL2 () {0x200;}' unless defined(&NL2);
    eval 'sub NL3 () {0x300;}' unless defined(&NL3);
    eval 'sub TBDELAY () {0xc00;}' unless defined(&TBDELAY);
    eval 'sub TAB0 () {0x;}' unless defined(&TAB0);
    eval 'sub TAB1 () {0x400;}' unless defined(&TAB1);
    eval 'sub TAB2 () {0x800;}' unless defined(&TAB2);
    eval 'sub XTABS () {0xc00;}' unless defined(&XTABS);
    eval 'sub CRDELAY () {0x3000;}' unless defined(&CRDELAY);
    eval 'sub CR0 () {0x;}' unless defined(&CR0);
    eval 'sub CR1 () {0x1000;}' unless defined(&CR1);
    eval 'sub CR2 () {0x2000;}' unless defined(&CR2);
    eval 'sub CR3 () {0x3000;}' unless defined(&CR3);
    eval 'sub VTDELAY () {0x4000;}' unless defined(&VTDELAY);
    eval 'sub FF0 () {0x;}' unless defined(&FF0);
    eval 'sub FF1 () {0x4000;}' unless defined(&FF1);
    eval 'sub BSDELAY () {0x8000;}' unless defined(&BSDELAY);
    eval 'sub BS0 () {0x;}' unless defined(&BS0);
    eval 'sub BS1 () {0x8000;}' unless defined(&BS1);
    eval 'sub ALLDELAY () {( &NLDELAY| &TBDELAY| &CRDELAY| &VTDELAY| &BSDELAY);}' unless defined(&ALLDELAY);
    eval 'sub CRTBS () {0x10000;}' unless defined(&CRTBS);
    eval 'sub PRTERA () {0x20000;}' unless defined(&PRTERA);
    eval 'sub CRTERA () {0x40000;}' unless defined(&CRTERA);
    eval 'sub TILDE () {0x80000;}' unless defined(&TILDE);
    eval 'sub MDMBUF () {0x100000;}' unless defined(&MDMBUF);
    eval 'sub LITOUT () {0x200000;}' unless defined(&LITOUT);
    eval 'sub TOSTOP () {0x400000;}' unless defined(&TOSTOP);
    eval 'sub FLUSHO () {0x800000;}' unless defined(&FLUSHO);
    eval 'sub NOHANG () {0x1000000;}' unless defined(&NOHANG);
    eval 'sub L001000 () {0x2000000;}' unless defined(&L001000);
    eval 'sub CRTKIL () {0x4000000;}' unless defined(&CRTKIL);
    eval 'sub PASS8 () {0x8000000;}' unless defined(&PASS8);
    eval 'sub CTLECH () {0x10000000;}' unless defined(&CTLECH);
    eval 'sub PENDIN () {0x20000000;}' unless defined(&PENDIN);
    eval 'sub DECCTQ () {0x40000000;}' unless defined(&DECCTQ);
    eval 'sub NOFLSH () {0x80000000;}' unless defined(&NOFLSH);
    eval 'sub TIOCLBIS () { &_IOW(ord(\'t\'), 127, \'int\');}' unless defined(&TIOCLBIS);
    eval 'sub TIOCLBIC () { &_IOW(ord(\'t\'), 126, \'int\');}' unless defined(&TIOCLBIC);
    eval 'sub TIOCLSET () { &_IOW(ord(\'t\'), 125, \'int\');}' unless defined(&TIOCLSET);
    eval 'sub TIOCLGET () { &_IOR(ord(\'t\'), 124, \'int\');}' unless defined(&TIOCLGET);
    eval 'sub LCRTBS () {( &CRTBS>>16);}' unless defined(&LCRTBS);
    eval 'sub LPRTERA () {( &PRTERA>>16);}' unless defined(&LPRTERA);
    eval 'sub LCRTERA () {( &CRTERA>>16);}' unless defined(&LCRTERA);
    eval 'sub LTILDE () {( &TILDE>>16);}' unless defined(&LTILDE);
    eval 'sub LMDMBUF () {( &MDMBUF>>16);}' unless defined(&LMDMBUF);
    eval 'sub LLITOUT () {( &LITOUT>>16);}' unless defined(&LLITOUT);
    eval 'sub LTOSTOP () {( &TOSTOP>>16);}' unless defined(&LTOSTOP);
    eval 'sub LFLUSHO () {( &FLUSHO>>16);}' unless defined(&LFLUSHO);
    eval 'sub LNOHANG () {( &NOHANG>>16);}' unless defined(&LNOHANG);
    eval 'sub LCRTKIL () {( &CRTKIL>>16);}' unless defined(&LCRTKIL);
    eval 'sub LPASS8 () {( &PASS8>>16);}' unless defined(&LPASS8);
    eval 'sub LCTLECH () {( &CTLECH>>16);}' unless defined(&LCTLECH);
    eval 'sub LPENDIN () {( &PENDIN>>16);}' unless defined(&LPENDIN);
    eval 'sub LDECCTQ () {( &DECCTQ>>16);}' unless defined(&LDECCTQ);
    eval 'sub LNOFLSH () {( &NOFLSH>>16);}' unless defined(&LNOFLSH);
    eval 'sub TIOCSLTC () { &_IOW(ord(\'t\'),117,\'struct ltchars\');}' unless defined(&TIOCSLTC);
    eval 'sub TIOCGLTC () { &_IOR(ord(\'t\'),116,\'struct ltchars\');}' unless defined(&TIOCGLTC);
    eval 'sub OTIOCCONS () { &_IO(ord(\'t\'), 98);}' unless defined(&OTIOCCONS);
    eval 'sub OTTYDISC () {0;}' unless defined(&OTTYDISC);
    eval 'sub NETLDISC () {1;}' unless defined(&NETLDISC);
    eval 'sub NTTYDISC () {2;}' unless defined(&NTTYDISC);
    eval 'sub TIOCGSID () { &_IOR(ord(\'t\'), 99, \'int\');}' unless defined(&TIOCGSID);
    eval 'sub PTIOCLINUX () { &_IOW(ord(\'Z\'), 3, \'struct ioctl_pt\');}' unless defined(&PTIOCLINUX);
}
1;
