event 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/event/backend.o DELETED
Binary file
@@ -1,178 +0,0 @@
1
- // Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
20
-
21
- #include "backend.h"
22
- #include <fcntl.h>
23
-
24
- #ifndef HAVE__RB_FIBER_TRANSFER
25
- static ID id_transfer;
26
-
27
- VALUE
28
- Event_Backend_fiber_transfer(VALUE fiber) {
29
- return rb_funcall(fiber, id_transfer, 0);
30
- }
31
-
32
- VALUE
33
- Event_Backend_fiber_transfer_result(VALUE fiber, VALUE result) {
34
- return rb_funcall(fiber, id_transfer, 1, result);
35
- }
36
- #endif
37
-
38
- #ifndef HAVE_RB_IO_DESCRIPTOR
39
- static ID id_fileno;
40
-
41
- int Event_Backend_io_descriptor(VALUE io) {
42
- return RB_NUM2INT(rb_funcall(io, id_fileno, 0));
43
- }
44
- #endif
45
-
46
- #ifndef HAVE_RB_PROCESS_STATUS_WAIT
47
- static ID id_wait;
48
- static VALUE rb_Process_Status = Qnil;
49
-
50
- VALUE Event_Backend_process_status_wait(rb_pid_t pid)
51
- {
52
- return rb_funcall(rb_Process_Status, id_wait, 2, PIDT2NUM(pid), INT2NUM(WNOHANG));
53
- }
54
- #endif
55
-
56
- int Event_Backend_nonblock_set(int file_descriptor)
57
- {
58
- int flags = fcntl(file_descriptor, F_GETFL, 0);
59
-
60
- if (!(flags & O_NONBLOCK)) {
61
- fcntl(file_descriptor, F_SETFL, flags | O_NONBLOCK);
62
- }
63
-
64
- return flags;
65
- }
66
-
67
- void Event_Backend_nonblock_restore(int file_descriptor, int flags)
68
- {
69
- if (!(flags & O_NONBLOCK)) {
70
- fcntl(file_descriptor, F_SETFL, flags & ~flags);
71
- }
72
- }
73
-
74
- void Init_Event_Backend(VALUE Event_Backend) {
75
- #ifndef HAVE_RB_IO_DESCRIPTOR
76
- id_fileno = rb_intern("fileno");
77
- #endif
78
-
79
- #ifndef HAVE__RB_FIBER_TRANSFER
80
- id_transfer = rb_intern("transfer");
81
- #endif
82
-
83
- #ifndef HAVE_RB_PROCESS_STATUS_WAIT
84
- id_wait = rb_intern("wait");
85
- rb_Process_Status = rb_const_get_at(rb_mProcess, rb_intern("Status"));
86
- #endif
87
- }
88
-
89
- struct wait_and_transfer_arguments {
90
- struct Event_Backend *backend;
91
- struct Event_Backend_Queue *waiting;
92
- };
93
-
94
- static void queue_pop(struct Event_Backend *backend, struct Event_Backend_Queue *waiting) {
95
- if (waiting->behind) {
96
- waiting->behind->infront = waiting->infront;
97
- } else {
98
- backend->waiting = waiting->infront;
99
- }
100
-
101
- if (waiting->infront) {
102
- waiting->infront->behind = waiting->behind;
103
- } else {
104
- backend->ready = waiting->behind;
105
- }
106
- }
107
-
108
- static void queue_push(struct Event_Backend *backend, struct Event_Backend_Queue *waiting) {
109
- if (backend->waiting) {
110
- backend->waiting->behind = waiting;
111
- waiting->infront = backend->waiting;
112
- } else {
113
- backend->ready = waiting;
114
- }
115
-
116
- backend->waiting = waiting;
117
- }
118
-
119
- static VALUE wait_and_transfer(VALUE fiber) {
120
- return Event_Backend_fiber_transfer(fiber);
121
- }
122
-
123
- static VALUE wait_and_transfer_ensure(VALUE _arguments) {
124
- struct wait_and_transfer_arguments *arguments = (struct wait_and_transfer_arguments *)_arguments;
125
-
126
- queue_pop(arguments->backend, arguments->waiting);
127
-
128
- return Qnil;
129
- }
130
-
131
- void Event_Backend_wait_and_transfer(struct Event_Backend *backend, VALUE fiber)
132
- {
133
- struct Event_Backend_Queue waiting = {
134
- .behind = NULL,
135
- .infront = NULL,
136
- .fiber = rb_fiber_current()
137
- };
138
-
139
- queue_push(backend, &waiting);
140
-
141
- struct wait_and_transfer_arguments arguments = {
142
- .backend = backend,
143
- .waiting = &waiting,
144
- };
145
-
146
- rb_ensure(wait_and_transfer, fiber, wait_and_transfer_ensure, (VALUE)&arguments);
147
- }
148
-
149
- void Event_Backend_ready_pop(struct Event_Backend *backend)
150
- {
151
- // Get the current tail and head of the queue:
152
- struct Event_Backend_Queue *waiting = backend->waiting;
153
-
154
- // Process from head to tail in order:
155
- // During this, more items may be appended to tail.
156
- while (backend->ready) {
157
- struct Event_Backend_Queue *ready = backend->ready;
158
-
159
- Event_Backend_fiber_transfer(ready->fiber);
160
-
161
- if (ready == waiting) break;
162
- }
163
- }
164
-
165
- void Event_Backend_elapsed_time(struct timespec* start, struct timespec* stop, struct timespec *duration)
166
- {
167
- if ((stop->tv_nsec - start->tv_nsec) < 0) {
168
- duration->tv_sec = stop->tv_sec - start->tv_sec - 1;
169
- duration->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000;
170
- } else {
171
- duration->tv_sec = stop->tv_sec - start->tv_sec;
172
- duration->tv_nsec = stop->tv_nsec - start->tv_nsec;
173
- }
174
- }
175
-
176
- void Event_Backend_current_time(struct timespec *time) {
177
- clock_gettime(CLOCK_MONOTONIC, time);
178
- }
@@ -1,112 +0,0 @@
1
- // Copyright, 2021, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- //
3
- // Permission is hereby granted, free of charge, to any person obtaining a copy
4
- // of this software and associated documentation files (the "Software"), to deal
5
- // in the Software without restriction, including without limitation the rights
6
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- // copies of the Software, and to permit persons to whom the Software is
8
- // furnished to do so, subject to the following conditions:
9
- //
10
- // The above copyright notice and this permission notice shall be included in
11
- // all copies or substantial portions of the Software.
12
- //
13
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- // THE SOFTWARE.
20
-
21
- #include <ruby.h>
22
- #include <ruby/thread.h>
23
- #include <ruby/io.h>
24
-
25
- #ifdef HAVE_RUBY_IO_BUFFER_H
26
- #include <ruby/io/buffer.h>
27
- #endif
28
-
29
- #include <time.h>
30
-
31
- enum Event {
32
- READABLE = 1,
33
- PRIORITY = 2,
34
- WRITABLE = 4,
35
- ERROR = 8,
36
- HANGUP = 16
37
- };
38
-
39
- void Init_Event_Backend();
40
-
41
- #ifdef HAVE__RB_FIBER_TRANSFER
42
- #define Event_Backend_fiber_transfer(fiber) rb_fiber_transfer(fiber, 0, NULL)
43
- #define Event_Backend_fiber_transfer_result(fiber, argument) rb_fiber_transfer(fiber, 1, &argument)
44
- #else
45
- VALUE Event_Backend_fiber_transfer(VALUE fiber);
46
- VALUE Event_Backend_fiber_transfer_result(VALUE fiber, VALUE argument);
47
- #endif
48
-
49
- #ifdef HAVE_RB_IO_DESCRIPTOR
50
- #define Event_Backend_io_descriptor(io) rb_io_descriptor(io)
51
- #else
52
- int Event_Backend_io_descriptor(VALUE io);
53
- #endif
54
-
55
- #ifdef HAVE_RB_PROCESS_STATUS_WAIT
56
- #define Event_Backend_process_status_wait(pid) rb_process_status_wait(pid)
57
- #else
58
- VALUE Event_Backend_process_status_wait(rb_pid_t pid);
59
- #endif
60
-
61
- int Event_Backend_nonblock_set(int file_descriptor);
62
- void Event_Backend_nonblock_restore(int file_descriptor, int flags);
63
-
64
- struct Event_Backend_Queue {
65
- struct Event_Backend_Queue *behind;
66
- struct Event_Backend_Queue *infront;
67
-
68
- VALUE fiber;
69
- };
70
-
71
- struct Event_Backend {
72
- VALUE loop;
73
-
74
- // Append to waiting.
75
- struct Event_Backend_Queue *waiting;
76
- // Process from ready.
77
- struct Event_Backend_Queue *ready;
78
- };
79
-
80
- inline
81
- void Event_Backend_initialize(struct Event_Backend *backend, VALUE loop) {
82
- backend->loop = loop;
83
- backend->waiting = NULL;
84
- backend->ready = NULL;
85
- }
86
-
87
- inline
88
- void Event_Backend_mark(struct Event_Backend *backend) {
89
- rb_gc_mark(backend->loop);
90
-
91
- struct Event_Backend_Queue *ready = backend->ready;
92
- while (ready) {
93
- rb_gc_mark(ready->fiber);
94
- ready = ready->behind;
95
- }
96
- }
97
-
98
- void Event_Backend_wait_and_transfer(struct Event_Backend *backend, VALUE fiber);
99
-
100
- inline
101
- void Event_Backend_defer(struct Event_Backend *backend)
102
- {
103
- Event_Backend_wait_and_transfer(backend, backend->loop);
104
- }
105
-
106
- void Event_Backend_ready_pop(struct Event_Backend *backend);
107
-
108
- void Event_Backend_elapsed_time(struct timespec* start, struct timespec* stop, struct timespec *duration);
109
- void Event_Backend_current_time(struct timespec *time);
110
-
111
- #define PRINTF_TIMESPEC "%lld.%.9ld"
112
- #define PRINTF_TIMESPEC_ARGS(ts) (long long)((ts).tv_sec), (ts).tv_nsec
Binary file
data/ext/event/event.o DELETED
Binary file
data/ext/event/extconf.h DELETED
@@ -1,4 +0,0 @@
1
- #ifndef EXTCONF_H
2
- #define EXTCONF_H
3
- #define HAVE_SYS_EVENT_H 1
4
- #endif
data/ext/event/kqueue.o DELETED
Binary file
data/ext/event/mkmf.log DELETED
@@ -1,195 +0,0 @@
1
- have_func: checking for &rb_fiber_transfer()... -------------------- no
2
-
3
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
4
- checked program was:
5
- /* begin */
6
- 1: #include "ruby.h"
7
- 2:
8
- 3: int main(int argc, char **argv)
9
- 4: {
10
- 5: return !!argv[argc];
11
- 6: }
12
- /* end */
13
-
14
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
15
- conftest.c:14:76: error: use of undeclared identifier 'rb_fiber_transfer'
16
- int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_transfer; return !p; }
17
- ^
18
- 1 error generated.
19
- checked program was:
20
- /* begin */
21
- 1: #include "ruby.h"
22
- 2:
23
- 3: /*top*/
24
- 4: extern int t(void);
25
- 5: int main(int argc, char **argv)
26
- 6: {
27
- 7: if (argc > 1000000) {
28
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
29
- 9: printf("%d", (*tp)());
30
- 10: }
31
- 11:
32
- 12: return !!argv[argc];
33
- 13: }
34
- 14: int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_transfer; return !p; }
35
- /* end */
36
-
37
- --------------------
38
-
39
- have_library: checking for -luring... -------------------- no
40
-
41
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc -luring "
42
- ld: library not found for -luring
43
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
44
- checked program was:
45
- /* begin */
46
- 1: #include "ruby.h"
47
- 2:
48
- 3: /*top*/
49
- 4: extern int t(void);
50
- 5: int main(int argc, char **argv)
51
- 6: {
52
- 7: if (argc > 1000000) {
53
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
54
- 9: printf("%d", (*tp)());
55
- 10: }
56
- 11:
57
- 12: return !!argv[argc];
58
- 13: }
59
- 14:
60
- 15: int t(void) { ; return 0; }
61
- /* end */
62
-
63
- --------------------
64
-
65
- have_header: checking for sys/epoll.h... -------------------- no
66
-
67
- "clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
68
- conftest.c:3:10: fatal error: 'sys/epoll.h' file not found
69
- #include <sys/epoll.h>
70
- ^~~~~~~~~~~~~
71
- 1 error generated.
72
- checked program was:
73
- /* begin */
74
- 1: #include "ruby.h"
75
- 2:
76
- 3: #include <sys/epoll.h>
77
- /* end */
78
-
79
- --------------------
80
-
81
- have_header: checking for sys/event.h... -------------------- yes
82
-
83
- "clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
84
- checked program was:
85
- /* begin */
86
- 1: #include "ruby.h"
87
- 2:
88
- 3: #include <sys/event.h>
89
- /* end */
90
-
91
- --------------------
92
-
93
- have_func: checking for rb_io_descriptor()... -------------------- no
94
-
95
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
96
- conftest.c:14:57: error: use of undeclared identifier 'rb_io_descriptor'
97
- int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
98
- ^
99
- 1 error generated.
100
- checked program was:
101
- /* begin */
102
- 1: #include "ruby.h"
103
- 2:
104
- 3: /*top*/
105
- 4: extern int t(void);
106
- 5: int main(int argc, char **argv)
107
- 6: {
108
- 7: if (argc > 1000000) {
109
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
110
- 9: printf("%d", (*tp)());
111
- 10: }
112
- 11:
113
- 12: return !!argv[argc];
114
- 13: }
115
- 14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
116
- /* end */
117
-
118
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
119
- Undefined symbols for architecture x86_64:
120
- "_rb_io_descriptor", referenced from:
121
- _t in conftest-9dccb6.o
122
- ld: symbol(s) not found for architecture x86_64
123
- clang: error: linker command failed with exit code 1 (use -v to see invocation)
124
- checked program was:
125
- /* begin */
126
- 1: #include "ruby.h"
127
- 2:
128
- 3: /*top*/
129
- 4: extern int t(void);
130
- 5: int main(int argc, char **argv)
131
- 6: {
132
- 7: if (argc > 1000000) {
133
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
134
- 9: printf("%d", (*tp)());
135
- 10: }
136
- 11:
137
- 12: return !!argv[argc];
138
- 13: }
139
- 14: extern void rb_io_descriptor();
140
- 15: int t(void) { rb_io_descriptor(); return 0; }
141
- /* end */
142
-
143
- --------------------
144
-
145
- have_func: checking for &rb_process_status_wait()... -------------------- no
146
-
147
- "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.1/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
148
- conftest.c:14:76: error: use of undeclared identifier 'rb_process_status_wait'
149
- int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_process_status_wait; return !p; }
150
- ^
151
- 1 error generated.
152
- checked program was:
153
- /* begin */
154
- 1: #include "ruby.h"
155
- 2:
156
- 3: /*top*/
157
- 4: extern int t(void);
158
- 5: int main(int argc, char **argv)
159
- 6: {
160
- 7: if (argc > 1000000) {
161
- 8: int (* volatile tp)(void)=(int (*)(void))&t;
162
- 9: printf("%d", (*tp)());
163
- 10: }
164
- 11:
165
- 12: return !!argv[argc];
166
- 13: }
167
- 14: int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_process_status_wait; return !p; }
168
- /* end */
169
-
170
- --------------------
171
-
172
- have_header: checking for ruby/io/buffer.h... -------------------- no
173
-
174
- "clang -E -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/x86_64-darwin20 -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.1/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall conftest.c -o conftest.i"
175
- conftest.c:3:10: fatal error: 'ruby/io/buffer.h' file not found
176
- #include <ruby/io/buffer.h>
177
- ^~~~~~~~~~~~~~~~~~
178
- 1 error generated.
179
- checked program was:
180
- /* begin */
181
- 1: #include "ruby.h"
182
- 2:
183
- 3: #include <ruby/io/buffer.h>
184
- /* end */
185
-
186
- --------------------
187
-
188
- extconf.h is:
189
- /* begin */
190
- 1: #ifndef EXTCONF_H
191
- 2: #define EXTCONF_H
192
- 3: #define HAVE_SYS_EVENT_H 1
193
- 4: #endif
194
- /* end */
195
-