require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_POLL_H_)) {
    eval 'sub _SYS_POLL_H_ () {1;}' unless defined(&_SYS_POLL_H_);
    require 'sys/featuretest.ph';
    eval 'sub POLLIN () {0x1;}' unless defined(&POLLIN);
    eval 'sub POLLPRI () {0x2;}' unless defined(&POLLPRI);
    eval 'sub POLLOUT () {0x4;}' unless defined(&POLLOUT);
    eval 'sub POLLRDNORM () {0x40;}' unless defined(&POLLRDNORM);
    eval 'sub POLLWRNORM () { &POLLOUT;}' unless defined(&POLLWRNORM);
    eval 'sub POLLRDBAND () {0x80;}' unless defined(&POLLRDBAND);
    eval 'sub POLLWRBAND () {0x100;}' unless defined(&POLLWRBAND);
    eval 'sub POLLERR () {0x8;}' unless defined(&POLLERR);
    eval 'sub POLLHUP () {0x10;}' unless defined(&POLLHUP);
    eval 'sub POLLNVAL () {0x20;}' unless defined(&POLLNVAL);
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub INFTIM () {-1;}' unless defined(&INFTIM);
    }
    if(defined(&_KERNEL)) {
	require 'sys/signal.ph';
    } else {
	require 'sys/cdefs.ph';
	if(defined(&_NETBSD_SOURCE)) {
	    require 'sys/sigtypes.ph';
	    unless(defined(&__LIBC12_SOURCE__)) {
	    }
	}
    }
}
1;
