]> git.lizzy.rs Git - rust.git/commitdiff
Fixing rebase conflicts and such
authorAlex Crichton <alex@alexcrichton.com>
Mon, 4 Nov 2013 22:03:32 +0000 (14:03 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 10 Nov 2013 09:37:10 +0000 (01:37 -0800)
This cleans up the merging of removing ~fn() and removing C++ wrappers to a
compile-able and progress-ready state

src/librustuv/async.rs
src/librustuv/file.rs
src/librustuv/idle.rs
src/librustuv/lib.rs
src/librustuv/process.rs
src/librustuv/signal.rs
src/librustuv/timer.rs
src/librustuv/uvio.rs
src/librustuv/uvll.rs

index 27f6439a12d4774274997cd713b18ddb0be3bb06..0b93e8fa49fcba25c8c8aaee32f7dd6dbf680913 100644 (file)
@@ -35,7 +35,7 @@ impl AsyncWatcher {
     pub fn new(loop_: &mut Loop, cb: ~Callback) -> AsyncWatcher {
         let handle = UvHandle::alloc(None::<AsyncWatcher>, uvll::UV_ASYNC);
         assert_eq!(unsafe {
-            uvll::async_init(loop_.native_handle(), handle, async_cb)
+            uvll::uv_async_init(loop_.native_handle(), handle, async_cb)
         }, 0);
         let flag = Exclusive::new(false);
         let payload = ~Payload { callback: cb, exit_flag: flag.clone() };
@@ -49,7 +49,7 @@ pub fn new(loop_: &mut Loop, cb: ~Callback) -> AsyncWatcher {
 
 impl UvHandle<uvll::uv_async_t> for AsyncWatcher {
     fn uv_handle(&self) -> *uvll::uv_async_t { self.handle }
-    unsafe fn from_uv_handle<'a>(h: &'a *T) -> &'a mut AsyncWatcher {
+    unsafe fn from_uv_handle<'a>(_: &'a *uvll::uv_async_t) -> &'a mut AsyncWatcher {
         fail!("async watchers can't be built from their handles");
     }
 }
@@ -89,7 +89,7 @@ unsafe fn from_uv_handle<'a>(h: &'a *T) -> &'a mut AsyncWatcher {
     payload.callback.call();
 
     if should_exit {
-        unsafe { uvll::close(handle, close_cb) }
+        unsafe { uvll::uv_close(handle, close_cb) }
     }
 }
 
@@ -104,7 +104,7 @@ unsafe fn from_uv_handle<'a>(h: &'a *T) -> &'a mut AsyncWatcher {
 
 impl RemoteCallback for AsyncWatcher {
     fn fire(&mut self) {
-        unsafe { uvll::async_send(self.handle) }
+        unsafe { uvll::uv_async_send(self.handle) }
     }
 }
 
@@ -117,7 +117,7 @@ fn drop(&mut self) {
                 // signal and see the exit flag, destroying the handle
                 // before the final send.
                 *should_exit = true;
-                uvll::async_send(self.handle)
+                uvll::uv_async_send(self.handle)
             }
         }
     }
index e3fe6c95bafe7fd84db827040148cc73eddd0066..0ff4543a116b008e4fc80b76a20d50c25871dcd0 100644 (file)
@@ -13,7 +13,7 @@
 use std::c_str::CString;
 use std::cast::transmute;
 use std::libc;
-use std::libc::{c_int, c_char, c_void};
+use std::libc::{c_int, c_char, c_void, c_uint};
 
 use super::{Request, NativeHandle, Loop, FsCallback, Buf,
             status_to_maybe_uv_error, UvError};
@@ -147,25 +147,12 @@ pub fn read_sync(mut self, loop_: &Loop, fd: c_int, buf: Buf, offset: i64)
         self.sync_cleanup(result)
     }
 
