uvrb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  [submodule "ext/libuv"]
2
2
  path = ext/libuv
3
- url = git://github.com/avalanche123/libuv.git
3
+ url = https://github.com/joyent/libuv.git
@@ -1,7 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
- - 1.9.3
3
+ - "1.9.3"
4
+ - "2.0.0"
5
+ - rbx-19mode
6
+ # - jruby-19mode # jruby loads too slowly to run the cucumber tests properly.
7
+ # - jruby-20mode # so I am ignoring jruby builds on travis
5
8
  branches:
6
9
  only:
7
10
  - master
@@ -10,4 +13,4 @@ before_install:
10
13
  - git submodule update --init --recursive
11
14
  - echo "yes" | gem uninstall ffi -a
12
15
  before_script:
13
- - rake libuv
16
+ - rake compile
@@ -36,16 +36,10 @@ or
36
36
  cd ...
37
37
  bundle install
38
38
 
39
- Make sure you have libuv compiled and a shared library (`.dylib`|`.so`|`.dll`) file available in your lib path.
39
+ === Prerequisites
40
40
 
41
- To compile libuv from a local submodule version:
42
-
43
- git submodule update --init
44
- rake libuv
45
-
46
- Or to compile libuv on mac, you can install provided Homebrew formula by running:
47
-
48
- brew install Formula/libuv.rb --HEAD
41
+ * The installation requires subversion to be installed on your system and available on the PATH
42
+ * Windows users will require a copy of Visual Studio 2010 or later installed. {Express}[http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products] works fine.
49
43
 
50
44
  == What's supported
51
45
 
@@ -62,9 +56,10 @@ Or to compile libuv on mac, you can install provided Homebrew formula by running
62
56
  * File
63
57
  * FSEvent
64
58
  * Errors
59
+ * work queue
65
60
 
66
61
  == TODO
67
62
 
68
- * Port rest of libuv - ares, getaddrinfo, process, work queue, mutexes and locks
63
+ * Port rest of libuv - ares, getaddrinfo, process, mutexes and locks
69
64
  * Tests tests tests
70
65
  * Docs docs docs
data/Rakefile CHANGED
@@ -9,8 +9,9 @@ require 'ffi'
9
9
  require 'rake/clean'
10
10
  require 'uv/tasks'
11
11
 
12
- RSpec::Core::RakeTask.new
12
+ task :default => :test
13
13
 
14
+ RSpec::Core::RakeTask.new(:spec)
14
15
  Cucumber::Rake::Task.new(:features)
15
16
 
16
17
  RDoc::Task.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force") do |rd|
