diff options
author | Eric Wong <bofh@yhbt.net> | 2023-09-10 18:49:48 +0000 |
---|---|---|
committer | Eric Wong <bofh@yhbt.net> | 2023-09-10 20:11:23 +0000 |
commit | cb4eac178dcabcc08d7f6808983286b5e32af3fa (patch) | |
tree | c9e21d1d5fcc1d03358e24692f1a6ec58c168518 /ext/kgio/tryopen.c | |
parent | 12e7f65ab9b6a14b3d59094f4d305b3150e0e7b7 (diff) | |
download | kgio-master.tar.gz |
Ruby 1.8 is long gone, and rb_io_t internals are going private so we can't assign fptr->pathv and such, so rely on ivars for that. TCP autopush never seemed worth it, but the ivar fallback remains in case anybody wants to use it.
Diffstat (limited to 'ext/kgio/tryopen.c')
-rw-r--r-- | ext/kgio/tryopen.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/ext/kgio/tryopen.c b/ext/kgio/tryopen.c index d87cb17..87017a5 100644 --- a/ext/kgio/tryopen.c +++ b/ext/kgio/tryopen.c @@ -1,10 +1,6 @@ /* We do not modify RSTRING in this file, so RSTRING_MODIFIED is not needed */ #include <ruby.h> -#ifdef HAVE_RUBY_IO_H -# include <ruby/io.h> -#else -# include <rubyio.h> -#endif +#include <ruby/io.h> #ifdef HAVE_RUBY_ST_H # include <ruby/st.h> @@ -17,7 +13,6 @@ #include <fcntl.h> #include <errno.h> #include "set_file_path.h" -#include "ancient_ruby.h" #include "kgio.h" static ID id_for_fd, id_to_path, id_path; @@ -41,27 +36,6 @@ static void * nogvl_open(void *ptr) return (void *)fd; } -#ifndef KGIO_WITHOUT_GVL -# define RUBY_UBF_IO ((void *)(-1)) -# include "rubysig.h" -typedef void my_unblock_function_t(void *); -typedef void *my_blocking_function_t(void *); -static void * my_thread_blocking_region( - my_blocking_function_t *fn, void *data1, - my_unblock_function_t *ubf, void *data2) -{ - void *rv; - - TRAP_BEG; /* for FIFO */ - rv = fn(data1); - TRAP_END; - - return rv; -} -#define KGIO_WITHOUT_GVL(fn,data1,ubf,data2) \ - my_thread_blocking_region((fn),(data1),(ubf),(data2)) -#endif /* ! KGIO_WITHOUT_GVL */ - /* * call-seq: * @@ -157,10 +131,6 @@ void init_kgio_tryopen(void) rb_define_singleton_method(cFile, "tryopen", s_tryopen, -1); rb_include_module(cFile, mPipeMethods); - if (!rb_funcall(cFile, rb_intern("method_defined?"), 1, - ID2SYM(id_to_path))) - rb_define_alias(cFile, "to_path", "path"); - errno2sym = st_init_numtable(); tmp = rb_funcall(rb_mErrno, rb_intern("constants"), 0); len = RARRAY_LEN(tmp); |