-<<<<<<< HEAD
     pub fn close(mut self, loop_: &Loop, fd: c_int, cb: FsCallback) {
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(unsafe {
-            uvll::fs_close(loop_.native_handle(), self.native_handle(),
-                           fd, complete_cb_ptr)
-        }, 0);
-=======
-    pub fn close(self, loop_: &Loop, fd: c_int, cb: FsCallback) {
-        let complete_cb_ptr = {
-            let mut me = self;
-            me.req_boilerplate(Some(cb))
-        };
-        let ret = unsafe {
             uvll::uv_fs_close(loop_.native_handle(), self.native_handle(),
                               fd, complete_cb_ptr)
-        };
-        assert_eq!(ret, 0);
->>>>>>> 1850d26... Remove lots of uv/C++ wrappers
+        }, 0);
     }
     pub fn close_sync(mut self, loop_: &Loop,
                       fd: c_int) -> Result<c_int, UvError> {
@@ -177,21 +164,20 @@ pub fn close_sync(mut self, loop_: &Loop,
         self.sync_cleanup(result)
     }
 
-<<<<<<< HEAD
     pub fn mkdir(mut self, loop_: &Loop, path: &CString, mode: c_int,
                  cb: FsCallback) {
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(path.with_ref(|p| unsafe {
-            uvll::fs_mkdir(loop_.native_handle(),
-                           self.native_handle(), p, mode, complete_cb_ptr)
+            uvll::uv_fs_mkdir(loop_.native_handle(),
+                              self.native_handle(), p, mode, complete_cb_ptr)
         }), 0);
     }
 
     pub fn rmdir(mut self, loop_: &Loop, path: &CString, cb: FsCallback) {
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(path.with_ref(|p| unsafe {
-            uvll::fs_rmdir(loop_.native_handle(),
-                           self.native_handle(), p, complete_cb_ptr)
+            uvll::uv_fs_rmdir(loop_.native_handle(),
+                              self.native_handle(), p, complete_cb_ptr)
         }), 0);
     }
 
@@ -199,11 +185,11 @@ pub fn rename(mut self, loop_: &Loop, path: &CString, to: &CString,
                   cb: FsCallback) {
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(unsafe {
-            uvll::fs_rename(loop_.native_handle(),
-                            self.native_handle(),
-                            path.with_ref(|p| p),
-                            to.with_ref(|p| p),
-                            complete_cb_ptr)
+            uvll::uv_fs_rename(loop_.native_handle(),
+                               self.native_handle(),
+                               path.with_ref(|p| p),
+                               to.with_ref(|p| p),
+                               complete_cb_ptr)
         }, 0);
     }
 
@@ -211,43 +197,17 @@ pub fn chmod(mut self, loop_: &Loop, path: &CString, mode: c_int,
                  cb: FsCallback) {
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(path.with_ref(|p| unsafe {
-            uvll::fs_chmod(loop_.native_handle(), self.native_handle(), p, mode,
-                           complete_cb_ptr)
+            uvll::uv_fs_chmod(loop_.native_handle(), self.native_handle(), p,
+                              mode, complete_cb_ptr)
         }), 0);
-=======
-    pub fn mkdir(self, loop_: &Loop, path: &CString, mode: int, cb: FsCallback) {
-        let complete_cb_ptr = {
-            let mut me = self;
-            me.req_boilerplate(Some(cb))
-        };
-        let ret = path.with_ref(|p| unsafe {
-            uvll::uv_fs_mkdir(loop_.native_handle(),
-                              self.native_handle(), p,
-                              mode as c_int, complete_cb_ptr)
-        });
-        assert_eq!(ret, 0);
-    }
-
-    pub fn rmdir(self, loop_: &Loop, path: &CString, cb: FsCallback) {
-        let complete_cb_ptr = {
-            let mut me = self;
-            me.req_boilerplate(Some(cb))
-        };
-        let ret = path.with_ref(|p| unsafe {
-            uvll::uv_fs_rmdir(loop_.native_handle(),
-                              self.native_handle(), p, complete_cb_ptr)
-        });
-        assert_eq!(ret, 0);
->>>>>>> 1850d26... Remove lots of uv/C++ wrappers
     }
 
     pub fn readdir(mut self, loop_: &Loop, path: &CString,
                    flags: c_int, cb: FsCallback) {
-<<<<<<< HEAD
         let complete_cb_ptr = self.req_boilerplate(Some(cb));
         assert_eq!(path.with_ref(|p| unsafe {
-            uvll::fs_readdir(loop_.native_handle(),
-                             self.native_handle(), p, flags, complete_cb_ptr)
+            uvll::uv_fs_readdir(loop_.native_handle(),
+                                self.native_handle(), p, flags, complete_cb_ptr)
         }), 0);
     }
 
@@ -318,17 +278,6 @@ pub fn datasync(mut self, loop_: &Loop, fd: c_int, cb: FsCallback) {
             uvll::uv_fs_fdatasync(loop_.native_handle(), self.native_handle(), fd,
                                   complete_cb_ptr)
         }, 0);
-=======
-        let complete_cb_ptr = {
-            let mut me = self;
-            me.req_boilerplate(Some(cb))
-        };
-        let ret = path.with_ref(|p| unsafe {
-            uvll::uv_fs_readdir(loop_.native_handle(),
-                                self.native_handle(), p, flags, complete_cb_ptr)
-        });
-        assert_eq!(ret, 0);
->>>>>>> 1850d26... Remove lots of uv/C++ wrappers
     }
 
     // accessors/utility funcs
