From f9adadc5e610360850b3a4bd9a43e928d1c78bb1 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 23 Dec 2015 14:58:47 +0000 Subject: rb_readwrite_syserr_fail * io.c (rb_readwrite_syserr_fail): works with the given errno than thread local errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/ruby.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index d54c51121c..14fe7c3e16 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1773,6 +1773,11 @@ VALUE *rb_ruby_debug_ptr(void); #define ruby_verbose (*rb_ruby_verbose_ptr()) #define ruby_debug (*rb_ruby_debug_ptr()) +/* for rb_readwrite_sys_fail first argument */ +enum rb_io_wait_readwrite {RB_IO_WAIT_READABLE, RB_IO_WAIT_WRITABLE}; +#define RB_IO_WAIT_READABLE RB_IO_WAIT_READABLE +#define RB_IO_WAIT_WRITABLE RB_IO_WAIT_WRITABLE + PRINTF_ARGS(NORETURN(void rb_raise(VALUE, const char*, ...)), 2, 3); PRINTF_ARGS(NORETURN(void rb_fatal(const char*, ...)), 1, 2); PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2); @@ -1781,7 +1786,7 @@ NORETURN(void rb_sys_fail(const char*)); NORETURN(void rb_sys_fail_str(VALUE)); NORETURN(void rb_mod_sys_fail(VALUE, const char*)); NORETURN(void rb_mod_sys_fail_str(VALUE, VALUE)); -NORETURN(void rb_readwrite_sys_fail(int, const char*)); +NORETURN(void rb_readwrite_sys_fail(enum rb_io_wait_readwrite, const char*)); NORETURN(void rb_iter_break(void)); NORETURN(void rb_iter_break_value(VALUE)); NORETURN(void rb_exit(int)); @@ -1792,6 +1797,7 @@ NORETURN(void rb_syserr_fail(int, const char*)); NORETURN(void rb_syserr_fail_str(int, VALUE)); NORETURN(void rb_mod_syserr_fail(VALUE, int, const char*)); NORETURN(void rb_mod_syserr_fail_str(VALUE, int, VALUE)); +NORETURN(void rb_readwrite_syserr_fail(enum rb_io_wait_readwrite, int, const char*)); /* reports if `-W' specified */ PRINTF_ARGS(void rb_warning(const char*, ...), 1, 2); @@ -1801,10 +1807,6 @@ PRINTF_ARGS(void rb_sys_warning(const char*, ...), 1, 2); PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2); PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4); -/* for rb_readwrite_sys_fail first argument */ -#define RB_IO_WAIT_READABLE 0 -#define RB_IO_WAIT_WRITABLE 1 - #define RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG 1 #define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg) \ VALUE yielded_arg, VALUE callback_arg, int argc, const VALUE *argv, VALUE blockarg -- cgit v1.2.3