From 4eb53360541baf3e6df36dc0f0766bc7c1c9f8be Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 17 Oct 2013 17:04:51 -0700 Subject: Move as much I/O as possible off of native::io When uv's TTY I/O is used for the stdio streams, the file descriptors are put into a non-blocking mode. This means that other concurrent writes to the same stream can fail with EAGAIN or EWOULDBLOCK. By all I/O to event-loop I/O, we avoid this error. There is one location which cannot move, which is the runtime's dumb_println function. This was implemented to handle the EAGAIN and EWOULDBLOCK errors and simply retry again and again. --- src/rt/rust_uv.cpp | 5 +++++ src/rt/rustrt.def.in | 1 + 2 files changed, 6 insertions(+) (limited to 'src/rt') diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp index a47b3446d34..7ab57e6909a 100644 --- a/src/rt/rust_uv.cpp +++ b/src/rt/rust_uv.cpp @@ -681,3 +681,8 @@ extern "C" int rust_uv_tty_get_winsize(uv_tty_t *tty, int *width, int *height) { return uv_tty_get_winsize(tty, width, height); } + +extern "C" uv_handle_type +rust_uv_guess_handle(int fd) { + return uv_guess_handle(fd); +} diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 58862da31db..6c3988d6b01 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -217,3 +217,4 @@ rust_uv_pipe_connect rust_uv_tty_init rust_uv_tty_set_mode rust_uv_tty_get_winsize +rust_uv_guess_handle -- cgit 1.4.1-3-g733a5