require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_SIGNAL_H_)) {
    eval 'sub _SYS_SIGNAL_H_ () {1;}' unless defined(&_SYS_SIGNAL_H_);
    require 'sys/featuretest.ph';
    require 'sys/sigtypes.ph';
    eval 'sub _NSIG () {64;}' unless defined(&_NSIG);
    if(defined(&_NETBSD_SOURCE)) {
	eval 'sub NSIG () { &_NSIG;}' unless defined(&NSIG);
    }
    eval 'sub SIGHUP () {1;}' unless defined(&SIGHUP);
    eval 'sub SIGINT () {2;}' unless defined(&SIGINT);
    eval 'sub SIGQUIT () {3;}' unless defined(&SIGQUIT);
    eval 'sub SIGILL () {4;}' unless defined(&SIGILL);
    eval 'sub SIGTRAP () {5;}' unless defined(&SIGTRAP);
    eval 'sub SIGABRT () {6;}' unless defined(&SIGABRT);
    eval 'sub SIGIOT () { &SIGABRT;}' unless defined(&SIGIOT);
    eval 'sub SIGEMT () {7;}' unless defined(&SIGEMT);
    eval 'sub SIGFPE () {8;}' unless defined(&SIGFPE);
    eval 'sub SIGKILL () {9;}' unless defined(&SIGKILL);
    eval 'sub SIGBUS () {10;}' unless defined(&SIGBUS);
    eval 'sub SIGSEGV () {11;}' unless defined(&SIGSEGV);
    eval 'sub SIGSYS () {12;}' unless defined(&SIGSYS);
    eval 'sub SIGPIPE () {13;}' unless defined(&SIGPIPE);
    eval 'sub SIGALRM () {14;}' unless defined(&SIGALRM);
    eval 'sub SIGTERM () {15;}' unless defined(&SIGTERM);
    eval 'sub SIGURG () {16;}' unless defined(&SIGURG);
    eval 'sub SIGSTOP () {17;}' unless defined(&SIGSTOP);
    eval 'sub SIGTSTP () {18;}' unless defined(&SIGTSTP);
    eval 'sub SIGCONT () {19;}' unless defined(&SIGCONT);
    eval 'sub SIGCHLD () {20;}' unless defined(&SIGCHLD);
    eval 'sub SIGTTIN () {21;}' unless defined(&SIGTTIN);
    eval 'sub SIGTTOU () {22;}' unless defined(&SIGTTOU);
    eval 'sub SIGIO () {23;}' unless defined(&SIGIO);
    eval 'sub SIGXCPU () {24;}' unless defined(&SIGXCPU);
    eval 'sub SIGXFSZ () {25;}' unless defined(&SIGXFSZ);
    eval 'sub SIGVTALRM () {26;}' unless defined(&SIGVTALRM);
    eval 'sub SIGPROF () {27;}' unless defined(&SIGPROF);
    eval 'sub SIGWINCH () {28;}' unless defined(&SIGWINCH);
    eval 'sub SIGINFO () {29;}' unless defined(&SIGINFO);
    eval 'sub SIGUSR1 () {30;}' unless defined(&SIGUSR1);
    eval 'sub SIGUSR2 () {31;}' unless defined(&SIGUSR2);
    eval 'sub SIGPWR () {32;}' unless defined(&SIGPWR);
    eval 'sub SIGRTMIN () {33;}' unless defined(&SIGRTMIN);
    eval 'sub SIGRTMAX () {63;}' unless defined(&SIGRTMAX);
    unless(defined(&_KERNEL)) {
	require 'sys/cdefs.ph';
    }
    eval 'sub SIG_DFL () {(0);}' unless defined(&SIG_DFL);
    eval 'sub SIG_IGN () {(1);}' unless defined(&SIG_IGN);
    eval 'sub SIG_ERR () {(-1);}' unless defined(&SIG_ERR);
    eval 'sub SIG_HOLD () {(3);}' unless defined(&SIG_HOLD);
    if(defined(&_POSIX_C_SOURCE) || defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	if(defined(&_KERNEL)) {
	    eval 'sub sigaddset {
	        my($s, $n) = @_;
    		eval q( &__sigaddset($s, $n));
	    }' unless defined(&sigaddset);
	    eval 'sub sigdelset {
	        my($s, $n) = @_;
    		eval q( &__sigdelset($s, $n));
	    }' unless defined(&sigdelset);
	    eval 'sub sigismember {
	        my($s, $n) = @_;
    		eval q( &__sigismember($s, $n));
	    }' unless defined(&sigismember);
	    eval 'sub sigemptyset {
	        my($s) = @_;
    		eval q( &__sigemptyset($s));
	    }' unless defined(&sigemptyset);
	    eval 'sub sigfillset {
	        my($s) = @_;
    		eval q( &__sigfillset($s));
	    }' unless defined(&sigfillset);
	    eval 'sub sigplusset {
	        my($s, $t) = @_;
    		eval q( &__sigplusset($s, $t));
	    }' unless defined(&sigplusset);
	    eval 'sub sigminusset {
	        my($s, $t) = @_;
    		eval q( &__sigminusset($s, $t));
	    }' unless defined(&sigminusset);
	}
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199309 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    require 'sys/siginfo.ph';
	}
	if((defined(&_XOPEN_SOURCE)  && defined(&_XOPEN_SOURCE_EXTENDED)) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    require 'sys/ucontext.ph';
	}
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199309 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	}
	eval 'sub sa_handler () { ($_sa_u->{_sa_handler});}' unless defined(&sa_handler);
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199309 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    eval 'sub sa_sigaction () { ($_sa_u->{_sa_sigaction});}' unless defined(&sa_sigaction);
	}
	require 'machine/signal.ph';
	eval 'sub __SIGTRAMP_SIGCODE_VERSION () {0;}' unless defined(&__SIGTRAMP_SIGCODE_VERSION);
	eval 'sub __SIGTRAMP_SIGCONTEXT_VERSION_MIN () {1;}' unless defined(&__SIGTRAMP_SIGCONTEXT_VERSION_MIN);
	unless(defined(&__SIGTRAMP_SIGCONTEXT_VERSION_MAX)) {
	    eval 'sub __SIGTRAMP_SIGCONTEXT_VERSION_MAX () {1;}' unless defined(&__SIGTRAMP_SIGCONTEXT_VERSION_MAX);
	}
	unless(defined(&__SIGTRAMP_SIGCONTEXT_VERSION)) {
	    eval 'sub __SIGTRAMP_SIGCONTEXT_VERSION () {1;}' unless defined(&__SIGTRAMP_SIGCONTEXT_VERSION);
	}
	if((defined(&__SIGTRAMP_SIGCONTEXT_VERSION_MAX) ? &__SIGTRAMP_SIGCONTEXT_VERSION_MAX : undef) < (defined(&__SIGTRAMP_SIGCONTEXT_VERSION_MIN) ? &__SIGTRAMP_SIGCONTEXT_VERSION_MIN : undef)) {
	    die("invalid\ __SIGTRAMP_SIGCONTEXT_VERSION_MAX");
	}
	unless(defined(&__SIGTRAMP_SIGINFO_VERSION_MIN)) {
	    eval 'sub __SIGTRAMP_SIGINFO_VERSION_MIN () {2;}' unless defined(&__SIGTRAMP_SIGINFO_VERSION_MIN);
	}
	unless(defined(&__SIGTRAMP_SIGINFO_VERSION_MAX)) {
	    eval 'sub __SIGTRAMP_SIGINFO_VERSION_MAX () {2;}' unless defined(&__SIGTRAMP_SIGINFO_VERSION_MAX);
	}
	unless(defined(&__SIGTRAMP_SIGINFO_VERSION)) {
	    eval 'sub __SIGTRAMP_SIGINFO_VERSION () {2;}' unless defined(&__SIGTRAMP_SIGINFO_VERSION);
	}
	if((defined(&__SIGTRAMP_SIGINFO_VERSION_MAX) ? &__SIGTRAMP_SIGINFO_VERSION_MAX : undef) < (defined(&__SIGTRAMP_SIGINFO_VERSION_MIN) ? &__SIGTRAMP_SIGINFO_VERSION_MIN : undef)) {
	    die("invalid\ __SIGTRAMP_SIGINFO_VERSION_MAX");
	}
	if((defined(&_XOPEN_SOURCE)  && defined(&_XOPEN_SOURCE_EXTENDED)) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || defined(&_NETBSD_SOURCE)) {
	    eval 'sub SA_ONSTACK () {0x1;}' unless defined(&SA_ONSTACK);
	    eval 'sub SA_RESTART () {0x2;}' unless defined(&SA_RESTART);
	    eval 'sub SA_RESETHAND () {0x4;}' unless defined(&SA_RESETHAND);
	    eval 'sub SA_NODEFER () {0x10;}' unless defined(&SA_NODEFER);
	}
	eval 'sub SA_NOCLDSTOP () {0x8;}' unless defined(&SA_NOCLDSTOP);
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199309 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    eval 'sub SA_NOCLDWAIT () {0x20;}' unless defined(&SA_NOCLDWAIT);
	    eval 'sub SA_SIGINFO () {0x40;}' unless defined(&SA_SIGINFO);
	}
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub SA_NOKERNINFO () {0x80;}' unless defined(&SA_NOKERNINFO);
	}
	if(defined(&_KERNEL)) {
	    eval 'sub SA_ALLBITS () {0xff;}' unless defined(&SA_ALLBITS);
	}
	eval 'sub SIG_BLOCK () {1;}' unless defined(&SIG_BLOCK);
	eval 'sub SIG_UNBLOCK () {2;}' unless defined(&SIG_UNBLOCK);
	eval 'sub SIG_SETMASK () {3;}' unless defined(&SIG_SETMASK);
	if(defined(&_NETBSD_SOURCE)) {
	    eval 'sub SS_INIT () {(( &stack_t) { . &ss_sp =  &NULL, . &ss_flags =  &SS_DISABLE, . &ss_size = 0});}' unless defined(&SS_INIT);
	}
	if((defined(&_XOPEN_SOURCE)  && defined(&_XOPEN_SOURCE_EXTENDED)) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || defined(&_NETBSD_SOURCE)) {
	    eval 'sub SS_ONSTACK () {0x1;}' unless defined(&SS_ONSTACK);
	    eval 'sub SS_DISABLE () {0x4;}' unless defined(&SS_DISABLE);
	    if(defined(&_KERNEL)) {
		eval 'sub SS_ALLBITS () {0x5;}' unless defined(&SS_ALLBITS);
	    }
	    eval 'sub MINSIGSTKSZ () {8192;}' unless defined(&MINSIGSTKSZ);
	    eval 'sub SIGSTKSZ () {( &MINSIGSTKSZ + 32768);}' unless defined(&SIGSTKSZ);
	}
	if((defined(&_XOPEN_SOURCE)  && defined(&_XOPEN_SOURCE_EXTENDED)) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || defined(&_NETBSD_SOURCE)) {
	}
	if(defined(&_NETBSD_SOURCE)  && !defined(&_KERNEL)) {
	    eval 'sub sigmask {
	        my($n) = @_;
    		eval q( &__sigmask($n));
	    }' unless defined(&sigmask);
	    eval 'sub BADSIG () { &SIG_ERR;}' unless defined(&BADSIG);
	}
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199309 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    eval 'sub SIGEV_NONE () {0;}' unless defined(&SIGEV_NONE);
	    eval 'sub SIGEV_SIGNAL () {1;}' unless defined(&SIGEV_SIGNAL);
	    eval 'sub SIGEV_THREAD () {2;}' unless defined(&SIGEV_THREAD);
	    if(defined(&_NETBSD_SOURCE)) {
		eval 'sub SIGEV_SA () {3;}' unless defined(&SIGEV_SA);
	    }
	}
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_NETBSD_SOURCE) || (!defined (&_XOPEN_SOURCE)  && defined(&_XOPEN_VERSION)  && ((defined(&_XOPEN_VERSION) ? &_XOPEN_VERSION : undef) - 0) >= 4) || (defined(&_XOPEN_SOURCE)  && ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) <= 600)) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
}
1;
