require '_h2ph_pre.ph';

unless(defined(&_SYS_SEM_H_)) {
    eval 'sub _SYS_SEM_H_ () {1;}' unless defined(&_SYS_SEM_H_);
    require 'sys/ipc.ph';
    if(defined(&_KERNEL)) {
    }
    eval 'sub SEM_UNDO () {010000;}' unless defined(&SEM_UNDO);
    eval 'sub MAX_SOPS () {5;}' unless defined(&MAX_SOPS);
    eval 'sub GETNCNT () {3;}' unless defined(&GETNCNT);
    eval 'sub GETPID () {4;}' unless defined(&GETPID);
    eval 'sub GETVAL () {5;}' unless defined(&GETVAL);
    eval 'sub GETALL () {6;}' unless defined(&GETALL);
    eval 'sub GETZCNT () {7;}' unless defined(&GETZCNT);
    eval 'sub SETVAL () {8;}' unless defined(&SETVAL);
    eval 'sub SETALL () {9;}' unless defined(&SETALL);
    eval 'sub SEM_A () {0200;}' unless defined(&SEM_A);
    eval 'sub SEM_R () {0400;}' unless defined(&SEM_R);
    if(defined(&_KERNEL)) {
	eval 'sub SEMVMX () {32767;}' unless defined(&SEMVMX);
	eval 'sub SEMAEM () {16384;}' unless defined(&SEMAEM);
	eval 'sub SEM_ALLOC () {01000;}' unless defined(&SEM_ALLOC);
	eval 'sub SEM_DEST () {02000;}' unless defined(&SEM_DEST);
	unless(defined(&SEMMNI)) {
	    eval 'sub SEMMNI () {10;}' unless defined(&SEMMNI);
	}
	unless(defined(&SEMMNS)) {
	    eval 'sub SEMMNS () {60;}' unless defined(&SEMMNS);
	}
	unless(defined(&SEMUME)) {
	    eval 'sub SEMUME () {10;}' unless defined(&SEMUME);
	}
	unless(defined(&SEMMNU)) {
	    eval 'sub SEMMNU () {30;}' unless defined(&SEMMNU);
	}
	unless(defined(&SEMMAP)) {
	    eval 'sub SEMMAP () {30;}' unless defined(&SEMMAP);
	}
	unless(defined(&SEMMSL)) {
	    eval 'sub SEMMSL () { &SEMMNS;}' unless defined(&SEMMSL);
	}
	unless(defined(&SEMOPM)) {
	    eval 'sub SEMOPM () {100;}' unless defined(&SEMOPM);
	}
	eval 'sub SEMUSZ () {($sizeof{\'struct sem_undo\'}+$sizeof{\'struct undo\'}* &SEMUME);}' unless defined(&SEMUSZ);
	eval 'sub SEMU {
	    local($ix) = @_;
    	    eval q(((( &semu)+$ix *  &SEMUSZ)));
	}' unless defined(&SEMU);
	eval 'sub SEM_CONFIG_FREEZE () {0;}' unless defined(&SEM_CONFIG_FREEZE);
	eval 'sub SEM_CONFIG_THAW () {1;}' unless defined(&SEM_CONFIG_THAW);
    }
    unless(defined(&_KERNEL)) {
	require 'sys/cdefs.ph';
    } else {
    }
}
1;
