proc-wait3 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +5 -0
- data/README.md +3 -0
- data/doc/wait3.md +1 -1
- data/ext/proc/wait3.c +27 -5
- data/proc-wait3.gemspec +1 -1
- data/spec/proc_wait3_spec.rb +1 -1
- data.tar.gz.sig +2 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9ed8e7bd3a3b5631bbb5e2a4d658c60d1876e8880ebc95eab77f920d81b26be
|
|
4
|
+
data.tar.gz: fa72e2f110aa9a1c4858d7c7a51cc072f115d7de0e63c7f7f0fca0210d26315e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 027c982ad10f5e7a66bdac1e8406df6f99f4372dd739da56b4a5c05bf9115e58bda7e6fbd5b72a3b6e3734ad652928bb3dbc4750a86a70252abc7541b0792613
|
|
7
|
+
data.tar.gz: 0b8289e6c28ce586d9a8f932e31b4e7dd39edfc223061a07d85ff8f8a28daf50329df4933079fcf347c592aaf9d9538ee9de78e448022222294b2a2c2ba5b91e
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 2.1.0 - 18-Jan-2026
|
|
2
|
+
* Modified the wait methods to automatically loop on EINTR for consistent
|
|
3
|
+
cross-platform behavior. Previously you had to do this manually on some
|
|
4
|
+
platforms, e.g. OSX.
|
|
5
|
+
|
|
1
6
|
## 2.0.0 - 10-Jan-2026
|
|
2
7
|
* Added fiber scheduler support for wait3 and wait4 methods, allowing them
|
|
3
8
|
to cooperate with Ruby's fiber scheduler for non-blocking async operations.
|
data/README.md
CHANGED
|
@@ -70,6 +70,9 @@ BSD provides another approach using sigaction handlers + `SA_RESTART`, but it re
|
|
|
70
70
|
the signal type in advance. So, unless you want to apply the same handler to *every* type of
|
|
71
71
|
signal, I don't find it especially useful.
|
|
72
72
|
|
|
73
|
+
Update: As of version 2.1.0 you should no longer have to manually rescue EINTR since it's now
|
|
74
|
+
being handled internally.
|
|
75
|
+
|
|
73
76
|
## Integration with Ruby's process.c
|
|
74
77
|
I considered simply providing a patch to the core process.c file, but I
|
|
75
78
|
decided against it for two reasons. First, I wanted to get something
|
data/doc/wait3.md
CHANGED
data/ext/proc/wait3.c
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#include <ruby/fiber/scheduler.h>
|
|
4
4
|
#include <string.h>
|
|
5
5
|
#include <unistd.h>
|
|
6
|
+
#include <errno.h>
|
|
6
7
|
|
|
7
8
|
/* Debian */
|
|
8
9
|
#ifdef HAVE_SYS_RESOURCE_H
|
|
@@ -281,7 +282,14 @@ static VALUE proc_wait3(int argc, VALUE *argv, VALUE mod){
|
|
|
281
282
|
bzero(&args, sizeof(args));
|
|
282
283
|
args.flags = flags;
|
|
283
284
|
|
|
284
|
-
|
|
285
|
+
/* Retry on EINTR. The RUBY_UBF_PROCESS unblocking function sends a signal
|
|
286
|
+
* to interrupt the blocking call. On macOS (and some other platforms),
|
|
287
|
+
* wait3() is not automatically restarted after being interrupted, so we
|
|
288
|
+
* must retry manually.
|
|
289
|
+
*/
|
|
290
|
+
do {
|
|
291
|
+
rb_thread_call_without_gvl(wait3_without_gvl, &args, RUBY_UBF_PROCESS, NULL);
|
|
292
|
+
} while(args.pid < 0 && errno == EINTR);
|
|
285
293
|
|
|
286
294
|
if(args.pid < 0){
|
|
287
295
|
rb_sys_fail("wait3");
|
|
@@ -383,7 +391,14 @@ static VALUE proc_wait4(int argc, VALUE *argv, VALUE mod){
|
|
|
383
391
|
args.pid = pid;
|
|
384
392
|
args.flags = flags;
|
|
385
393
|
|
|
386
|
-
|
|
394
|
+
/* Retry on EINTR. The RUBY_UBF_PROCESS unblocking function sends a signal
|
|
395
|
+
* to interrupt the blocking call. On macOS (and some other platforms),
|
|
396
|
+
* wait4() is not automatically restarted after being interrupted, so we
|
|
397
|
+
* must retry manually.
|
|
398
|
+
*/
|
|
399
|
+
do {
|
|
400
|
+
rb_thread_call_without_gvl(wait4_without_gvl, &args, RUBY_UBF_PROCESS, NULL);
|
|
401
|
+
} while(args.result < 0 && errno == EINTR);
|
|
387
402
|
|
|
388
403
|
if(args.result < 0){
|
|
389
404
|
rb_sys_fail("wait4");
|
|
@@ -491,7 +506,14 @@ static VALUE proc_waitid(int argc, VALUE* argv, VALUE mod){
|
|
|
491
506
|
args.infop.si_pid = 0;
|
|
492
507
|
#endif
|
|
493
508
|
|
|
494
|
-
|
|
509
|
+
/* Retry on EINTR. The RUBY_UBF_PROCESS unblocking function sends a signal
|
|
510
|
+
* to interrupt the blocking call. On macOS (and some other platforms),
|
|
511
|
+
* waitid() is not automatically restarted after being interrupted, so we
|
|
512
|
+
* must retry manually.
|
|
513
|
+
*/
|
|
514
|
+
do {
|
|
515
|
+
rb_thread_call_without_gvl(waitid_without_gvl, &args, RUBY_UBF_PROCESS, NULL);
|
|
516
|
+
} while(args.result == -1 && errno == EINTR);
|
|
495
517
|
|
|
496
518
|
if(args.result == -1)
|
|
497
519
|
rb_sys_fail("waitid");
|
|
@@ -1144,8 +1166,8 @@ void Init_wait3(void)
|
|
|
1144
1166
|
rb_define_const(rb_mProcess, "RUSAGE_THREAD", INT2FIX(RUSAGE_THREAD));
|
|
1145
1167
|
#endif
|
|
1146
1168
|
|
|
1147
|
-
/* 2.
|
|
1148
|
-
rb_define_const(rb_mProcess, "WAIT3_VERSION", rb_str_freeze(rb_str_new2("2.
|
|
1169
|
+
/* 2.1.0: The version of the proc-wait3 library */
|
|
1170
|
+
rb_define_const(rb_mProcess, "WAIT3_VERSION", rb_str_freeze(rb_str_new2("2.1.0")));
|
|
1149
1171
|
|
|
1150
1172
|
/* Define this last in our Init_wait3 function */
|
|
1151
1173
|
rb_define_readonly_variable("$last_status", &v_last_status);
|
data/proc-wait3.gemspec
CHANGED
data/spec/proc_wait3_spec.rb
CHANGED
data.tar.gz.sig
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
0
|
|
2
|
-
�
|
|
3
|
-
�N�%�����sT��+�9:���El���.jR��W�P+���HŌɳ�y\�y�f�ا4>�C�wr�5ԭ�z�����O�L0X�Vv�Q�����㏅17|����K$�zݵ�3di���*/Q1&��"�R��#�C<Dm�!2ʜ��6�+��h���!�MbG��� ݳ3�
|
|
4
|
-
�?���WLRb� ⦴y<�{������P���i�JwOt����/�7?`S��)�B%$��,�P����5Q%Α-G���ޗ{�cr�
|
|
1
|
+
V�"Ca���M�齭�4�<�١�Q�D���J{����TY�� .[0/$�:�m/�4��?M���<s`N�����:�-D��Rؽ){��j�l�c&$7�d�PQݜV�G��2�m���.��)R��_O�%�;b8?��*�#V�
|
|
2
|
+
�]����}�����9��՞��%�s��B���M�Q%����rj�N@�8=��p%o{<�!8�
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: proc-wait3
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel J. Berger
|
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
148
|
version: '0'
|
|
149
149
|
requirements: []
|
|
150
|
-
rubygems_version:
|
|
150
|
+
rubygems_version: 3.6.9
|
|
151
151
|
specification_version: 4
|
|
152
152
|
summary: Adds wait3, wait4 and other methods to the Process module
|
|
153
153
|
test_files:
|
metadata.gz.sig
CHANGED
|
Binary file
|