about summary refs log tree commit diff
path: root/src/rt/rust_uv.cpp
diff options
context:
space:
mode:
authorJeff Olson <olson.jeffery@gmail.com>2013-08-15 23:54:54 -0700
committerJeff Olson <olson.jeffery@gmail.com>2013-08-22 16:31:57 -0700
commitdabbac1d6c06c00f24148ffc58b42455496fdd3c (patch)
tree06a67dbb456e735015310faaea41709249ff31d2 /src/rt/rust_uv.cpp
parenta901b166901601c6b132c2036882ad9754722f1c (diff)
downloadrust-dabbac1d6c06c00f24148ffc58b42455496fdd3c.tar.gz
rust-dabbac1d6c06c00f24148ffc58b42455496fdd3c.zip
std: working tests for low-level libuv open, write and close operations
Diffstat (limited to 'src/rt/rust_uv.cpp')
-rw-r--r--src/rt/rust_uv.cpp47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/rt/rust_uv.cpp b/src/rt/rust_uv.cpp
index b5d6e02b46a..a788b0f71a4 100644
--- a/src/rt/rust_uv.cpp
+++ b/src/rt/rust_uv.cpp
@@ -18,16 +18,13 @@
 #include <signal.h>
 #endif
 
+#include <fcntl.h>
 #include "uv.h"
 
 #include "rust_globals.h"
 
 extern "C" void*
 rust_uv_loop_new() {
-// XXX libuv doesn't always ignore SIGPIPE even though we don't need it.
-#ifndef __WIN32__
-    signal(SIGPIPE, SIG_IGN);
-#endif
     return (void*)uv_loop_new();
 }
 
@@ -517,3 +514,45 @@ extern "C" uintptr_t
 rust_uv_req_type_max() {
   return UV_REQ_TYPE_MAX;
 }
+
+extern "C" int
+rust_uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
+                int mode, uv_fs_cb cb) {
+  return uv_fs_open(loop, req, path, flags, mode, cb);
+}
+extern "C" int
+rust_uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file fd, uv_fs_cb cb) {
+  return uv_fs_close(loop, req, fd, cb);
+}
+extern "C" void
+rust_uv_fs_req_cleanup(uv_fs_t* req) {
+  uv_fs_req_cleanup(req);
+}
+extern "C" int
+rust_uv_get_O_RDONLY() {
+  return O_RDONLY;
+}
+extern "C" int
+rust_uv_get_O_WRONLY() {
+  return O_WRONLY;
+}
+extern "C" int
+rust_uv_get_O_RDWR() {
+  return O_RDWR;
+}
+extern "C" int
+rust_uv_get_O_CREAT() {
+  return O_CREAT;
+}
+extern "C" int
+rust_uv_get_O_TRUNC() {
+  return O_TRUNC;
+}
+extern "C" int
+rust_uv_get_result_from_fs_req(uv_fs_t* req) {
+  return req->result;
+}
+extern "C" uv_loop_t*
+rust_uv_get_loop_from_fs_req(uv_fs_t* req) {
+  return req->loop;
+}