require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_SIGNAL_H_)) {
    eval 'sub _SYS_SIGNAL_H_ () {1;}' unless defined(&_SYS_SIGNAL_H_);
    require 'sys/cdefs.ph';
    require 'machine/signal.ph';
    eval 'sub _NSIG () {32;}' unless defined(&_NSIG);
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0)) {
	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);
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0)) {
	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);
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0)) {
	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);
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0)) {
	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 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);
    if((defined(&__POSIX_VISIBLE) ? &__POSIX_VISIBLE : 0) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : 0)) {
	require 'sys/siginfo.ph';
	eval 'sub sa_handler () { ($__sigaction_u->{__sa_handler});}' unless defined(&sa_handler);
	eval 'sub sa_sigaction () { ($__sigaction_u->{__sa_sigaction});}' unless defined(&sa_sigaction);
	if((defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : 0) >= 500) {
	    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_NOCLDWAIT () {0x20;}' unless defined(&SA_NOCLDWAIT);
	    if(defined(&COMPAT_SUNOS)) {
		eval 'sub SA_USERTRAMP () {0x100;}' unless defined(&SA_USERTRAMP);
	    }
	}
	eval 'sub SA_NOCLDSTOP () {0x8;}' unless defined(&SA_NOCLDSTOP);
	if((defined(&__POSIX_VISIBLE) ? &__POSIX_VISIBLE : 0) >= 199309|| (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : 0) >= 500) {
	    eval 'sub SA_SIGINFO () {0x40;}' unless defined(&SA_SIGINFO);
	}
	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(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0)) {
	eval 'sub SV_ONSTACK () { &SA_ONSTACK;}' unless defined(&SV_ONSTACK);
	eval 'sub SV_INTERRUPT () { &SA_RESTART;}' unless defined(&SV_INTERRUPT);
	eval 'sub SV_RESETHAND () { &SA_RESETHAND;}' unless defined(&SV_RESETHAND);
	eval 'sub sv_onstack () { &sv_flags;}' unless defined(&sv_onstack);
	eval 'sub sigmask {
	    my($m) = @_;
    	    eval q((1<< (($m)-1)));
	}' unless defined(&sigmask);
	eval 'sub BADSIG () { &SIG_ERR;}' unless defined(&BADSIG);
    }
    if((defined(&__BSD_VISIBLE) ? &__BSD_VISIBLE : 0) || (defined(&__XPG_VISIBLE) ? &__XPG_VISIBLE : 0) >= 420) {
	eval 'sub SS_ONSTACK () {0x1;}' unless defined(&SS_ONSTACK);
	eval 'sub SS_DISABLE () {0x4;}' unless defined(&SS_DISABLE);
	eval 'sub MINSIGSTKSZ () {8192;}' unless defined(&MINSIGSTKSZ);
	eval 'sub SIGSTKSZ () {( &MINSIGSTKSZ + 32768);}' unless defined(&SIGSTKSZ);
	if(defined(&_KERNEL)) {
	}
    }
}
1;
