aboutsummaryrefslogtreecommitdiffstats
path: root/ext/pty
Commit message (Collapse)AuthorAgeFilesLines
* Hide the usage of `rb_io_t` where possible. (#7880)Samuel Williams2023-06-011-31/+23
| | | This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
* Revert "Hide most of the implementation of `struct rb_io`. (#6511)"NARUSE, Yui2023-06-011-23/+31
| | | | | | | | | This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
* Hide most of the implementation of `struct rb_io`. (#6511)Samuel Williams2023-05-301-31/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add rb_io_path and rb_io_open_descriptor. * Use rb_io_open_descriptor to create PTY objects * Rename FMODE_PREP -> FMODE_EXTERNAL and expose it FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but FMODE_EXTERNAL is clearer about what the file descriptor represents and aligns with language in the IO::Buffer module. * Ensure that rb_io_open_descriptor closes the FD if it fails If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be responsible for closing your file, eventually, if you pass it to rb_io_open_descriptor, even if it raises an exception. * Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P * Expose `rb_io_closed_p`. * Add `rb_io_mode` to get IO mode. --------- Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
* Update the depend filesMatt Valentine-House2023-02-281-1/+0
|
* Remove intern/gc.h from Make depsMatt Valentine-House2023-02-271-1/+0
|
* Extract include/ruby/internal/attr/packed_struct.hNobuyoshi Nakada2023-02-081-0/+1
| | | | | | | | | Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the macros bellow: * `RBIMPL_ATTR_PACKED_STRUCT_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_END` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END`
* Transition shape when object's capacity changesJemma Issroff2022-11-101-0/+1
| | | | | | | | | | | | | | | | This commit adds a `capacity` field to shapes, and adds shape transitions whenever an object's capacity changes. Objects which are allocated out of a bigger size pool will also make a transition from the root shape to the shape with the correct capacity for their size pool when they are allocated. This commit will allow us to remove numiv from objects completely, and will also mean we can guarantee that if two objects share shapes, their IVs are in the same positions (an embedded and extended object cannot share shapes). This will enable us to implement ivar sets in YJIT using object shapes. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
* [DOC] RDoc changes for IO (#6458)Burdette Lamar2022-10-021-8/+8
| | | | | | Moves Expect library doc into io.c. Changes certain links to local sections, now pointing to sections in doc/io_streams.rdoc. Removes local sections now superseded by sections in doc/io_streams.rdoc.
* getenv: is in stdlib.h卜部昌平2022-09-211-1/+1
| | | | | | | getenv is a very basic function that has been in stdlib.h since ISO/IEC 9899:1990. There is absolutely zero need for us to redeclare. pty.c already includes stdlib.h out of the box so we need nothing.
* ext/pty/extconf.rb: Try libutil only on OpenBSDYusuke Endoh2022-08-181-2/+4
| | | | | | | | | | | | | | icc now seems to provide libutil.so that is not related to pty. This extconf.rb wrongly finds it and adds `-lutil`, but `ruby -rpty` fails because it cannot find libutil.so on the runtime. http://rubyci.s3.amazonaws.com/icc-x64/ruby-master/log/20220815T210005Z.fail.html.gz ``` Exception raised: <#<LoadError: libutil.so: cannot open shared object file: No such file or directory - /home/chkbuild/chkbuild/tmp/build/20220815T210005Z/ruby/.ext/x86_64-linux/pty.so>> ``` This change makes extconf.rb check libutil only on OpenBSD.
* Expand tabs [ci skip]Takashi Kokubun2022-07-211-67/+67
| | | | [Misc #18891]
* Update PTY.spawn's documentStan Lo2022-04-131-4/+11
| | | | | Passing the optional env hash to PTY.spawn has been supported for years, but it's never documented. More info: https://bugs.ruby-lang.org/issues/12312
* [Feature #18249] Update dependenciesPeter Zhu2022-02-221-0/+1
|
* [Feature #18491] Drop support for HP-UXPeter Zhu2022-01-181-8/+1
| | | | | IA64 support was dropped in ticket #15894, so we can drop support for HP-UX.
* Update dependenciesNobuyoshi Nakada2021-11-211-1/+0
|
* ruby tool/update-deps --fix卜部昌平2021-10-051-14/+23
|
* dependency updates卜部昌平2021-04-131-1/+0
|
* Revert a part of "[DOC] refined" [ci skip]Nobuyoshi Nakada2021-02-081-1/+1
| | | | | | This reverts commit 478716f49a19cdd86f629c6a0673c1ff53630c96 partially -- "Removed unnecessary parentheses" part -- because of a lambda, see 9e25eb308d4fae9a10e120c2b4601916cc38336c.
* [DOC] refinedNobuyoshi Nakada2021-02-071-10/+10
| | | | | | * Adjusted indentation in license section, and used "(c)" * Commented out invalid syntax to enable highlighting * Removed unnecessary parentheses
* [DOC] Fix grammar: "is same as" -> "is the same as"Marcus Stollsteimer2021-01-051-1/+1
|
* sed -i '/rmodule.h/d'卜部昌平2020-08-271-1/+0
|
* sed -i '/r_cast.h/d'卜部昌平2020-08-271-1/+0
|
* sed -i '\,2/extern.h,d'卜部昌平2020-08-271-1/+0
|
* Update PTY.open documentation to document it yields a single argument [ci skip]Jeremy Evans2020-08-241-2/+2
| | | | | | | | | | | | | | | | For a regular block, accepting two arguments is fine as the array will be autosplatted. However, a lambda that accepts two arguments will not work. We could change the implementation to yield two arguments instead of an array with a single argument, but that would be less backwards compatible. I'm only changing the call-seq to be precise, other examples pass a literal block that accepts two arguments, and I left those alone as that will be the most common usage. Fixes [Bug #17094]
* Use https instead of httpKazuhiro NISHIYAMA2020-07-281-1/+1
|
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-140/+140
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-140/+140
| | | | This shall fix compile errors.
* [pty] do not check openpty twice if found in util libraryNobuyoshi Nakada2020-05-011-2/+2
|
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-1/+152
| | | Split ruby.h
* Updated dependencies on internal/warnings.hNobuyoshi Nakada2019-12-311-0/+1
| | | | | Needed for `UNALIGNED_MEMBER_ACCESS` using `COMPILER_WARNING_`* macros.
* update dependencies卜部昌平2019-12-261-0/+8
|
* decouple internal.h headers卜部昌平2019-12-261-23/+35
| | | | | | | | | | | | | | | | | | 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).
* rb_ensure now free from ANYARGS卜部昌平2019-08-271-1/+2
| | | | | | After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is dangerous and should be extinct. This commit deletes ANYARGS from rb_ensure, which also revealed many arity / type mismatches.
* Include ruby/assert.h in ruby/ruby.h so that assertions can be thereNobuyoshi Nakada2019-07-141-0/+1
|
* Fix PTY.open on OpenBSD [Bug #15607]naruse2019-03-061-1/+1
| | | | | | From: Jeremy Evans <code@jeremyevans.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed moving toplevel header since r12501nobu2019-02-081-1/+1
| | | | | | | Moving public headers was 12-years ago, no depend files would expect ruby.h in the top source directory now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [doc] Fix grammar typo in Pty_init() docstring [ci skip]k0kubun2018-11-161-1/+1
| | | | | | | | [Fix GH-2014] From: Olle Jonsson <olle.jonsson@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pty.c: typonobu2018-09-181-1/+1
| | | | | | | * ext/pty/pty.c (chfunc): fix a typo of an operator. pointed out by jaruga (Jun Aruga) at [ruby-core:89058]. [Bug #15116] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pty.c: more difensivenobu2018-09-181-2/+2
| | | | | | | * ext/pty/pty.c (chfunc): should not close the slave fd if it is 0..2. [ruby-core:89043] [Bug #15116] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* UNREACHABLE_RETURNnobu2018-07-241-1/+1
| | | | | | | * include/ruby/ruby.h (UNREACHABLE_RETURN): UNREACHABLE at the end of non-void functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove needless `nacl` checkkazu2018-07-221-1/+1
| | | | | | | | | | `nacl` support already removed by https://github.com/ruby/ruby/pull/1726. [Fix GH-1920] From: yuuji.yaginuma <yuuji.yaginuma@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* unrevert r63852 but keep SIGCHLD path disabled for win32normal2018-07-051-18/+4
| | | | | | | | | | | Reading win32/win32.c waitpid implementation, maybe waitpid(-1, ...) on that platform will never conflict with mjit use of waitpid. In any case, I've added WAITPID_USE_SIGCHLD macro to vm_core.h so it can be easy for Linux/BSD users to test (hopefully!) win32-compatible code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r63758 and related commitsnaruse2018-07-041-4/+18
| | | | | | | The change is unstable on Windows. Please re-commit it when it correctly supports Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hijack SIGCHLD handler for internal usenormal2018-06-271-18/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a global SIGCHLD handler to guard all callers of rb_waitpid. To work safely with multi-threaded programs, we introduce a VM-wide waitpid_lock to be acquired BEFORE fork/vfork spawns the process. This is to be combined with the new ruby_waitpid_locked function used by mjit.c in a non-Ruby thread. Ruby-level SIGCHLD handlers registered with Signal.trap(:CHLD) continues to work as before and there should be no regressions in any existing use cases. Splitting the wait queues for PID > 0 and groups (PID <= 0) ensures we favor PID > 0 callers. The disabling of SIGCHLD in rb_f_system is longer necessary, as we use deferred signal handling and no longer make ANY blocking waitpid syscalls in other threads which could "beat" the waitpid call made by rb_f_system. We prevent SIGCHLD from firing in normal Ruby Threads and only enable it in the timer-thread, to prevent spurious wakeups from in test/-ext-/gvl/test_last_thread.rb with MJIT enabled. I've tried to guard as much of the code for RUBY_SIGCHLD==0 using C "if" statements rather than CPP "#if" so to reduce the likelyhood of portability problems as the compiler will see more code. We also work to suppress false-positives from Process.wait(-1, Process::WNOHANG) to quiets warnings from spec/ruby/core/process/wait2_spec.rb with MJIT enabled. Lastly, we must implement rb_grantpt for ext/pty. We need a MJIT-compatible way of supporting grantpt(3) which may spawn the `pt_chown' binary and call waitpid(2) on it. [ruby-core:87605] [Ruby trunk Bug#14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/pty/pty.c: I_FIND before I_PUSH if possiblengoto2018-05-231-6/+21
| | | | | | | | | | | * ext/pty/pty.c: Check whether each STREAMS module is already pushed or not by using I_FIND ioctl call, before pushing it by using I_PUSH. Solved test failure on Solaris. On a Solaris 10 machine, ioctl I_PUSH "ldterm" twice was the cause of duplicated "\r". [Bug #14786] [ruby-dev:50552] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: add :exception option to Kernel.#systemk0kubun2018-01-241-1/+1
| | | | | | | | to raise error when it fails. [Feature 14386] [GH-1795] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Include ruby/{io,encoding}.h before internal.hkazu2018-01-091-1/+1
| | | | | | because of r61712 and r61713 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Replace `to_a[1..-1]` on a MatchData with `captures`knu2017-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove redundant calls of String#chrknu2017-10-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pty.c: shrink repeated device namesnobu2017-09-271-40/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e