@@ -21,9 +22,8 @@ RDoc::Task.new(:rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:
21
22
  end
22
23
 
23
24
  task :test => [:spec, :features]
24
- task :default => :test
25
25
 
26
26
  desc "Compile libuv from submodule"
27
- task :libuv => ["ext/libuv.#{FFI::Platform::LIBSUFFIX}"]
27
+ task :compile => ["ext/libuv.#{FFI::Platform::LIBSUFFIX}"]
28
28
 
29
- CLOBBER.include("ext/libuv.#{FFI::Platform::LIBSUFFIX}")
29
+ CLOBBER.include("ext/libuv.#{FFI::Platform::LIBSUFFIX}")
@@ -26,8 +26,8 @@ Feature: wake up another event loop
26
26
  end
27
27
  end
28
28
 
29
- Thread.new(callback) do |proc|
30
- proc.call
29
+ loop.work do
30
+ callback.call
31
31
  end
32
32
 
33
33
  loop.run
@@ -29,7 +29,7 @@ Feature: triggering callbacks while nothing else is happening
29
29
  end
30
30
 
31
31
  stopper = loop.timer
32
- stopper.start(10, 0) do |e|
32
+ stopper.start(100, 0) do |e|
33
33
  raise e if e
34
34
  idle.close {}
35
35
  timer.close {}
@@ -32,7 +32,7 @@ Feature: Named pipes
32
32
 
33
33
  stopper = loop.timer
34
34
 
35
- stopper.start(2800, 0) do |e|
35
+ stopper.start(5000, 0) do |e|
36
36
  raise e if e
37
37
 
38
38
  server.close {}
@@ -77,6 +77,7 @@ Feature: Named pipes
77
77
  end
78
78
  """
79
79
  When I run `ruby ipc_server_example.rb` interactively
80
+ And I wait for 1 seconds
80
81
  And I run `ruby ipc_client_example.rb`
81
82
  Then the output should contain ping pong exchange
82
83
 
@@ -85,7 +86,6 @@ Feature: Named pipes
85
86
  And a file named "pipe_producer_example.rb" with:
86
87
  """
87
88
  require 'uvrb'
88
-
89
89
  loop = UV::Loop.default
90
90
 
91
91
  pipe = File.open("/tmp/exchange-pipe.pipe", File::RDWR|File::NONBLOCK)
@@ -103,7 +103,7 @@ Feature: Named pipes
103
103
 
104
104
  stopper = loop.timer
105
105
 
106
- stopper.start(2800, 0) do |e|
106
+ stopper.start(3000, 0) do |e|
107
107
  raise e if e
108
108
 
109
109
  heartbeat.close {}
@@ -118,7 +118,6 @@ Feature: Named pipes
118
118
  And a file named "pipe_consumer_example.rb" with:
119
119
  """
120
120
  require 'uvrb'
121
-
122
121
  loop = UV::Loop.default
123
122
 
124
123
  pipe = File.open("/tmp/exchange-pipe.pipe", File::RDWR|File::NONBLOCK)
@@ -10,11 +10,13 @@ Then /^the output should contain consumed workload$/ do
10
10
  end
11
11
 
12
12
  Given /^a named pipe "(.*?)"$/ do |path|
13
- if RUBY_PLATFORM.downcase.include?("mswin")
14
- f = File.open(path, 'w+')
15
- f.close
16
- else
13
+ require 'ffi'
14
+ if not FFI::Platform.windows?
17
15
  system "/usr/bin/mkfifo", path
16
+ at_exit { File.unlink(path) }
18
17
  end
19
- at_exit { File.unlink(path) }
20
- end
18
+ end
19
+
20
+ Given /^I wait for (\d+) seconds?$/ do |n|
21
+ sleep(n.to_i)
22
+ end
data/lib/uv.rb CHANGED
@@ -1,9 +1,23 @@
1
+ require 'forwardable'
1
2
  require 'ffi'
2
3
 
3
4
  module UV
5
+ extend Forwardable
4
6
  extend FFI::Library
5
7
  FFI::DEBUG = 10
6
- ffi_lib(FFI::Library::LIBC).first
8
+
9
+ # In windows the attach functions have to be done before loading the next library
10
+ module LIBC
11
+ extend FFI::Library
12
+ ffi_lib(FFI::Library::LIBC).first
13
+
14
+ attach_function :malloc, [:size_t], :pointer, :blocking => true
15
+ attach_function :free, [:pointer], :void, :blocking => true
16
+ end
17
+
18
+ def_delegators :LIBC, :malloc, :free
19
+ module_function :malloc, :free
20
+
7
21
  begin
8
22
  # bias the library discovery to a path inside the gem first, then
9
23
  # to the usual system paths
@@ -24,205 +38,217 @@ module UV
24
38
 
25
39
  require 'uv/types'
26
40
 
27
- attach_function :loop_new, :uv_loop_new, [], :uv_loop_t
28
- attach_function :loop_delete, :uv_loop_delete, [:uv_loop_t], :void
29
- attach_function :default_loop, :uv_default_loop, [], :uv_loop_t
30
- @blocking = true
31
- attach_function :run, :uv_run, [:uv_loop_t], :int
32
- attach_function :run_once, :uv_run_once, [:uv_loop_t], :int
33
- attach_function :update_time, :uv_update_time, [:uv_loop_t], :void
34
- attach_function :now, :uv_now, [:uv_loop_t], :int64
35
-
36
- attach_function :last_error, :uv_last_error, [:uv_loop_t], :uv_err_t
37
- attach_function :strerror, :uv_strerror, [:uv_err_t], :string
38
- attach_function :err_name, :uv_err_name, [:uv_err_t], :string
39
-
40
- attach_function :ref, :uv_ref, [:uv_handle_t], :void
41
- attach_function :unref, :uv_unref, [:uv_handle_t], :void
42
- attach_function :is_active, :uv_is_active, [:uv_handle_t], :int
43
- attach_function :close, :uv_close, [:uv_handle_t, :uv_close_cb], :void
44
- attach_function :is_closing, :uv_is_closing, [:uv_handle_t], :int
45
-
46
- attach_function :buf_init, :uv_buf_init, [:pointer, :size_t], :uv_buf_t
47
- attach_function :strlcpy, :uv_strlcpy, [:string, :string, :size_t], :size_t
48
- attach_function :strlcat, :uv_strlcat, [:string, :string, :size_t], :size_t
49
-
50
- attach_function :listen, :uv_listen, [:uv_stream_t, :int, :uv_connection_cb], :int
51
- attach_function :accept, :uv_accept, [:uv_stream_t, :uv_stream_t], :int
52
- attach_function :read_start, :uv_read_start, [:uv_stream_t, :uv_alloc_cb, :uv_read_cb], :int
53
- attach_function :read_stop, :uv_read_stop, [:uv_stream_t], :int
54
- attach_function :read2_start, :uv_read2_start, [:uv_stream_t, :uv_alloc_cb, :uv_read2_cb], :int
55
- attach_function :write, :uv_write, [:uv_write_t, :uv_stream_t, :pointer, :int, :uv_write_cb], :int
56
- attach_function :write2, :uv_write2, [:uv_write_t, :uv_stream_t, :pointer, :int, :uv_stream_t, :uv_write_cb], :int
57
- attach_function :is_readable, :uv_is_readable, [:uv_stream_t], :int
58
- attach_function :is_writable, :uv_is_writable, [:uv_stream_t], :int
59
- attach_function :shutdown, :uv_shutdown, [:uv_shutdown_t, :uv_stream_t, :uv_shutdown_cb], :int
60
-
61
- attach_function :tcp_init, :uv_tcp_init, [:uv_loop_t, :uv_tcp_t], :int
62
- attach_function :tcp_nodelay, :uv_tcp_nodelay, [:uv_tcp_t, :int], :int
63
- attach_function :tcp_keepalive, :uv_tcp_keepalive, [:uv_tcp_t, :int, :uint], :int
64
- attach_function :tcp_simultaneous_accepts, :uv_tcp_simultaneous_accepts, [:uv_tcp_t, :int], :int
65
- attach_function :tcp_bind, :uv_tcp_bind, [:uv_tcp_t, :sockaddr_in], :int
66
- attach_function :tcp_bind6, :uv_tcp_bind6, [:uv_tcp_t, :sockaddr_in6], :int
67
- attach_function :tcp_getsockname, :uv_tcp_getsockname, [:uv_tcp_t, :pointer, :pointer], :int
68
- attach_function :tcp_getpeername, :uv_tcp_getpeername, [:uv_tcp_t, :pointer, :pointer], :int
69
- attach_function :tcp_connect, :uv_tcp_connect, [:uv_connect_t, :uv_tcp_t, :sockaddr_in, :uv_connect_cb], :int
70
- attach_function :tcp_connect6, :uv_tcp_connect6, [:uv_connect_t, :uv_tcp_t, :sockaddr_in6, :uv_connect_cb], :int
71
-
72
- attach_function :udp_init, :uv_udp_init, [:uv_loop_t, :uv_udp_t], :int
73
- attach_function :udp_bind, :uv_udp_bind, [:uv_udp_t, :sockaddr_in, :uint], :int
74
- attach_function :udp_bind6, :uv_udp_bind6, [:uv_udp_t, :sockaddr_in6, :uint], :int
75
- attach_function :udp_getsockname, :uv_udp_getsockname, [:uv_udp_t, :pointer, :pointer], :int
76
- attach_function :udp_set_membership, :uv_udp_set_membership, [:uv_udp_t, :string, :string, :uv_membership], :int
77
- attach_function :udp_set_multicast_loop, :uv_udp_set_multicast_loop, [:uv_udp_t, :int], :int
78
- attach_function :udp_set_multicast_ttl, :uv_udp_set_multicast_ttl, [:uv_udp_t, :int], :int
79
- attach_function :udp_set_broadcast, :uv_udp_set_broadcast, [:uv_udp_t, :int], :int
80
- attach_function :udp_set_ttl, :uv_udp_set_ttl, [:uv_udp_t, :int], :int
81
- attach_function :udp_send, :uv_udp_send, [:uv_udp_send_t, :uv_udp_t, :pointer, :int, :sockaddr_in, :uv_udp_send_cb], :int
82
- attach_function :udp_send6, :uv_udp_send6, [:uv_udp_send_t, :uv_udp_t, :pointer, :int, :sockaddr_in6, :uv_udp_send_cb], :int
83
- attach_function :udp_recv_start, :uv_udp_recv_start, [:uv_udp_t, :uv_alloc_cb, :uv_udp_recv_cb], :int
84
- attach_function :udp_recv_stop, :uv_udp_recv_stop, [:uv_udp_t], :int
85
-
86
- attach_function :tty_init, :uv_tty_init, [:uv_loop_t, :uv_tty_t, :uv_file, :int], :int
87
- attach_function :tty_set_mode, :uv_tty_set_mode, [:uv_tty_t, :int], :int
88
- attach_function :tty_reset_mode, :uv_tty_reset_mode, [], :void
89
- attach_function :tty_get_winsize, :uv_tty_get_winsize, [:uv_tty_t, :pointer, :pointer], :int
90
-
91
- attach_function :guess_handle, :uv_guess_handle, [:uv_file], :uv_handle_type
92
-
93
- attach_function :pipe_init, :uv_pipe_init, [:uv_loop_t, :uv_pipe_t, :int], :int
94
- attach_function :pipe_open, :uv_pipe_open, [:uv_pipe_t, :uv_file], :void
95
- attach_function :pipe_bind, :uv_pipe_bind, [:uv_pipe_t, :string], :int
96
- attach_function :pipe_connect, :uv_pipe_connect, [:uv_connect_t, :uv_pipe_t, :string, :uv_connect_cb], :void
97
- attach_function :pipe_pending_instances, :uv_pipe_pending_instances, [:uv_pipe_t, :int], :void
98
-
99
- attach_function :prepare_init, :uv_prepare_init, [:uv_loop_t, :uv_prepare_t], :int
100
- attach_function :prepare_start, :uv_prepare_start, [:uv_prepare_t, :uv_prepare_cb], :int
101
- attach_function :prepare_stop, :uv_prepare_stop, [:uv_prepare_t], :int
102
-
103
- attach_function :check_init, :uv_check_init, [:uv_loop_t, :uv_check_t], :int
104
- attach_function :check_start, :uv_check_start, [:uv_check_t, :uv_check_cb], :int
105
- attach_function :check_stop, :uv_check_stop, [:uv_check_t], :int
106
-
107
- attach_function :idle_init, :uv_idle_init, [:uv_loop_t, :uv_idle_t], :int
108
- attach_function :idle_start, :uv_idle_start, [:uv_idle_t, :uv_idle_cb], :int
109
- attach_function :idle_stop, :uv_idle_stop, [:uv_idle_t], :int
110
-
111
- attach_function :async_init, :uv_async_init, [:uv_loop_t, :uv_async_t, :uv_async_cb], :int
112
- attach_function :async_send, :uv_async_send, [:uv_async_t], :int
113
-
114
- attach_function :timer_init, :uv_timer_init, [:uv_loop_t, :uv_timer_t], :int
115
- attach_function :timer_start, :uv_timer_start, [:uv_timer_t, :uv_timer_cb, :int64_t, :int64_t], :int
116
- attach_function :timer_stop, :uv_timer_stop, [:uv_timer_t], :int
117
- attach_function :timer_again, :uv_timer_again, [:uv_timer_t], :int
118
- attach_function :timer_set_repeat, :uv_timer_set_repeat, [:uv_timer_t, :int64_t], :void
119
- attach_function :timer_get_repeat, :uv_timer_get_repeat, [:uv_timer_t], :int64_t
120
-
121
- attach_function :ares_init_options, :uv_ares_init_options, [:uv_loop_t, :ares_channel, :ares_options, :int], :int
122
- attach_function :ares_destroy, :uv_ares_destroy, [:uv_loop_t, :ares_channel], :void
123
-
124
- attach_function :getaddrinfo, :uv_getaddrinfo, [:uv_loop_t, :uv_getaddrinfo_t, :uv_getaddrinfo_cb, :string, :string, :addrinfo], :int
125
- attach_function :freeaddrinfo, :uv_freeaddrinfo, [:addrinfo], :void
126
-
127
- attach_function :spawn, :uv_spawn, [:uv_loop_t, :uv_process_t, :uv_options_t], :int
128
- attach_function :process_kill, :uv_process_kill, [:uv_process_t, :int], :int
129
- attach_function :kill, :uv_kill, [:int, :int], :uv_err_t
130
- attach_function :queue_work, :uv_queue_work, [:uv_loop_t, :uv_work_t, :uv_work_cb, :uv_after_work_cb], :int
131
- attach_function :setup_args, :uv_setup_args, [:int, :varargs], :varargs
132
- attach_function :get_process_title, :uv_get_process_title, [:pointer, :size_t], :uv_err_t
133
- attach_function :set_process_title, :uv_set_process_title, [:string], :uv_err_t
134
- attach_function :resident_set_memory, :uv_resident_set_memory, [:size_t], :uv_err_t
135
-
136
- attach_function :uptime, :uv_uptime, [:pointer], :uv_err_t
137
- attach_function :cpu_info, :uv_cpu_info, [:uv_cpu_info_t, :pointer], :uv_err_t
138
- attach_function :loadavg, :uv_loadavg, [:pointer], :void
139
- attach_function :free_cpu_info, :uv_free_cpu_info, [:uv_cpu_info_t, :int], :void
140
- attach_function :interface_addresses, :uv_interface_addresses, [:uv_interface_address_t, :pointer], :uv_err_t
141
- attach_function :free_interface_addresses, :uv_free_interface_addresses, [:uv_interface_address_t, :int], :void
142
-
143
- attach_function :fs_req_result, :uv_fs_req_result, [:uv_fs_t], :ssize_t
144
- attach_function :fs_req_stat, :uv_fs_req_stat, [:uv_fs_t], :uv_fs_stat_t
145
- attach_function :fs_req_pointer, :uv_fs_req_pointer, [:uv_fs_t], :pointer
146
-
147
- attach_function :fs_req_cleanup, :uv_fs_req_cleanup, [:uv_fs_t], :void
148
- attach_function :fs_close, :uv_fs_close, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int
149
- attach_function :fs_open, :uv_fs_open, [:uv_loop_t, :uv_fs_t, :string, :int, :int, :uv_fs_cb], :int
150
- attach_function :fs_read, :uv_fs_read, [:uv_loop_t, :uv_fs_t, :uv_file, :string, :size_t, :off_t, :uv_fs_cb], :int
151
- attach_function :fs_unlink, :uv_fs_unlink, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int
152
- attach_function :fs_write, :uv_fs_write, [:uv_loop_t, :uv_fs_t, :uv_file, :string, :size_t, :off_t, :uv_fs_cb], :int
153
- attach_function :fs_mkdir, :uv_fs_mkdir, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int
154
- attach_function :fs_rmdir, :uv_fs_rmdir, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int
155
- attach_function :fs_readdir, :uv_fs_readdir, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int
156
- attach_function :fs_stat, :uv_fs_stat, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int
157
- attach_function :fs_fstat, :uv_fs_fstat, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int
158
- attach_function :fs_rename, :uv_fs_rename, [:uv_loop_t, :uv_fs_t, :string, :string, :uv_fs_cb], :int
159
- attach_function :fs_fsync, :uv_fs_fsync, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int
160
- attach_function :fs_fdatasync, :uv_fs_fdatasync, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int
161
- attach_function :fs_ftruncate, :uv_fs_ftruncate, [:uv_loop_t, :uv_fs_t, :uv_file, :off_t, :uv_fs_cb], :int
162
- attach_function :fs_sendfile, :uv_fs_sendfile, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_file, :off_t, :size_t, :uv_fs_cb], :int
163
- attach_function :fs_chmod, :uv_fs_chmod, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int
164
- attach_function :fs_utime, :uv_fs_utime, [:uv_loop_t, :uv_fs_t, :string, :double, :double, :uv_fs_cb], :int
165
- attach_function :fs_futime, :uv_fs_futime, [:uv_loop_t, :uv_fs_t, :uv_file, :double, :double, :uv_fs_cb], :int
166
- attach_function :fs_lstat, :uv_fs_lstat, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int
167
- attach_function :fs_link, :uv_fs_link, [:uv_loop_t, :uv_fs_t, :string, :string, :uv_fs_cb], :int
168
- attach_function :fs_symlink, :uv_fs_symlink, [:uv_loop_t, :uv_fs_t, :string, :string, :int, :uv_fs_cb], :int
169
- attach_function :fs_readlink, :uv_fs_readlink, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int
170
- attach_function :fs_fchmod, :uv_fs_fchmod, [:uv_loop_t, :uv_fs_t, :uv_file, :int, :uv_fs_cb], :int
171
- attach_function :fs_chown, :uv_fs_chown, [:uv_loop_t, :uv_fs_t, :string, :int, :int, :uv_fs_cb], :int
172
- attach_function :fs_fchown, :uv_fs_fchown, [:uv_loop_t, :uv_fs_t, :uv_file, :int, :int, :uv_fs_cb], :int
173
-
174
- attach_function :fs_event_init, :uv_fs_event_init, [:uv_loop_t, :uv_fs_event_t, :string, :uv_fs_event_cb, :int], :int
175
-
176
- attach_function :ip4_addr, :uv_ip4_addr, [:string, :int], :sockaddr_in
177
- attach_function :ip6_addr, :uv_ip6_addr, [:string, :int], :sockaddr_in6
178
- attach_function :ip4_name, :uv_ip4_name, [SockaddrIn.by_ref, :pointer, :size_t], :int
179
- attach_function :ip6_name, :uv_ip6_name, [SockaddrIn6.by_ref, :pointer, :size_t], :int
180
-
181
- attach_function :exepath, :uv_exepath, [:pointer, :size_t], :int
182
- attach_function :cwd, :uv_cwd, [:pointer, :size_t], :uv_err_t
183
- attach_function :chdir, :uv_chdir, [:string], :uv_err_t
184
- attach_function :get_free_memory, :uv_get_free_memory, [], :uint64
185
- attach_function :get_total_memory, :uv_get_total_memory, [], :uint64
186
- attach_function :hrtime, :uv_hrtime, [], :uint64
187
- attach_function :dlopen, :uv_dlopen, [:string, :uv_lib_t], :uv_err_t
188
- attach_function :dlclose, :uv_dlclose, [:uv_lib_t], :uv_err_t
189
- # attach_function :dlsym, :uv_dlsym, [:uv_lib_t], :ev_err_t
190
- # attach_function :dlerror, :uv_dlerror, [:uv_lib_t], :string
191
- # attach_function :dlerror_free, :uv_dlerror_free, [:uv_lib_t, :string], :void
192
-
193
- attach_function :mutex_init, :uv_mutex_init, [:uv_mutex_t], :int
194
- attach_function :mutex_destroy, :uv_mutex_destroy, [:uv_mutex_t], :void
195
- attach_function :mutex_lock, :uv_mutex_lock, [:uv_mutex_t], :void
196
- attach_function :mutex_trylock, :uv_mutex_trylock, [:uv_mutex_t], :int
197
- attach_function :mutex_unlock, :uv_mutex_unlock, [:uv_mutex_t], :void
198
-
199
- attach_function :rwlock_init, :uv_rwlock_init, [:uv_rwlock_t], :int
200
- attach_function :rwlock_destroy, :uv_rwlock_destroy, [:uv_rwlock_t], :void
201
- attach_function :rwlock_rdlock, :uv_rwlock_rdlock, [:uv_rwlock_t], :void
202
- attach_function :rwlock_tryrdlock, :uv_rwlock_tryrdlock, [:uv_rwlock_t], :int
203
- attach_function :rwlock_rdunlock, :uv_rwlock_rdunlock, [:uv_rwlock_t], :void
204
- attach_function :rwlock_wrlock, :uv_rwlock_wrlock, [:uv_rwlock_t], :void
205
- attach_function :rwlock_trywrlock, :uv_rwlock_trywrlock, [:uv_rwlock_t], :int
206
- attach_function :rwlock_wrunlock, :uv_rwlock_wrunlock, [:uv_rwlock_t], :void
207
-
208
- attach_function :once, :uv_once, [:uv_once_t, :uv_cb], :void
209
- attach_function :thread_create, :uv_thread_create, [:uv_thread_t, :uv_cb], :int
210
- attach_function :thread_join, :uv_thread_join, [:uv_thread_t], :int
211
-
212
- # memory management
213
- attach_function :malloc, [:size_t], :pointer
214
- attach_function :free, [:pointer], :void
215
- attach_function :ntohs, [:ushort], :ushort
216
-
217
- attach_function :handle_size, :uv_handle_size, [:uv_handle_type], :size_t
218
- attach_function :req_size, :uv_req_size, [:uv_req_type], :size_t
41
+ attach_function :version_number, :uv_version, [], :uint, :blocking => true
42
+ attach_function :version_string, :uv_version_string, [], :string, :blocking => true
43
+
44
+ attach_function :loop_new, :uv_loop_new, [], :uv_loop_t, :blocking => true
45
+ attach_function :loop_delete, :uv_loop_delete, [:uv_loop_t], :void, :blocking => true
46
+ attach_function :default_loop, :uv_default_loop, [], :uv_loop_t, :blocking => true
47
+ attach_function :run, :uv_run, [:uv_loop_t, :uv_run_mode], :int, :blocking => true
48
+ attach_function :stop, :uv_stop, [:uv_loop_t], :void, :blocking => true
49
+ #attach_function :run_once, :uv_run_once, [:uv_loop_t], :int
50
+ attach_function :update_time, :uv_update_time, [:uv_loop_t], :void, :blocking => true
51
+ attach_function :now, :uv_now, [:uv_loop_t], :int64, :blocking => true
52
+
53
+ attach_function :backend_timeout, :uv_backend_timeout, [:uv_loop_t], :int, :blocking => true
54
+ attach_function :backend_fd, :uv_backend_fd, [:uv_loop_t], :int, :blocking => true
55
+
56
+ #attach_function :last_error, :uv_last_error, [:uv_loop_t], :int
57
+ attach_function :strerror, :uv_strerror, [:int], :string, :blocking => true
58
+ attach_function :err_name, :uv_err_name, [:int], :string, :blocking => true
59
+
60
+ attach_function :ref, :uv_ref, [:uv_handle_t], :void, :blocking => true
61
+ attach_function :unref, :uv_unref, [:uv_handle_t], :void, :blocking => true
62
+ attach_function :has_ref, :uv_has_ref, [:uv_handle_t], :int, :blocking => true
63
+ attach_function :is_active, :uv_is_active, [:uv_handle_t], :int, :blocking => true
64
+ attach_function :walk, :uv_walk, [:uv_loop_t, :uv_walk_cb, :pointer], :void, :blocking => true
65
+ attach_function :close, :uv_close, [:uv_handle_t, :uv_close_cb], :void, :blocking => true
66
+ attach_function :is_closing, :uv_is_closing, [:uv_handle_t], :int, :blocking => true
67
+
68
+ attach_function :buf_init, :uv_buf_init, [:pointer, :size_t], :uv_buf_t, :blocking => true
69
+ attach_function :strlcpy, :uv_strlcpy, [:string, :string, :size_t], :size_t, :blocking => true
70
+ attach_function :strlcat, :uv_strlcat, [:string, :string, :size_t], :size_t, :blocking => true
71
+
72
+ attach_function :listen, :uv_listen, [:uv_stream_t, :int, :uv_connection_cb], :int, :blocking => true
73
+ attach_function :accept, :uv_accept, [:uv_stream_t, :uv_stream_t], :int, :blocking => true
74
+ attach_function :read_start, :uv_read_start, [:uv_stream_t, :uv_alloc_cb, :uv_read_cb], :int, :blocking => true
75
+ attach_function :read_stop, :uv_read_stop, [:uv_stream_t], :int, :blocking => true
76
+ attach_function :read2_start, :uv_read2_start, [:uv_stream_t, :uv_alloc_cb, :uv_read2_cb], :int, :blocking => true
77
+ attach_function :write, :uv_write, [:uv_write_t, :uv_stream_t, :pointer, :int, :uv_write_cb], :int, :blocking => true
78
+ attach_function :write2, :uv_write2, [:uv_write_t, :uv_stream_t, :pointer, :int, :uv_stream_t, :uv_write_cb], :int, :blocking => true
79
+ attach_function :is_readable, :uv_is_readable, [:uv_stream_t], :int, :blocking => true
80
+ attach_function :is_writable, :uv_is_writable, [:uv_stream_t], :int, :blocking => true
81
+ attach_function :shutdown, :uv_shutdown, [:uv_shutdown_t, :uv_stream_t, :uv_shutdown_cb], :int, :blocking => true
82
+
83
+ attach_function :tcp_init, :uv_tcp_init, [:uv_loop_t, :uv_tcp_t], :int, :blocking => true
84
+ #attach_function :tcp_open, :uv_tcp_open, [:uv_tcp_t, :uv_os_sock_t], :int
85
+ attach_function :tcp_nodelay, :uv_tcp_nodelay, [:uv_tcp_t, :int], :int, :blocking => true
86
+ attach_function :tcp_keepalive, :uv_tcp_keepalive, [:uv_tcp_t, :int, :uint], :int, :blocking => true
87
+ attach_function :tcp_simultaneous_accepts, :uv_tcp_simultaneous_accepts, [:uv_tcp_t, :int], :int, :blocking => true
88
+ attach_function :tcp_bind, :uv_tcp_bind, [:uv_tcp_t, :sockaddr_in], :int, :blocking => true
89
+ attach_function :tcp_bind6, :uv_tcp_bind6, [:uv_tcp_t, :sockaddr_in6], :int, :blocking => true
90
+ attach_function :tcp_getsockname, :uv_tcp_getsockname, [:uv_tcp_t, :pointer, :pointer], :int, :blocking => true
91
+ attach_function :tcp_getpeername, :uv_tcp_getpeername, [:uv_tcp_t, :pointer, :pointer], :int, :blocking => true
92
+ attach_function :tcp_connect, :uv_tcp_connect, [:uv_connect_t, :uv_tcp_t, :sockaddr_in, :uv_connect_cb], :int, :blocking => true
93
+ attach_function :tcp_connect6, :uv_tcp_connect6, [:uv_connect_t, :uv_tcp_t, :sockaddr_in6, :uv_connect_cb], :int, :blocking => true
94
+
95
+ attach_function :udp_init, :uv_udp_init, [:uv_loop_t, :uv_udp_t], :int, :blocking => true
96
+ attach_function :udp_bind, :uv_udp_bind, [:uv_udp_t, :sockaddr_in, :uint], :int, :blocking => true
97
+ attach_function :udp_bind6, :uv_udp_bind6, [:uv_udp_t, :sockaddr_in6, :uint], :int, :blocking => true
98
+ attach_function :udp_getsockname, :uv_udp_getsockname, [:uv_udp_t, :pointer, :pointer], :int, :blocking => true
99
+ attach_function :udp_set_membership, :uv_udp_set_membership, [:uv_udp_t, :string, :string, :uv_membership], :int, :blocking => true
100
+ attach_function :udp_set_multicast_loop, :uv_udp_set_multicast_loop, [:uv_udp_t, :int], :int, :blocking => true
101
+ attach_function :udp_set_multicast_ttl, :uv_udp_set_multicast_ttl, [:uv_udp_t, :int], :int, :blocking => true
102
+ attach_function :udp_set_broadcast, :uv_udp_set_broadcast, [:uv_udp_t, :int], :int, :blocking => true
103
+ attach_function :udp_set_ttl, :uv_udp_set_ttl, [:uv_udp_t, :int], :int, :blocking => true
104
+ attach_function :udp_send, :uv_udp_send, [:uv_udp_send_t, :uv_udp_t, :pointer, :int, :sockaddr_in, :uv_udp_send_cb], :int, :blocking => true
105
+ attach_function :udp_send6, :uv_udp_send6, [:uv_udp_send_t, :uv_udp_t, :pointer, :int, :sockaddr_in6, :uv_udp_send_cb], :int, :blocking => true
106
+ attach_function :udp_recv_start, :uv_udp_recv_start, [:uv_udp_t, :uv_alloc_cb, :uv_udp_recv_cb], :int, :blocking => true
107
+ attach_function :udp_recv_stop, :uv_udp_recv_stop, [:uv_udp_t], :int, :blocking => true
108
+
109
+ attach_function :tty_init, :uv_tty_init, [:uv_loop_t, :uv_tty_t, :uv_file, :int], :int, :blocking => true
110
+ attach_function :tty_set_mode, :uv_tty_set_mode, [:uv_tty_t, :int], :int, :blocking => true
111
+ attach_function :tty_reset_mode, :uv_tty_reset_mode, [], :void, :blocking => true
112
+ attach_function :tty_get_winsize, :uv_tty_get_winsize, [:uv_tty_t, :pointer, :pointer], :int, :blocking => true
113
+
114
+ attach_function :guess_handle, :uv_guess_handle, [:uv_file], :uv_handle_type, :blocking => true
115
+
116
+ attach_function :pipe_init, :uv_pipe_init, [:uv_loop_t, :uv_pipe_t, :int], :int, :blocking => true
117
+ attach_function :pipe_open, :uv_pipe_open, [:uv_pipe_t, :uv_file], :void, :blocking => true
118
+ attach_function :pipe_bind, :uv_pipe_bind, [:uv_pipe_t, :string], :int, :blocking => true
119
+ attach_function :pipe_connect, :uv_pipe_connect, [:uv_connect_t, :uv_pipe_t, :string, :uv_connect_cb], :void, :blocking => true
120
+ attach_function :pipe_pending_instances, :uv_pipe_pending_instances, [:uv_pipe_t, :int], :void, :blocking => true
121
+
122
+ attach_function :prepare_init, :uv_prepare_init, [:uv_loop_t, :uv_prepare_t], :int, :blocking => true
123
+ attach_function :prepare_start, :uv_prepare_start, [:uv_prepare_t, :uv_prepare_cb], :int, :blocking => true
124
+ attach_function :prepare_stop, :uv_prepare_stop, [:uv_prepare_t], :int, :blocking => true
125
+
126
+ attach_function :check_init, :uv_check_init, [:uv_loop_t, :uv_check_t], :int, :blocking => true
127
+ attach_function :check_start, :uv_check_start, [:uv_check_t, :uv_check_cb], :int, :blocking => true
128
+ attach_function :check_stop, :uv_check_stop, [:uv_check_t], :int, :blocking => true
129
+
130
+ attach_function :idle_init, :uv_idle_init, [:uv_loop_t, :uv_idle_t], :int, :blocking => true
131
+ attach_function :idle_start, :uv_idle_start, [:uv_idle_t, :uv_idle_cb], :int, :blocking => true
132
+ attach_function :idle_stop, :uv_idle_stop, [:uv_idle_t], :int, :blocking => true
133
+
134
+ attach_function :async_init, :uv_async_init, [:uv_loop_t, :uv_async_t, :uv_async_cb], :int, :blocking => true
135
+ attach_function :async_send, :uv_async_send, [:uv_async_t], :int, :blocking => true
136
+
137
+ attach_function :timer_init, :uv_timer_init, [:uv_loop_t, :uv_timer_t], :int, :blocking => true
138
+ attach_function :timer_start, :uv_timer_start, [:uv_timer_t, :uv_timer_cb, :int64_t, :int64_t], :int, :blocking => true
139
+ attach_function :timer_stop, :uv_timer_stop, [:uv_timer_t], :int, :blocking => true
140
+ attach_function :timer_again, :uv_timer_again, [:uv_timer_t], :int, :blocking => true
141
+ attach_function :timer_set_repeat, :uv_timer_set_repeat, [:uv_timer_t, :int64_t], :void, :blocking => true
142
+ attach_function :timer_get_repeat, :uv_timer_get_repeat, [:uv_timer_t], :int64_t, :blocking => true
143
+
144
+ #attach_function :ares_init_options, :uv_ares_init_options, [:uv_loop_t, :ares_channel, :ares_options, :int], :int
145
+ #attach_function :ares_destroy, :uv_ares_destroy, [:uv_loop_t, :ares_channel], :void
146
+
147
+ attach_function :getaddrinfo, :uv_getaddrinfo, [:uv_loop_t, :uv_getaddrinfo_t, :uv_getaddrinfo_cb, :string, :string, :addrinfo], :int, :blocking => true
148
+ attach_function :freeaddrinfo, :uv_freeaddrinfo, [:addrinfo], :void, :blocking => true
149
+
150
+ attach_function :spawn, :uv_spawn, [:uv_loop_t, :uv_process_t, :uv_options_t], :int, :blocking => true
151
+ attach_function :process_kill, :uv_process_kill, [:uv_process_t, :int], :int, :blocking => true
152
+ attach_function :kill, :uv_kill, [:int, :int], :int, :blocking => true
153
+ attach_function :queue_work, :uv_queue_work, [:uv_loop_t, :uv_work_t, :uv_work_cb, :uv_after_work_cb], :int, :blocking => true
154
+ attach_function :cancel, :uv_cancel, [:pointer], :int, :blocking => true
155
+ attach_function :setup_args, :uv_setup_args, [:int, :varargs], :pointer, :blocking => true
156
+ attach_function :get_process_title, :uv_get_process_title, [:pointer, :size_t], :int, :blocking => true
157
+ attach_function :set_process_title, :uv_set_process_title, [:string], :int, :blocking => true
158
+ attach_function :resident_set_memory, :uv_resident_set_memory, [:size_t], :int, :blocking => true
159
+
160
+ attach_function :uptime, :uv_uptime, [:pointer], :int, :blocking => true
161
+ attach_function :cpu_info, :uv_cpu_info, [:uv_cpu_info_t, :pointer], :int, :blocking => true
162
+ attach_function :loadavg, :uv_loadavg, [:pointer], :void, :blocking => true
163
+ attach_function :free_cpu_info, :uv_free_cpu_info, [:uv_cpu_info_t, :int], :void, :blocking => true
164
+ attach_function :interface_addresses, :uv_interface_addresses, [:uv_interface_address_t, :pointer], :int, :blocking => true
165
+ attach_function :free_interface_addresses, :uv_free_interface_addresses, [:uv_interface_address_t, :int], :void, :blocking => true
166
+
167
+ #attach_function :fs_req_result, :uv_fs_req_result, [:uv_fs_t], :ssize_t
168
+ #attach_function :fs_req_stat, :uv_fs_req_stat, [:uv_fs_t], :uv_fs_stat_t
169
+ #attach_function :fs_req_pointer, :uv_fs_req_pointer, [:uv_fs_t], :pointer
170
+
171
+ attach_function :fs_req_cleanup, :uv_fs_req_cleanup, [:uv_fs_t], :void, :blocking => true
172
+ attach_function :fs_close, :uv_fs_close, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int, :blocking => true
173
+ attach_function :fs_open, :uv_fs_open, [:uv_loop_t, :uv_fs_t, :string, :int, :int, :uv_fs_cb], :int, :blocking => true
174
+ attach_function :fs_read, :uv_fs_read, [:uv_loop_t, :uv_fs_t, :uv_file, :string, :size_t, :off_t, :uv_fs_cb], :int, :blocking => true
175
+ attach_function :fs_unlink, :uv_fs_unlink, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int, :blocking => true
176
+ attach_function :fs_write, :uv_fs_write, [:uv_loop_t, :uv_fs_t, :uv_file, :string, :size_t, :off_t, :uv_fs_cb], :int, :blocking => true
177
+ attach_function :fs_mkdir, :uv_fs_mkdir, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int, :blocking => true
178
+ attach_function :fs_rmdir, :uv_fs_rmdir, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int, :blocking => true
179
+ attach_function :fs_readdir, :uv_fs_readdir, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int, :blocking => true
180
+ attach_function :fs_stat, :uv_fs_stat, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int, :blocking => true
181
+ attach_function :fs_fstat, :uv_fs_fstat, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int, :blocking => true
182
+ attach_function :fs_rename, :uv_fs_rename, [:uv_loop_t, :uv_fs_t, :string, :string, :uv_fs_cb], :int, :blocking => true
183
+ attach_function :fs_fsync, :uv_fs_fsync, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int, :blocking => true
184
+ attach_function :fs_fdatasync, :uv_fs_fdatasync, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_fs_cb], :int, :blocking => true
185
+ attach_function :fs_ftruncate, :uv_fs_ftruncate, [:uv_loop_t, :uv_fs_t, :uv_file, :off_t, :uv_fs_cb], :int, :blocking => true
186
+ attach_function :fs_sendfile, :uv_fs_sendfile, [:uv_loop_t, :uv_fs_t, :uv_file, :uv_file, :off_t, :size_t, :uv_fs_cb], :int, :blocking => true
187
+ attach_function :fs_chmod, :uv_fs_chmod, [:uv_loop_t, :uv_fs_t, :string, :int, :uv_fs_cb], :int, :blocking => true
188
+ attach_function :fs_utime, :uv_fs_utime, [:uv_loop_t, :uv_fs_t, :string, :double, :double, :uv_fs_cb], :int, :blocking => true
189
+ attach_function :fs_futime, :uv_fs_futime, [:uv_loop_t, :uv_fs_t, :uv_file, :double, :double, :uv_fs_cb], :int, :blocking => true
190
+ attach_function :fs_lstat, :uv_fs_lstat, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int, :blocking => true
191
+ attach_function :fs_link, :uv_fs_link, [:uv_loop_t, :uv_fs_t, :string, :string, :uv_fs_cb], :int, :blocking => true
192
+ attach_function :fs_symlink, :uv_fs_symlink, [:uv_loop_t, :uv_fs_t, :string, :string, :int, :uv_fs_cb], :int, :blocking => true
193
+ attach_function :fs_readlink, :uv_fs_readlink, [:uv_loop_t, :uv_fs_t, :string, :uv_fs_cb], :int, :blocking => true
194
+ attach_function :fs_fchmod, :uv_fs_fchmod, [:uv_loop_t, :uv_fs_t, :uv_file, :int, :uv_fs_cb], :int, :blocking => true
195
+ attach_function :fs_chown, :uv_fs_chown, [:uv_loop_t, :uv_fs_t, :string, :int, :int, :uv_fs_cb], :int, :blocking => true
196
+ attach_function :fs_fchown, :uv_fs_fchown, [:uv_loop_t, :uv_fs_t, :uv_file, :int, :int, :uv_fs_cb], :int, :blocking => true
197
+
198
+ attach_function :fs_event_init, :uv_fs_event_init, [:uv_loop_t, :uv_fs_event_t, :string, :uv_fs_event_cb, :int], :int, :blocking => true
199
+
200
+ attach_function :ip4_addr, :uv_ip4_addr, [:string, :int], :sockaddr_in, :blocking => true
201
+ attach_function :ip6_addr, :uv_ip6_addr, [:string, :int], :sockaddr_in6, :blocking => true
202
+ attach_function :ip4_name, :uv_ip4_name, [SockaddrIn.by_ref, :pointer, :size_t], :int, :blocking => true
203
+ attach_function :ip6_name, :uv_ip6_name, [SockaddrIn6.by_ref, :pointer, :size_t], :int, :blocking => true
204
+ #TODO:: attach_function :inet_ntop, :uv_inet_ntop, [:int, :pointer, ]
205
+ #TODO:: attach_function :uv_inet_pton
206
+
207
+ attach_function :exepath, :uv_exepath, [:pointer, :size_t], :int, :blocking => true
208
+ attach_function :cwd, :uv_cwd, [:pointer, :size_t], :int, :blocking => true
209
+ attach_function :chdir, :uv_chdir, [:string], :int, :blocking => true
210
+ attach_function :get_free_memory, :uv_get_free_memory, [], :uint64, :blocking => true
211
+ attach_function :get_total_memory, :uv_get_total_memory, [], :uint64, :blocking => true
212
+ attach_function :hrtime, :uv_hrtime, [], :uint64, :blocking => true
213
+ attach_function :disable_stdio_inheritance, :uv_disable_stdio_inheritance, [], :void, :blocking => true
214
+ attach_function :dlopen, :uv_dlopen, [:string, :uv_lib_t], :int, :blocking => true
215
+ attach_function :dlclose, :uv_dlclose, [:uv_lib_t], :int, :blocking => true
216
+ attach_function :dlsym, :uv_dlsym, [:uv_lib_t, :string, :pointer], :int, :blocking => true
217
+ #attach_function :dlerror, :uv_dlerror, [:uv_lib_t], :string
218
+ #attach_function :dlerror_free, :uv_dlerror_free, [:uv_lib_t, :string], :void
219
+
220
+ attach_function :mutex_init, :uv_mutex_init, [:uv_mutex_t], :int, :blocking => true
221
+ attach_function :mutex_destroy, :uv_mutex_destroy, [:uv_mutex_t], :void, :blocking => true
222
+ attach_function :mutex_lock, :uv_mutex_lock, [:uv_mutex_t], :void, :blocking => true
223
+ attach_function :mutex_trylock, :uv_mutex_trylock, [:uv_mutex_t], :int, :blocking => true
224
+ attach_function :mutex_unlock, :uv_mutex_unlock, [:uv_mutex_t], :void, :blocking => true
225
+
226
+ attach_function :rwlock_init, :uv_rwlock_init, [:uv_rwlock_t], :int, :blocking => true
227
+ attach_function :rwlock_destroy, :uv_rwlock_destroy, [:uv_rwlock_t], :void, :blocking => true
228
+ attach_function :rwlock_rdlock, :uv_rwlock_rdlock, [:uv_rwlock_t], :void, :blocking => true
229
+ attach_function :rwlock_tryrdlock, :uv_rwlock_tryrdlock, [:uv_rwlock_t], :int, :blocking => true
230
+ attach_function :rwlock_rdunlock, :uv_rwlock_rdunlock, [:uv_rwlock_t], :void, :blocking => true
231
+ attach_function :rwlock_wrlock, :uv_rwlock_wrlock, [:uv_rwlock_t], :void, :blocking => true
232
+ attach_function :rwlock_trywrlock, :uv_rwlock_trywrlock, [:uv_rwlock_t], :int, :blocking => true
233
+ attach_function :rwlock_wrunlock, :uv_rwlock_wrunlock, [:uv_rwlock_t], :void, :blocking => true
234
+
235
+ attach_function :once, :uv_once, [:uv_once_t, :uv_cb], :void, :blocking => true
236
+ attach_function :thread_create, :uv_thread_create, [:uv_thread_t, :uv_cb], :int, :blocking => true
237
+ attach_function :thread_join, :uv_thread_join, [:uv_thread_t], :int, :blocking => true
238
+
239
+ attach_function :handle_size, :uv_handle_size, [:uv_handle_type], :size_t, :blocking => true
240
+ attach_function :req_size, :uv_req_size, [:uv_req_type], :size_t, :blocking => true
241
+
242
+ # This function is attached differently in windows - see ./types/windows.rb
243
+ attach_function :ntohs, [:ushort], :ushort, :blocking => true unless FFI::Platform.windows?
244
+
219
245
 
220
246
  def self.create_handle(type)
221
- UV.malloc(UV.handle_size(type))
247
+ LIBC.malloc(UV.handle_size(type))
222
248
  end
223
249
 
224
250
  def self.create_request(type)
225
- UV.malloc(UV.req_size(type))
251
+ LIBC.malloc(UV.req_size(type))
226
252
  end
227
253
 
228
254
  autoload :Resource, 'uv/resource'
@@ -241,6 +267,7 @@ module UV
241
267
  autoload :Check, 'uv/check'
242
268
  autoload :Idle, 'uv/idle'
243
269
  autoload :Async, 'uv/async'
270
+ autoload :Work, 'uv/work'
244
271
  autoload :Filesystem, 'uv/filesystem'
245
272
  autoload :File, 'uv/file'
246
273
  autoload :FSEvent, 'uv/fs_event'