#ifndef WIN32
#include <errno.h>
+#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/ioctl.h>
#endif
}
+void Console::redirect(Base &other)
+{
+ Handle other_handle = other.get_handle(mode&M_RDWR);
+#ifdef WIN32
+ SetStdHandle(stream_to_sys(stream), *other_handle);
+#else
+ dup2(*other_handle, *handle);
+#endif
+}
+
unsigned Console::do_write(const char *buf, unsigned len)
{
check_access(M_WRITE);