aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix error in update-deps due to tab/space differenceJeremy Evans2020-10-281-1/+1
|
* Don't redefine #rb_intern over and over againStefan Stüben2020-10-211-31/+28
|
* Some global variables can be accessed from ractorsKoichi Sasada2020-10-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some global variables should be used from non-main Ractors. [Bug #17268] ```ruby # ractor-local (derived from created ractor): debug '$DEBUG' => $DEBUG, '$-d' => $-d, # ractor-local (derived from created ractor): verbose '$VERBOSE' => $VERBOSE, '$-w' => $-w, '$-W' => $-W, '$-v' => $-v, # process-local (readonly): other commandline parameters '$-p' => $-p, '$-l' => $-l, '$-a' => $-a, # process-local (readonly): getpid '$$' => $$, # thread local: process result '$?' => $?, # scope local: match '$~' => $~.inspect, '$&' => $&, '$`' => $`, '$\'' => $', '$+' => $+, '$1' => $1, # scope local: last line '$_' => $_, # scope local: last backtrace '$@' => $@, '$!' => $!, # ractor local: stdin, out, err '$stdin' => $stdin.inspect, '$stdout' => $stdout.inspect, '$stderr' => $stderr.inspect, ```
* Respect the original styles [ci skip]Nobuyoshi Nakada2020-10-111-1/+2
|
* Prefer to use `prep_io` for temporary IO instances.Samuel Williams2020-09-171-13/+4
|
* Fix handling of FMODE_PREP.Samuel Williams2020-09-151-1/+1
|
* Fix incorrect initialization of `rb_io_t::self`.Samuel Williams2020-09-151-3/+6
|
* Prefer `rb_thread_current_scheduler`.Samuel Williams2020-09-141-4/+22
|
* Add support for hooking `IO#read`.Samuel Williams2020-09-141-0/+6
|
* Standardised scheduler interface.Samuel Williams2020-09-141-5/+76
|
* Simplify bitmasks for IO events.Samuel Williams2020-09-141-3/+3
|
* Check copy_file_range(2) is actually supported.Masaki Matsushita2020-09-121-4/+0
| | | | see also: https://gitlab.com/gitlab-org/gitlab/-/issues/218999#note_363225872
* break around function definition [ci skip]Nobuyoshi Nakada2020-09-051-1/+3
|
* Introduce Ractor mechanism for parallel executionKoichi Sasada2020-09-031-39/+107
| | | | | | | | | | | | | | | | This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues.
* IO.copy_stream: handle EOPNOTSUP instead of ENOTSUPMasaki Matsushita2020-08-291-3/+3
|
* IO.copy_stream: handle ENOTSUP on copy_file_range(2)Masaki Matsushita2020-08-291-0/+5
| | | | | | fallback to other methods on ENOTSUP. some RedHat kernels may return ENOTSUP on an NFS mount. [Feature #16965]
* Fix corruption in ARGF.inplacePeter Zhu2020-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Extension string stored in `ARGF.inplace` is created using an api designed for C string constants to create a Ruby string that points at another Ruby string. When the original string is swept, the extension string gets corrupted. Reproduction script (on MacOS): ```ruby #!/usr/bin/ruby -pi.bak BEGIN { GC.start(full_mark: true) arr = [] 1000000.times do |x| arr << "fooo#{x}" end } puts "hello" ``` Co-Authored-By: Matt Valentine-House <31869+eightbitraptor@users.noreply.github.com>
* Remove trailing spaces [ci skip]Nobuyoshi Nakada2020-07-201-1/+1
|
* Rename `rb_current_thread_scheduler` to `rb_thread_scheduler_if_nonblocking`.Samuel Williams2020-07-201-30/+35
| | | | | Correctly capture thread before releasing GVL and pass as argument to `rb_thread_scheduler_if_nonblocking`.
* add UNREACHABLE_RETURN卜部昌平2020-06-291-0/+2
| | | | | | Not every compilers understand that rb_raise does not return. When a function does not end with a return statement, such compilers can issue warnings. We would better tell them about reachabilities.
* rb_io_modestr_fmode: do not goto into a branch卜部昌平2020-06-291-2/+4
| | | | | I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
* rb_io_each_codepoint: do not goto into a branch卜部昌平2020-06-291-2/+4
| | | | | I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
* Fixed a variable name [Bug #16903]Nobuyoshi Nakada2020-05-211-1/+1
| | | | | | Fix up of 0e3b0fcdba7 From: fd0 (Daisuke Fujimura)
* Thread scheduler for light weight concurrency.Samuel Williams2020-05-141-41/+72
|
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-2/+2
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-2/+2
| | | | This shall fix compile errors.
* Refactored rb_readwrite_syserr_failNobuyoshi Nakada2020-04-171-18/+20
| | | | | | * renamed argument `writable` as `waiting` * hosited out creating and raising exception * turned into a `switch`
* Raise EPIPE at broken pipe for the backward compatibilityNobuyoshi Nakada2020-04-151-6/+11
| | | | | | Instead of SignalException for SIGPIPE, raise `Errno::EPIPE` with instance variable `signo` and re-send that signal at exit. [Feature #14413]
* PAGER without fork&exec too [Feature #16754]Nobuyoshi Nakada2020-04-121-5/+19
|
* Silence broken pipe error messages on STDOUT [Feature #14413]Nobuyoshi Nakada2020-04-111-16/+46
| | | | Raise `SignalException` for SIGPIPE to abort when EPIPE occurs.
* Make `#inspect` interruptible in `Kernel#p`Nobuyoshi Nakada2020-04-101-20/+16
| | | | | Only writing the inspected result and a newline is uninterruptible.
* Constified writev function familyNobuyoshi Nakada2020-04-101-3/+3
|
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-4/+4
| | | Split ruby.h
* Set external encoding correctly for File.open('f', FILE::BINARY) on WindowsJeremy Evans2020-03-271-0/+12
| | | | | | | | | | Previously, the external encoding was only set correctly for File::BINARY if keyword arguments were provided. This copies the logic for the keyword arguments case to the no keyword arguments case. Possibly it should be refactored into a separate function. Fixes [Bug #16737]
* Remove support for passing nil to IO#ungetcJeremy Evans2020-02-271-1/+0
| | | | Fixes [Bug #13675]
* Warn non-nil `$/` [Feature #14240]Nobuyoshi Nakada2020-02-231-2/+2
|
* Warn non-nil `$\` [Feature #14240]Nobuyoshi Nakada2020-02-231-4/+4
|
* Warn non-nil `$,` in `IO#print` tooNobuyoshi Nakada2020-02-231-0/+3
|
* Pass keyword arguments to IOs properly [Bug #16639]Nobuyoshi Nakada2020-02-181-2/+6
|
* Drop executable bit set by 25f2005a638570cce832d218a451072057610f06Nobuyoshi Nakada2020-01-221-0/+0
|
* Also check EWOULDBLOCK as well as EAGAINNobuyoshi Nakada2020-01-211-9/+4
|
* fix load error with EAGAINXia Xionjun2020-01-211-1/+19
| | | | | | | | | | | | | | | This is a fix related to the following issue. rails/rails#33464 Not only in rails apps, some little ruby app with only 2 or 3 ruby files reproduce the problem during many years. When I edit linux ruby files by vs code via samba on windows, and then I execute the ruby files on linux, "require_relative" will sometimes not work properly. My solution is to wait a monument if the required relative file is busy.
* io.c, ruby.c: include internal/variable.h for rb_gvar_readonly_setterYusuke Endoh2020-01-091-0/+1
| | | | | | Same as 053f78e13988e9253d1f207bf5e23d9505112b32. emscripten requires a prototype declaration of rb_gvar_readonly_setter if it is refered as a function pointer.
* Separate builtin initialization callsNobuyoshi Nakada2019-12-291-6/+0
|
* decouple internal.h headers卜部昌平2019-12-261-22/+39
| | | | | | | | | | | | | | | | | | Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
* Refined the warning message for $, and $;Nobuyoshi Nakada2019-12-201-1/+1
| | | | [Bug #16438]
* Added rb_warn_deprecatedNobuyoshi Nakada2019-12-191-8/+8
|
* IO#set_encoding_by_bom should err when encoding is already setNobuyoshi Nakada2019-12-151-0/+4
| | | | Except for ASCII-8BIT. [Bug #16422]
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-8/+0
| | | | | | This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
* Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans2019-11-181-3/+0
| | | | | | | | | | | | | | | | | This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd.