uringmachine 0.8.2 → 0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/TODO.md +0 -1
- data/examples/bm_side_running.rb +83 -0
- data/examples/bm_sqlite.rb +1 -1
- data/ext/um/um.c +66 -4
- data/ext/um/um.h +36 -0
- data/ext/um/um_class.c +6 -0
- data/ext/um/um_const.c +36 -0
- data/ext/um/um_ext.c +2 -0
- data/ext/um/um_stream.c +344 -0
- data/ext/um/um_stream_class.c +140 -0
- data/ext/um/um_utils.c +4 -0
- data/lib/uringmachine/actor.rb +1 -1
- data/lib/uringmachine/version.rb +1 -1
- data/lib/uringmachine.rb +35 -17
- data/test/test_fiber.rb +23 -3
- data/test/test_stream.rb +133 -0
- data/test/test_um.rb +109 -2
- data/uringmachine.gemspec +0 -2
- data/vendor/liburing/.github/workflows/{build.yml → ci.yml} +107 -42
- data/vendor/liburing/.gitignore +1 -0
- data/vendor/liburing/CHANGELOG +10 -0
- data/vendor/liburing/README +5 -0
- data/vendor/liburing/configure +1 -1
- data/vendor/liburing/examples/Makefile +1 -0
- data/vendor/liburing/examples/helpers.c +25 -0
- data/vendor/liburing/examples/helpers.h +13 -0
- data/vendor/liburing/examples/io_uring-test.c +3 -0
- data/vendor/liburing/examples/proxy.c +1 -1
- data/vendor/liburing/examples/reg-wait.c +41 -6
- data/vendor/liburing/examples/send-zerocopy.c +79 -32
- data/vendor/liburing/examples/zcrx.c +436 -0
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/src/Makefile +0 -1
- data/vendor/liburing/src/arch/generic/syscall.h +2 -2
- data/vendor/liburing/src/arch/syscall-defs.h +2 -2
- data/vendor/liburing/src/include/liburing/io_uring.h +101 -17
- data/vendor/liburing/src/include/liburing.h +179 -59
- data/vendor/liburing/src/int_flags.h +4 -1
- data/vendor/liburing/src/liburing-ffi.map +14 -2
- data/vendor/liburing/src/liburing.map +9 -2
- data/vendor/liburing/src/queue.c +35 -30
- data/vendor/liburing/src/register.c +46 -15
- data/vendor/liburing/src/sanitize.c +6 -9
- data/vendor/liburing/src/setup.c +37 -71
- data/vendor/liburing/src/syscall.c +2 -2
- data/vendor/liburing/test/232c93d07b74.c +1 -0
- data/vendor/liburing/test/Makefile +9 -0
- data/vendor/liburing/test/accept-test.c +1 -0
- data/vendor/liburing/test/cmd-discard.c +16 -8
- data/vendor/liburing/test/connect.c +11 -7
- data/vendor/liburing/test/epwait.c +420 -0
- data/vendor/liburing/test/eventfd-ring.c +30 -5
- data/vendor/liburing/test/fallocate.c +1 -1
- data/vendor/liburing/test/fixed-hugepage.c +10 -7
- data/vendor/liburing/test/fixed-seg.c +187 -0
- data/vendor/liburing/test/helpers.c +121 -0
- data/vendor/liburing/test/helpers.h +13 -0
- data/vendor/liburing/test/init-mem.c +2 -0
- data/vendor/liburing/test/io_uring_passthrough.c +78 -62
- data/vendor/liburing/test/iopoll-overflow.c +5 -4
- data/vendor/liburing/test/iopoll.c +20 -10
- data/vendor/liburing/test/iowait.c +141 -0
- data/vendor/liburing/test/nvme.h +2 -0
- data/vendor/liburing/test/pipe-bug.c +11 -5
- data/vendor/liburing/test/pipe-eof.c +11 -1
- data/vendor/liburing/test/read-inc-file.c +150 -0
- data/vendor/liburing/test/read-write.c +21 -14
- data/vendor/liburing/test/recv-bundle-short-ooo.c +435 -0
- data/vendor/liburing/test/recv-multishot.c +2 -2
- data/vendor/liburing/test/reg-wait.c +449 -120
- data/vendor/liburing/test/regbuf-clone.c +53 -0
- data/vendor/liburing/test/resize-rings.c +25 -2
- data/vendor/liburing/test/rsrc_tags.c +67 -14
- data/vendor/liburing/test/send-zerocopy.c +52 -130
- data/vendor/liburing/test/sendmsg_iov_clean.c +216 -0
- data/vendor/liburing/test/socket-nb.c +158 -0
- data/vendor/liburing/test/sqwait.c +9 -11
- data/vendor/liburing/test/timeout.c +198 -0
- data/vendor/liburing/test/vec-regbuf.c +609 -0
- data/vendor/liburing/test/wait-timeout.c +1 -1
- data/vendor/liburing/test/wq-aff.c +5 -1
- data/vendor/liburing/test/zcrx.c +928 -0
- metadata +16 -32
- data/vendor/liburing/.github/workflows/codespell.yml +0 -25
- data/vendor/liburing/.github/workflows/shellcheck.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8297cccb35ae1c8086889c2400db8bb884b0dfccdbef561caa0a4e9f80b21053
|
4
|
+
data.tar.gz: 990e84bb2f975de00739150cff966bbf97a551ba135714eb92bc3b86cd14b5d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f66149736c1cf58f8df65d387b81ff070fd890e99aa7c8aa806a5afcb04b8248b78c95c1673d30b7d3270c81e05bc0b84afdb025d2a0a2f02beca5977196b321
|
7
|
+
data.tar.gz: 7b6e6c31193da3a1e3e9a6fa627c84ae0f4d35c36f5fa636595acf1a013b71cd419073bb78be04130333796bed05e0ce9d1bfa74ab195608346cd689ecf9abaf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# 2025-06-02 Version 0.11
|
2
|
+
|
3
|
+
- Implement `UM::Stream` class for read streams
|
4
|
+
|
5
|
+
# 2025-05-05 Version 0.10
|
6
|
+
|
7
|
+
- Add `Thread#machine`
|
8
|
+
- Add `Fiber#mailbox`
|
9
|
+
|
10
|
+
# 2025-05-05 Version 0.9
|
11
|
+
|
12
|
+
- Add `#statx`
|
13
|
+
|
1
14
|
# 2025-05-05 Version 0.8.2
|
2
15
|
|
3
16
|
- Correctly deal with -EAGAIN when waiting for CQEs
|
data/TODO.md
CHANGED
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/inline'
|
4
|
+
|
5
|
+
gemfile do
|
6
|
+
source 'https://rubygems.org'
|
7
|
+
gem 'uringmachine', path: '..'
|
8
|
+
gem 'benchmark-ips'
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'benchmark/ips'
|
12
|
+
require 'uringmachine'
|
13
|
+
|
14
|
+
def consume_from_queue(queue)
|
15
|
+
m = UM.new
|
16
|
+
while true
|
17
|
+
response_mailbox, closure = m.shift(queue)
|
18
|
+
result = closure.call
|
19
|
+
m.push(response_mailbox, result)
|
20
|
+
end
|
21
|
+
# rescue UM::Terminate
|
22
|
+
# # We can also add a timeout here
|
23
|
+
# t0 = Time.now
|
24
|
+
# while !queue.empty? && (Time.now - t0) < 10
|
25
|
+
# response_mailbox, closure = m.shift(queue)
|
26
|
+
# result = closure.call
|
27
|
+
# m.push(response_mailbox, result)
|
28
|
+
# end
|
29
|
+
end
|
30
|
+
|
31
|
+
N = 8
|
32
|
+
|
33
|
+
$machine = UM.new
|
34
|
+
@queue = UM::Queue.new
|
35
|
+
@threads = N.times.map { Thread.new { consume_from_queue(@queue) } }
|
36
|
+
|
37
|
+
def side_run(&block)
|
38
|
+
mailbox = Fiber.current.mailbox
|
39
|
+
$machine.push(@queue, [mailbox, block])
|
40
|
+
Thread.pass
|
41
|
+
$machine.shift(mailbox)
|
42
|
+
end
|
43
|
+
|
44
|
+
@rqueue = Queue.new
|
45
|
+
@rthreads = N.times.map { Thread.new { r_consume_from_queue(@rqueue) }}
|
46
|
+
|
47
|
+
def r_consume_from_queue(queue)
|
48
|
+
m = UM.new
|
49
|
+
while true
|
50
|
+
response_mailbox, closure = @rqueue.shift
|
51
|
+
result = closure.call
|
52
|
+
m.push(response_mailbox, result)
|
53
|
+
end
|
54
|
+
# rescue UM::Terminate
|
55
|
+
# # We can also add a timeout here
|
56
|
+
# t0 = Time.now
|
57
|
+
# while !queue.empty? && (Time.now - t0) < 10
|
58
|
+
# response_mailbox, closure = m.shift(queue)
|
59
|
+
# result = closure.call
|
60
|
+
# m.push(response_mailbox, result)
|
61
|
+
# end
|
62
|
+
end
|
63
|
+
|
64
|
+
def r_side_run(&block)
|
65
|
+
mailbox = Fiber.current.mailbox
|
66
|
+
@rqueue.push([mailbox, block])
|
67
|
+
Thread.pass
|
68
|
+
$machine.shift(mailbox)
|
69
|
+
end
|
70
|
+
|
71
|
+
# puts '*' * 40
|
72
|
+
# p r_side_run { }
|
73
|
+
# exit!
|
74
|
+
|
75
|
+
Benchmark.ips do |x|
|
76
|
+
x.config(:time => 5, :warmup => 2)
|
77
|
+
|
78
|
+
x.report("side-run") { side_run { } }
|
79
|
+
x.report("r-side-run") { r_side_run { } }
|
80
|
+
# x.report("snoozing") { $machine.snooze }
|
81
|
+
|
82
|
+
x.compare!
|
83
|
+
end
|
data/examples/bm_sqlite.rb
CHANGED
data/ext/um/um.c
CHANGED
@@ -356,6 +356,22 @@ inline VALUE um_read(struct um *machine, int fd, VALUE buffer, int maxlen, int b
|
|
356
356
|
return raise_if_exception(ret);
|
357
357
|
}
|
358
358
|
|
359
|
+
inline size_t um_read_raw(struct um *machine, int fd, char *buffer, int maxlen) {
|
360
|
+
struct um_op op;
|
361
|
+
um_prep_op(machine, &op, OP_READ);
|
362
|
+
struct io_uring_sqe *sqe = um_get_sqe(machine, &op);
|
363
|
+
io_uring_prep_read(sqe, fd, buffer, maxlen, -1);
|
364
|
+
|
365
|
+
VALUE ret = um_fiber_switch(machine);
|
366
|
+
if (um_check_completion(machine, &op)) {
|
367
|
+
return op.result.res;
|
368
|
+
|
369
|
+
}
|
370
|
+
|
371
|
+
raise_if_exception(ret);
|
372
|
+
return 0;
|
373
|
+
}
|
374
|
+
|
359
375
|
VALUE um_write(struct um *machine, int fd, VALUE str, int len) {
|
360
376
|
struct um_op op;
|
361
377
|
um_prep_op(machine, &op, OP_WRITE);
|
@@ -521,7 +537,7 @@ VALUE um_setsockopt(struct um *machine, int fd, int level, int opt, int value) {
|
|
521
537
|
|
522
538
|
#ifdef HAVE_IO_URING_PREP_CMD_SOCK
|
523
539
|
struct um_op op;
|
524
|
-
um_prep_op(machine, &op,
|
540
|
+
um_prep_op(machine, &op, OP_SETSOCKOPT);
|
525
541
|
struct io_uring_sqe *sqe = um_get_sqe(machine, &op);
|
526
542
|
io_uring_prep_cmd_sock(sqe, SOCKET_URING_OP_SETSOCKOPT, fd, level, opt, &value, sizeof(value));
|
527
543
|
|
@@ -557,7 +573,7 @@ VALUE um_shutdown(struct um *machine, int fd, int how) {
|
|
557
573
|
|
558
574
|
VALUE um_open(struct um *machine, VALUE pathname, int flags, int mode) {
|
559
575
|
struct um_op op;
|
560
|
-
um_prep_op(machine, &op,
|
576
|
+
um_prep_op(machine, &op, OP_OPEN);
|
561
577
|
struct io_uring_sqe *sqe = um_get_sqe(machine, &op);
|
562
578
|
io_uring_prep_open(sqe, StringValueCStr(pathname), flags, mode);
|
563
579
|
|
@@ -571,11 +587,11 @@ VALUE um_open(struct um *machine, VALUE pathname, int flags, int mode) {
|
|
571
587
|
|
572
588
|
VALUE um_waitpid(struct um *machine, int pid, int options) {
|
573
589
|
struct um_op op;
|
574
|
-
um_prep_op(machine, &op,
|
590
|
+
um_prep_op(machine, &op, OP_WAITPID);
|
575
591
|
struct io_uring_sqe *sqe = um_get_sqe(machine, &op);
|
576
592
|
|
577
593
|
siginfo_t infop;
|
578
|
-
io_uring_prep_waitid(sqe, P_PID, pid, &infop, options, 0);
|
594
|
+
io_uring_prep_waitid(sqe, pid == 0 ? P_ALL : P_PID, pid, &infop, options, 0);
|
579
595
|
|
580
596
|
VALUE ret = um_fiber_switch(machine);
|
581
597
|
if (um_check_completion(machine, &op))
|
@@ -587,6 +603,52 @@ VALUE um_waitpid(struct um *machine, int pid, int options) {
|
|
587
603
|
return rb_ary_new_from_args(2, INT2NUM(infop.si_pid), INT2NUM(infop.si_status));
|
588
604
|
}
|
589
605
|
|
606
|
+
#define hash_set(h, sym, v) rb_hash_aset(h, ID2SYM(rb_intern(sym)), v)
|
607
|
+
|
608
|
+
VALUE statx_to_hash(struct statx *stat) {
|
609
|
+
VALUE hash = rb_hash_new();
|
610
|
+
|
611
|
+
hash_set(hash, "dev", UINT2NUM(stat->stx_dev_major << 8 | stat->stx_dev_minor));
|
612
|
+
hash_set(hash, "rdev", UINT2NUM(stat->stx_rdev_major << 8 | stat->stx_rdev_minor));
|
613
|
+
hash_set(hash, "blksize", UINT2NUM(stat->stx_blksize));
|
614
|
+
hash_set(hash, "attributes", UINT2NUM(stat->stx_attributes));
|
615
|
+
hash_set(hash, "nlink", UINT2NUM(stat->stx_nlink));
|
616
|
+
hash_set(hash, "uid", UINT2NUM(stat->stx_uid));
|
617
|
+
hash_set(hash, "gid", UINT2NUM(stat->stx_gid));
|
618
|
+
hash_set(hash, "mode", UINT2NUM(stat->stx_mode));
|
619
|
+
hash_set(hash, "ino", UINT2NUM(stat->stx_ino));
|
620
|
+
hash_set(hash, "size", UINT2NUM(stat->stx_size));
|
621
|
+
hash_set(hash, "blocks", UINT2NUM(stat->stx_blocks));
|
622
|
+
hash_set(hash, "atime", DBL2NUM(um_timestamp_to_double(stat->stx_atime.tv_sec, stat->stx_atime.tv_nsec)));
|
623
|
+
hash_set(hash, "btime", DBL2NUM(um_timestamp_to_double(stat->stx_btime.tv_sec, stat->stx_btime.tv_nsec)));
|
624
|
+
hash_set(hash, "ctime", DBL2NUM(um_timestamp_to_double(stat->stx_ctime.tv_sec, stat->stx_ctime.tv_nsec)));
|
625
|
+
hash_set(hash, "mtime", DBL2NUM(um_timestamp_to_double(stat->stx_mtime.tv_sec, stat->stx_mtime.tv_nsec)));
|
626
|
+
return hash;
|
627
|
+
}
|
628
|
+
|
629
|
+
VALUE um_statx(struct um *machine, int dirfd, VALUE path, int flags, unsigned int mask) {
|
630
|
+
struct um_op op;
|
631
|
+
um_prep_op(machine, &op, OP_STATX);
|
632
|
+
struct io_uring_sqe *sqe = um_get_sqe(machine, &op);
|
633
|
+
|
634
|
+
struct statx stat;
|
635
|
+
memset(&stat, 0, sizeof(stat));
|
636
|
+
|
637
|
+
if (NIL_P(path))
|
638
|
+
path = rb_str_new_literal("");
|
639
|
+
|
640
|
+
io_uring_prep_statx(sqe, dirfd, StringValueCStr(path), flags, mask, &stat);
|
641
|
+
|
642
|
+
VALUE ret = um_fiber_switch(machine);
|
643
|
+
if (um_check_completion(machine, &op))
|
644
|
+
ret = INT2NUM(op.result.res);
|
645
|
+
|
646
|
+
RB_GC_GUARD(ret);
|
647
|
+
raise_if_exception(ret);
|
648
|
+
|
649
|
+
return statx_to_hash(&stat);
|
650
|
+
}
|
651
|
+
|
590
652
|
/*******************************************************************************
|
591
653
|
multishot ops
|
592
654
|
*******************************************************************************/
|
data/ext/um/um.h
CHANGED
@@ -25,9 +25,12 @@ enum op_kind {
|
|
25
25
|
OP_SCHEDULE,
|
26
26
|
|
27
27
|
OP_SLEEP,
|
28
|
+
OP_OPEN,
|
28
29
|
OP_READ,
|
29
30
|
OP_WRITE,
|
30
31
|
OP_CLOSE,
|
32
|
+
OP_STATX,
|
33
|
+
|
31
34
|
OP_ACCEPT,
|
32
35
|
OP_RECV,
|
33
36
|
OP_SEND,
|
@@ -38,6 +41,8 @@ enum op_kind {
|
|
38
41
|
OP_GETSOCKOPT,
|
39
42
|
OP_SETSOCKOPT,
|
40
43
|
OP_SHUTDOWN,
|
44
|
+
|
45
|
+
OP_WAITPID,
|
41
46
|
|
42
47
|
OP_FUTEX_WAIT,
|
43
48
|
OP_FUTEX_WAKE,
|
@@ -148,6 +153,24 @@ struct um_async_op {
|
|
148
153
|
struct um_op *op;
|
149
154
|
};
|
150
155
|
|
156
|
+
struct um_stream {
|
157
|
+
VALUE self;
|
158
|
+
|
159
|
+
struct um *machine;
|
160
|
+
int fd;
|
161
|
+
VALUE buffer;
|
162
|
+
ulong len;
|
163
|
+
ulong pos;
|
164
|
+
int eof;
|
165
|
+
};
|
166
|
+
|
167
|
+
struct um_write_buffer {
|
168
|
+
VALUE str;
|
169
|
+
size_t capa;
|
170
|
+
size_t len;
|
171
|
+
char *ptr;
|
172
|
+
};
|
173
|
+
|
151
174
|
extern VALUE cUM;
|
152
175
|
extern VALUE cMutex;
|
153
176
|
extern VALUE cQueue;
|
@@ -176,6 +199,7 @@ void um_buffer_checkin(struct um *machine, struct um_buffer *buffer);
|
|
176
199
|
void um_free_buffer_linked_list(struct um *machine);
|
177
200
|
|
178
201
|
struct __kernel_timespec um_double_to_timespec(double value);
|
202
|
+
double um_timestamp_to_double(__s64 tv_sec, __u32 tv_nsec);
|
179
203
|
int um_value_is_exception_p(VALUE v);
|
180
204
|
VALUE um_raise_exception(VALUE v);
|
181
205
|
|
@@ -204,11 +228,13 @@ VALUE um_timeout(struct um *machine, VALUE interval, VALUE class);
|
|
204
228
|
VALUE um_sleep(struct um *machine, double duration);
|
205
229
|
VALUE um_periodically(struct um *machine, double interval);
|
206
230
|
VALUE um_read(struct um *machine, int fd, VALUE buffer, int maxlen, int buffer_offset);
|
231
|
+
size_t um_read_raw(struct um *machine, int fd, char *buffer, int maxlen);
|
207
232
|
VALUE um_read_each(struct um *machine, int fd, int bgid);
|
208
233
|
VALUE um_write(struct um *machine, int fd, VALUE str, int len);
|
209
234
|
VALUE um_close(struct um *machine, int fd);
|
210
235
|
VALUE um_open(struct um *machine, VALUE pathname, int flags, int mode);
|
211
236
|
VALUE um_waitpid(struct um *machine, int pid, int options);
|
237
|
+
VALUE um_statx(struct um *machine, int dirfd, VALUE path, int flags, unsigned int mask);
|
212
238
|
|
213
239
|
VALUE um_accept(struct um *machine, int fd);
|
214
240
|
VALUE um_accept_each(struct um *machine, int fd);
|
@@ -244,6 +270,16 @@ VALUE um_queue_pop(struct um *machine, struct um_queue *queue);
|
|
244
270
|
VALUE um_queue_unshift(struct um *machine, struct um_queue *queue, VALUE value);
|
245
271
|
VALUE um_queue_shift(struct um *machine, struct um_queue *queue);
|
246
272
|
|
273
|
+
int stream_read_more(struct um_stream *stream);
|
274
|
+
|
275
|
+
VALUE resp_get_line(struct um_stream *stream, VALUE out_buffer);
|
276
|
+
VALUE resp_get_string(struct um_stream *stream, ulong len, VALUE out_buffer);
|
277
|
+
VALUE resp_decode(struct um_stream *stream, VALUE out_buffer);
|
278
|
+
void resp_encode(struct um_write_buffer *buf, VALUE obj);
|
279
|
+
|
280
|
+
void write_buffer_init(struct um_write_buffer *buf, VALUE str);
|
281
|
+
void write_buffer_update_len(struct um_write_buffer *buf);
|
282
|
+
|
247
283
|
void um_define_net_constants(VALUE mod);
|
248
284
|
|
249
285
|
#endif // UM_H
|
data/ext/um/um_class.c
CHANGED
@@ -130,6 +130,11 @@ VALUE UM_write(int argc, VALUE *argv, VALUE self) {
|
|
130
130
|
return um_write(machine, NUM2INT(fd), buffer, bytes);
|
131
131
|
}
|
132
132
|
|
133
|
+
VALUE UM_statx(VALUE self, VALUE dirfd, VALUE path, VALUE flags, VALUE mask) {
|
134
|
+
struct um *machine = um_get_machine(self);
|
135
|
+
return um_statx(machine, NUM2INT(dirfd), path, NUM2INT(flags), NUM2UINT(mask));
|
136
|
+
}
|
137
|
+
|
133
138
|
VALUE UM_close(VALUE self, VALUE fd) {
|
134
139
|
struct um *machine = um_get_machine(self);
|
135
140
|
return um_close(machine, NUM2INT(fd));
|
@@ -342,6 +347,7 @@ void Init_UM(void) {
|
|
342
347
|
rb_define_method(cUM, "sleep", UM_sleep, 1);
|
343
348
|
rb_define_method(cUM, "periodically", UM_periodically, 1);
|
344
349
|
rb_define_method(cUM, "write", UM_write, -1);
|
350
|
+
rb_define_method(cUM, "statx", UM_statx, 4);
|
345
351
|
|
346
352
|
rb_define_method(cUM, "waitpid", UM_waitpid, 2);
|
347
353
|
|
data/ext/um/um_const.c
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#include "ruby.h"
|
2
2
|
|
3
3
|
#include <fcntl.h>
|
4
|
+
#include <sys/stat.h>
|
4
5
|
#include <sys/wait.h>
|
5
6
|
|
6
7
|
#include <arpa/inet.h>
|
@@ -16,6 +17,41 @@
|
|
16
17
|
#define DEF_CONST_INT(mod, v) rb_define_const(mod, #v, INT2NUM(v))
|
17
18
|
|
18
19
|
void um_define_net_constants(VALUE mod) {
|
20
|
+
DEF_CONST_INT(mod, AT_FDCWD);
|
21
|
+
DEF_CONST_INT(mod, AT_EMPTY_PATH);
|
22
|
+
DEF_CONST_INT(mod, AT_NO_AUTOMOUNT);
|
23
|
+
DEF_CONST_INT(mod, AT_SYMLINK_NOFOLLOW);
|
24
|
+
DEF_CONST_INT(mod, AT_STATX_SYNC_AS_STAT);
|
25
|
+
DEF_CONST_INT(mod, AT_STATX_FORCE_SYNC);
|
26
|
+
DEF_CONST_INT(mod, AT_STATX_DONT_SYNC);
|
27
|
+
|
28
|
+
DEF_CONST_INT(mod, STATX_TYPE);
|
29
|
+
DEF_CONST_INT(mod, STATX_MODE);
|
30
|
+
DEF_CONST_INT(mod, STATX_NLINK);
|
31
|
+
DEF_CONST_INT(mod, STATX_UID);
|
32
|
+
DEF_CONST_INT(mod, STATX_GID);
|
33
|
+
DEF_CONST_INT(mod, STATX_ATIME);
|
34
|
+
DEF_CONST_INT(mod, STATX_MTIME);
|
35
|
+
DEF_CONST_INT(mod, STATX_CTIME);
|
36
|
+
DEF_CONST_INT(mod, STATX_INO);
|
37
|
+
DEF_CONST_INT(mod, STATX_SIZE);
|
38
|
+
DEF_CONST_INT(mod, STATX_BLOCKS);
|
39
|
+
DEF_CONST_INT(mod, STATX_BASIC_STATS);
|
40
|
+
DEF_CONST_INT(mod, STATX_BTIME);
|
41
|
+
DEF_CONST_INT(mod, STATX_ALL);
|
42
|
+
DEF_CONST_INT(mod, STATX_MNT_ID);
|
43
|
+
DEF_CONST_INT(mod, STATX_DIOALIGN);
|
44
|
+
DEF_CONST_INT(mod, STATX_MNT_ID_UNIQUE);
|
45
|
+
#ifdef STATX_SUBVOL
|
46
|
+
DEF_CONST_INT(mod, STATX_SUBVOL);
|
47
|
+
#endif
|
48
|
+
#ifdef STATX_WRITE_ATOMIC
|
49
|
+
DEF_CONST_INT(mod, STATX_WRITE_ATOMIC);
|
50
|
+
#endif
|
51
|
+
#ifdef STATX_DIO_READ_ALIGN
|
52
|
+
DEF_CONST_INT(mod, STATX_DIO_READ_ALIGN);
|
53
|
+
#endif
|
54
|
+
|
19
55
|
DEF_CONST_INT(mod, MSG_CONFIRM);
|
20
56
|
DEF_CONST_INT(mod, MSG_DONTROUTE);
|
21
57
|
DEF_CONST_INT(mod, MSG_DONTWAIT);
|
data/ext/um/um_ext.c
CHANGED
@@ -3,6 +3,7 @@ void Init_Mutex();
|
|
3
3
|
void Init_Queue();
|
4
4
|
void Init_AsyncOp();
|
5
5
|
void Init_SSL();
|
6
|
+
void Init_Stream();
|
6
7
|
|
7
8
|
void Init_um_ext(void) {
|
8
9
|
Init_UM();
|
@@ -10,4 +11,5 @@ void Init_um_ext(void) {
|
|
10
11
|
Init_Queue();
|
11
12
|
Init_AsyncOp();
|
12
13
|
// Init_SSL();
|
14
|
+
Init_Stream();
|
13
15
|
}
|