index da3ddacef6bbb44e7b735035b2fd7ced29cfec4a..e3cc6ec90a1b120d83e8426e0f270baa03d0a11e 100644 (file)
@@ -26,7 +26,7 @@ impl IdleWatcher {
     pub fn new(loop_: &mut Loop) -> ~IdleWatcher {
         let handle = UvHandle::alloc(None::<IdleWatcher>, uvll::UV_IDLE);
         assert_eq!(unsafe {
-            uvll::idle_init(loop_.native_handle(), handle)
+            uvll::uv_idle_init(loop_.native_handle(), handle)
         }, 0);
         let me = ~IdleWatcher {
             handle: handle,
@@ -40,10 +40,10 @@ pub fn new(loop_: &mut Loop) -> ~IdleWatcher {
     pub fn onetime(loop_: &mut Loop, f: proc()) {
         let handle = UvHandle::alloc(None::<IdleWatcher>, uvll::UV_IDLE);
         unsafe {
-            assert_eq!(uvll::idle_init(loop_.native_handle(), handle), 0);
+            assert_eq!(uvll::uv_idle_init(loop_.native_handle(), handle), 0);
             let data: *c_void = cast::transmute(~f);
             uvll::set_data_for_uv_handle(handle, data);
-            assert_eq!(uvll::idle_start(handle, onetime_cb), 0)
+            assert_eq!(uvll::uv_idle_start(handle, onetime_cb), 0)
         }
 
         extern fn onetime_cb(handle: *uvll::uv_idle_t, status: c_int) {
@@ -52,8 +52,8 @@ pub fn onetime(loop_: &mut Loop, f: proc()) {
                 let data = uvll::get_data_for_uv_handle(handle);
                 let f: ~proc() = cast::transmute(data);
                 (*f)();
-                uvll::idle_stop(handle);
-                uvll::close(handle, close_cb);
+                uvll::uv_idle_stop(handle);
+                uvll::uv_close(handle, close_cb);
             }
         }
 
@@ -67,18 +67,18 @@ impl PausibleIdleCallback for IdleWatcher {
     fn start(&mut self, cb: ~Callback) {
         assert!(self.callback.is_none());
         self.callback = Some(cb);
-        assert_eq!(unsafe { uvll::idle_start(self.handle, idle_cb) }, 0)
+        assert_eq!(unsafe { uvll::uv_idle_start(self.handle, idle_cb) }, 0)
         self.idle_flag = true;
     }
     fn pause(&mut self) {
         if self.idle_flag == true {
-            assert_eq!(unsafe {uvll::idle_stop(self.handle) }, 0);
+            assert_eq!(unsafe {uvll::uv_idle_stop(self.handle) }, 0);
             self.idle_flag = false;
         }
     }
     fn resume(&mut self) {
         if self.idle_flag == false {
-            assert_eq!(unsafe { uvll::idle_start(self.handle, idle_cb) }, 0)
+            assert_eq!(unsafe { uvll::uv_idle_start(self.handle, idle_cb) }, 0)
             self.idle_flag = true;
         }
     }
index f3d9bb5443bb8a29ed8e41d1d4318e2cc812f6e2..de8bed948c4df9df7c72c36f392a0d879c61ec2a 100644 (file)
@@ -50,7 +50,7 @@
 use std::vec;
 use std::ptr;
 use std::str;
-use std::libc::{c_void, c_int, size_t, malloc, free, c_char, c_uint};
+use std::libc::{c_void, c_int, size_t, malloc, free};
 use std::cast::transmute;
 use std::ptr::null;
 use std::unstable::finally::Finally;
@@ -153,7 +153,7 @@ fn close_async_(&mut self) {
 
         unsafe {
             uvll::set_data_for_uv_handle(self.uv_handle(), null::<()>());
-            uvll::close(self.uv_handle(), close_cb)
+            uvll::uv_close(self.uv_handle() as *uvll::uv_handle_t, close_cb)
         }
     }
 }
index fd35f9e494e873b4db4a2dafe196ba50b16e60bb..d143bc059e43729c23a9436d8b00d601e205c22e 100644 (file)
@@ -201,32 +201,30 @@ fn id(&self) -> libc::pid_t {
     }
 
     fn kill(&mut self, signal: int) -> Result<(), IoError> {
-        do self.home_for_io |self_| {
-            match unsafe {
-                uvll::process_kill(self_.handle, signal as libc::c_int)
-            } {
-                0 => Ok(()),
-                err => Err(uv_error_to_io_error(UvError(err)))
-            }
+        let _m = self.fire_missiles();
+        match unsafe {
+            uvll::uv_process_kill(self.handle, signal as libc::c_int)
+        } {
+            0 => Ok(()),
+            err => Err(uv_error_to_io_error(UvError(err)))
         }
     }
 
     fn wait(&mut self) -> int {
         // Make sure (on the home scheduler) that we have an exit status listed
-        do self.home_for_io |self_| {
-            match self_.exit_status {
-                Some(*) => {}
-                None => {
-                    // If there's no exit code previously listed, then the
-                    // process's exit callback has yet to be invoked. We just
-                    // need to deschedule ourselves and wait to be reawoken.
-                    let scheduler: ~Scheduler = Local::take();
-                    do scheduler.deschedule_running_task_and_then |_, task| {
-                        assert!(self_.to_wake.is_none());
-                        self_.to_wake = Some(task);
-                    }
-                    assert!(self_.exit_status.is_some());
+        let _m = self.fire_missiles();
+        match self.exit_status {
+            Some(*) => {}
+            None => {
+                // If there's no exit code previously listed, then the
+                // process's exit callback has yet to be invoked. We just
+                // need to deschedule ourselves and wait to be reawoken.
+                let scheduler: ~Scheduler = Local::take();
+                do scheduler.deschedule_running_task_and_then |_, task| {
+                    assert!(self.to_wake.is_none());
+                    self.to_wake = Some(task);
                 }
+                assert!(self.exit_status.is_some());
             }
         }
 
@@ -237,9 +235,8 @@ fn wait(&mut self) -> int {
 
 impl Drop for Process {
     fn drop(&mut self) {
-        do self.home_for_io |self_| {
-            assert!(self_.to_wake.is_none());
-            self_.close_async_();
-        }
+        let _m = self.fire_missiles();
+        assert!(self.to_wake.is_none());
+        self.close_async_();
     }
 }
index c195f48022735a3189bc8f225febb1c1367b87c4..d8ecc25db6d1dca0a8d2efa82d265c3dcafc75f5 100644 (file)
@@ -32,10 +32,10 @@ pub fn new(loop_: &mut Loop, signum: Signum,
                channel: SharedChan<Signum>) -> Result<~SignalWatcher, UvError> {
         let handle = UvHandle::alloc(None::<SignalWatcher>, uvll::UV_SIGNAL);
         assert_eq!(unsafe {
-            uvll::signal_init(loop_.native_handle(), handle)
+            uvll::uv_signal_init(loop_.native_handle(), handle)
         }, 0);
 
-        match unsafe { uvll::signal_start(handle, signal_cb, signum as c_int) } {
+        match unsafe { uvll::uv_signal_start(handle, signal_cb, signum as c_int) } {
             0 => {
                 let s = ~SignalWatcher {
                     handle: handle,
@@ -72,8 +72,7 @@ impl RtioSignal for SignalWatcher {}
 
 impl Drop for SignalWatcher {
     fn drop(&mut self) {
-        do self.home_for_io |self_| {
-            self_.close_async_();
-        }
+        let _m = self.fire_missiles();
+        self.close_async_();
     }
 }
index 956699c5c2e89060628eacb815b8e7b1f82ab098..5bf3a82e972bb21fde078c5982a262d58c0938c3 100644 (file)
@@ -36,7 +36,7 @@ impl TimerWatcher {
     pub fn new(loop_: &mut Loop) -> ~TimerWatcher {
         let handle = UvHandle::alloc(None::<TimerWatcher>, uvll::UV_TIMER);
         assert_eq!(unsafe {
-            uvll::timer_init(loop_.native_handle(), handle)
+            uvll::uv_timer_init(loop_.native_handle(), handle)
         }, 0);
         let me = ~TimerWatcher {
             handle: handle,
@@ -48,12 +48,12 @@ pub fn new(loop_: &mut Loop) -> ~TimerWatcher {
 
     fn start(&mut self, msecs: u64, period: u64) {
         assert_eq!(unsafe {
-            uvll::timer_start(self.handle, timer_cb, msecs, period)
+            uvll::uv_timer_start(self.handle, timer_cb, msecs, period)
         }, 0)
     }
 
     fn stop(&mut self) {
-        assert_eq!(unsafe { uvll::timer_stop(self.handle) }, 0)
+        assert_eq!(unsafe { uvll::uv_timer_stop(self.handle) }, 0)
     }
 }
 
@@ -67,23 +67,21 @@ fn uv_handle(&self) -> *uvll::uv_timer_t { self.handle }
 
 impl RtioTimer for TimerWatcher {
     fn sleep(&mut self, msecs: u64) {
-        do self.home_for_io_with_sched |self_, scheduler| {
-            do scheduler.deschedule_running_task_and_then |_sched, task| {
-                self_.action = Some(WakeTask(task));
-                self_.start(msecs, 0);
-            }
-            self_.stop();
+        let (_m, sched) = self.fire_missiles_sched();
+        do sched.deschedule_running_task_and_then |_sched, task| {
+            self.action = Some(WakeTask(task));
+            self.start(msecs, 0);
         }
+        self.stop();
     }
 
     fn oneshot(&mut self, msecs: u64) -> PortOne<()> {
         let (port, chan) = oneshot();
         let chan = Cell::new(chan);
 
-        do self.home_for_io |self_| {
-            self_.action = Some(SendOnce(chan.take()));
-            self_.start(msecs, 0);
-        }
+        let _m = self.fire_missiles();
+        self.action = Some(SendOnce(chan.take()));
+        self.start(msecs, 0);
 
         return port;
     }
@@ -92,10 +90,9 @@ fn period(&mut self, msecs: u64) -> Port<()> {
         let (port, chan) = stream();
         let chan = Cell::new(chan);
 
-        do self.home_for_io |self_| {
-            self_.action = Some(SendMany(chan.take()));
-            self_.start(msecs, msecs);
-        }
+        let _m = self.fire_missiles();
+        self.action = Some(SendMany(chan.take()));
+        self.start(msecs, msecs);
 
         return port;
     }
@@ -119,11 +116,10 @@ fn period(&mut self, msecs: u64) -> Port<()> {
 
 impl Drop for TimerWatcher {
     fn drop(&mut self) {
-        do self.home_for_io |self_| {
-            self_.action = None;
-            self_.stop();
-            self_.close_async_();
-        }
+        let _m = self.fire_missiles();
+        self.action = None;
+        self.stop();
+        self.close_async_();
     }
 }
 
index f584fa6a1485ff042757d5ceac4788e377071092..e0ceb954e58cbfa40642d0d3dcb68632b4603ecd 100644 (file)
@@ -14,6 +14,7 @@
 use std::cell::Cell;
 use std::clone::Clone;
 use std::comm::{SharedChan, GenericChan};
+use std::libc;
 use std::libc::{c_int, c_uint, c_void};
 use std::ptr;
 use std::str;
@@ -30,9 +31,9 @@
 use std::rt::task::Task;
 use std::path::{GenericPath, Path};
 use std::libc::{lseek, off_t, O_CREAT, O_APPEND, O_TRUNC, O_RDWR, O_RDONLY,
-                O_WRONLY, S_IRUSR, S_IWUSR, S_IRWXU};
-use std::rt::io::{FileMode, FileAccess, OpenOrCreate, Open, Create,
-                  CreateOrTruncate, Append, Truncate, Read, Write, ReadWrite,
+                O_WRONLY, S_IRUSR, S_IWUSR};
+use std::rt::io::{FileMode, FileAccess, Open,
+                  Append, Truncate, Read, Write, ReadWrite,
                   FileStat};
 use std::rt::io::signal::Signum;
 use std::task;
@@ -1224,7 +1225,7 @@ fn nop_req(&mut self, f: &fn(&mut UvFileStream, file::FsRequest, FsCallback))
         do sched.deschedule_running_task_and_then |_, task| {
             let task = Cell::new(task);
             let req = file::FsRequest::new();
-            do f(self_, req) |_, uverr| {
+            do f(self, req) |_, uverr| {
                 let res = match uverr  {
                     None => Ok(()),
                     Some(err) => Err(uv_error_to_io_error(err))
index 3028546972fe625a7f84c56fd84d9ea07501cad1..a32f03732d664ed91285e12ca072c4e52c5ecec3 100644 (file)
@@ -724,6 +724,7 @@ fn rust_uv_udp_send6(req: *uv_udp_send_t, handle: *uv_udp_t, buf_in: *uv_buf_t,
     fn rust_set_stdio_container_fd(c: *uv_stdio_container_t, fd: c_int);
     fn rust_set_stdio_container_stream(c: *uv_stdio_container_t,
                                        stream: *uv_stream_t);
+    fn rust_uv_process_pid(p: *uv_process_t) -> c_int;
 }
 
 // generic uv functions
@@ -809,21 +810,25 @@ fn rust_set_stdio_container_stream(c: *uv_stdio_container_t,
                            flags: c_int, cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_req_cleanup(req: *uv_fs_t))
 externfn!(fn uv_fs_fsync(handle: *uv_loop_t, req: *uv_fs_t, file: c_int,
-                         cb: *u8) -> c_int)
+                         cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_fdatasync(handle: *uv_loop_t, req: *uv_fs_t, file: c_int,
-                             cb: *u8) -> c_int)
+                             cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_ftruncate(handle: *uv_loop_t, req: *uv_fs_t, file: c_int,
-                             offset: i64, cb: *u8) -> c_int)
+                             offset: i64, cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_readlink(handle: *uv_loop_t, req: *uv_fs_t, file: *c_char,
-                            cb: *u8) -> c_int)
+                            cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_symlink(handle: *uv_loop_t, req: *uv_fs_t, src: *c_char,
-                           dst: *c_char, flags: c_int, cb: *u8) -> c_int)
+                           dst: *c_char, flags: c_int, cb: uv_fs_cb) -> c_int)
+externfn!(fn uv_fs_rename(handle: *uv_loop_t, req: *uv_fs_t, src: *c_char,
+                          dst: *c_char, cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_link(handle: *uv_loop_t, req: *uv_fs_t, src: *c_char,
-                        dst: *c_char, cb: *u8) -> c_int)
+                        dst: *c_char, cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_chown(handle: *uv_loop_t, req: *uv_fs_t, src: *c_char,
-                         uid: uv_uid_t, gid: uv_gid_t, cb: *u8) -> c_int)
+                         uid: uv_uid_t, gid: uv_gid_t, cb: uv_fs_cb) -> c_int)
+externfn!(fn uv_fs_chmod(handle: *uv_loop_t, req: *uv_fs_t, path: *c_char,
+                         mode: c_int, cb: uv_fs_cb) -> c_int)
 externfn!(fn uv_fs_lstat(handle: *uv_loop_t, req: *uv_fs_t, file: *c_char,
-                         cb: *u8) -> c_int)
+                         cb: uv_fs_cb) -> c_int)
 
 // getaddrinfo
 externfn!(fn uv_getaddrinfo(loop_: *uv_loop_t, req: *uv_getaddrinfo_t,