require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_RMT_H_)) {
    eval 'sub _RMT_H_ () {1;}' unless defined(&_RMT_H_);
    require 'sys/cdefs.ph';
    require 'sys/types.ph';
    if((defined(&_FORTIFY_SOURCE) ? &_FORTIFY_SOURCE : undef) > 0) {
	eval 'sub __ssp_weak_name {
	    my($x) = @_;
    	    eval q( &rmt  $x);
	}' unless defined(&__ssp_weak_name);
	require 'ssp/unistd.ph';
    }
    unless(defined(&__RMTLIB_PRIVATE)) {
	eval 'sub access () { &rmtaccess;}' unless defined(&access);
	eval 'sub close () { &rmtclose;}' unless defined(&close);
	eval 'sub creat () { &rmtcreat;}' unless defined(&creat);
	eval 'sub dup () { &rmtdup;}' unless defined(&dup);
	eval 'sub fcntl () { &rmtfcntl;}' unless defined(&fcntl);
	eval 'sub fstat () { &rmtfstat;}' unless defined(&fstat);
	eval 'sub ioctl () { &rmtioctl;}' unless defined(&ioctl);
	eval 'sub isatty () { &rmtisatty;}' unless defined(&isatty);
	eval 'sub lseek () { &rmtlseek;}' unless defined(&lseek);
	eval 'sub lstat () { &rmtlstat;}' unless defined(&lstat);
	eval 'sub open () { &rmtopen;}' unless defined(&open);
	if((defined(&__SSP_FORTIFY_LEVEL) ? &__SSP_FORTIFY_LEVEL : undef) == 0) {
	    eval 'sub read () { &rmtread;}' unless defined(&read);
	}
	eval 'sub stat () { &rmtstat;}' unless defined(&stat);
	eval 'sub write () { &rmtwrite;}' unless defined(&write);
    }
}
1;
