require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_SYSLIMITS_H_)) {
    eval 'sub _SYS_SYSLIMITS_H_ () {1;}' unless defined(&_SYS_SYSLIMITS_H_);
    require 'sys/featuretest.ph';
    if(defined(&_KERNEL_OPT)) {
	require './sys/opt_syslimits.ph';
    }
    if(defined(&_POSIX_C_SOURCE) || defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	eval 'sub ARG_MAX () {(256* 1024);}' unless defined(&ARG_MAX);
	unless(defined(&CHILD_MAX)) {
	    eval 'sub CHILD_MAX () {160;}' unless defined(&CHILD_MAX);
	}
	eval 'sub GID_MAX () {2147483647;}' unless defined(&GID_MAX);
	eval 'sub LINK_MAX () {32767;}' unless defined(&LINK_MAX);
	eval 'sub MAX_CANON () {255;}' unless defined(&MAX_CANON);
	eval 'sub MAX_INPUT () {255;}' unless defined(&MAX_INPUT);
	eval 'sub NAME_MAX () {511;}' unless defined(&NAME_MAX);
	eval 'sub NGROUPS_MAX () {16;}' unless defined(&NGROUPS_MAX);
	eval 'sub UID_MAX () {2147483647;}' unless defined(&UID_MAX);
	unless(defined(&OPEN_MAX)) {
	    eval 'sub OPEN_MAX () {128;}' unless defined(&OPEN_MAX);
	}
	eval 'sub PATH_MAX () {1024;}' unless defined(&PATH_MAX);
	eval 'sub PIPE_BUF () {512;}' unless defined(&PIPE_BUF);
	eval 'sub BC_BASE_MAX () { &INT_MAX;}' unless defined(&BC_BASE_MAX);
	eval 'sub BC_DIM_MAX () {65535;}' unless defined(&BC_DIM_MAX);
	eval 'sub BC_SCALE_MAX () { &INT_MAX;}' unless defined(&BC_SCALE_MAX);
	eval 'sub BC_STRING_MAX () { &INT_MAX;}' unless defined(&BC_STRING_MAX);
	eval 'sub COLL_WEIGHTS_MAX () {2;}' unless defined(&COLL_WEIGHTS_MAX);
	eval 'sub EXPR_NEST_MAX () {32;}' unless defined(&EXPR_NEST_MAX);
	eval 'sub LINE_MAX () {2048;}' unless defined(&LINE_MAX);
	eval 'sub RE_DUP_MAX () {255;}' unless defined(&RE_DUP_MAX);
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 199506 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 500|| defined(&_NETBSD_SOURCE)) {
	    eval 'sub LOGIN_NAME_MAX () {17;}' unless defined(&LOGIN_NAME_MAX);
	}
	if(defined(&_XOPEN_SOURCE) || defined(&_NETBSD_SOURCE)) {
	    eval 'sub IOV_MAX () {1024;}' unless defined(&IOV_MAX);
	    eval 'sub NZERO () {20;}' unless defined(&NZERO);
	}
    }
}
1;
