@@ -107,20 +107,32 @@ pub struct uv_buf_t {
107107 pub len : uv_buf_len_t ,
108108}
109109
110+ #[ cfg( unix) ]
111+ pub type uv_os_socket_t = c_int ;
112+
110113// see libuv/include/uv-win.h
111114#[ cfg( windows) ]
112115pub struct uv_buf_t {
113116 pub len : uv_buf_len_t ,
114117 pub base : * mut u8 ,
115118}
116119
120+ #[ cfg( windows) ]
121+ pub type uv_os_socket_t = libc:: SOCKET ;
122+
117123#[ repr( C ) ]
118124pub enum uv_run_mode {
119125 RUN_DEFAULT = 0 ,
120126 RUN_ONCE ,
121127 RUN_NOWAIT ,
122128}
123129
130+ #[ repr( C ) ]
131+ pub enum uv_poll_event {
132+ UV_READABLE = 1 ,
133+ UV_WRITABLE = 2 ,
134+ }
135+
124136pub struct uv_process_options_t {
125137 pub exit_cb : uv_exit_cb ,
126138 pub file : * const libc:: c_char ,
@@ -148,6 +160,7 @@ pub type uv_loop_t = c_void;
148160pub type uv_idle_t = c_void ;
149161pub type uv_tcp_t = c_void ;
150162pub type uv_udp_t = c_void ;
163+ pub type uv_poll_t = c_void ;
151164pub type uv_connect_t = c_void ;
152165pub type uv_connection_t = c_void ;
153166pub type uv_write_t = c_void ;
@@ -231,6 +244,9 @@ pub type uv_udp_recv_cb = extern "C" fn(handle: *mut uv_udp_t,
231244 addr : * const sockaddr ,
232245 flags : c_uint ) ;
233246pub type uv_close_cb = extern "C" fn ( handle : * mut uv_handle_t ) ;
247+ pub type uv_poll_cb = extern "C" fn ( handle : * mut uv_poll_t ,
248+ status : c_int ,
249+ events : c_int ) ;
234250pub type uv_walk_cb = extern "C" fn ( handle : * mut uv_handle_t ,
235251 arg : * mut c_void ) ;
236252pub type uv_async_cb = extern "C" fn ( handle : * mut uv_async_t ) ;
@@ -649,6 +665,11 @@ extern {
649665 pub fn uv_fs_lstat ( handle : * mut uv_loop_t , req : * mut uv_fs_t ,
650666 file : * const c_char , cb : uv_fs_cb ) -> c_int ;
651667
668+ // poll bindings
669+ pub fn uv_poll_init_socket ( l : * mut uv_loop_t , h : * mut uv_poll_t , s : uv_os_socket_t ) -> c_int ;
670+ pub fn uv_poll_start ( h : * mut uv_poll_t , events : c_int , cb : uv_poll_cb ) -> c_int ;
671+ pub fn uv_poll_stop ( h : * mut uv_poll_t ) -> c_int ;
672+
652673 // getaddrinfo
653674 pub fn uv_getaddrinfo ( loop_ : * mut uv_loop_t , req : * mut uv_getaddrinfo_t ,
654675 getaddrinfo_cb : uv_getaddrinfo_cb ,
0 commit comments