proc-wait3 1.8.1 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/{CHANGES.rdoc → CHANGES.md} +33 -23
- data/Gemfile +2 -0
- data/{MANIFEST.rdoc → MANIFEST.md} +5 -4
- data/{README.rdoc → README.md} +28 -22
- data/Rakefile +16 -16
- data/doc/wait3.md +225 -0
- data/examples/example_pause.rb +1 -1
- data/ext/extconf.rb +2 -15
- data/ext/proc/wait3.c +46 -39
- data/proc-wait3.gemspec +10 -12
- data/spec/proc_wait3_spec.rb +242 -0
- data.tar.gz.sig +0 -0
- metadata +27 -36
- metadata.gz.sig +0 -0
- data/doc/wait3.txt +0 -192
- data/test/test_proc_wait3.rb +0 -227
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2054430d4049b9aa27f1902f704220818bf4e6b8d7d19e428e10e3ed736d6c9
|
4
|
+
data.tar.gz: 9be23be7ddad009649f5ec83692102b05334a9013d99a68f1643c1c2eda37b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f95da3b81622fd0a4ca7be57f787ec63201be854f28bcb023aec9af3360ef8ec6af228ca3c180dfa7163831456aa57fd68ced837cb40d46f3b262e2a2b4554
|
7
|
+
data.tar.gz: fff3abd919e4c0f07ab666ea3f3a1db8d514fa63802fd408b57c87f0c8208d6cf4e886813605156625bc00e8b931405098e5a714d34a91a00830287974603507
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/{CHANGES.rdoc → CHANGES.md}
RENAMED
@@ -1,8 +1,18 @@
|
|
1
|
-
|
1
|
+
## 1.9.1 - 8-Feb-2024
|
2
|
+
* Replace sigset with sigaction in the pause method.
|
3
|
+
* General cleanup and platform handling updates.
|
4
|
+
|
5
|
+
## 1.9.0 - 7-Jan-2021
|
6
|
+
* Switched from test-unit to rspec.
|
7
|
+
* Skip some tests on Darwin because of EINTR errors.
|
8
|
+
* Switched from rdoc to markdown since github isn't rendering rdoc properly.
|
9
|
+
* Added a Gemfile.
|
10
|
+
|
11
|
+
## 1.8.1 - 8-Apr-2020
|
2
12
|
* Added a LICENSE file to the distribution as required by the Apache-2.0 license.
|
3
13
|
* Add an explicit .rdoc extension to the README, CHANGES and MANIFEST files.
|
4
14
|
|
5
|
-
|
15
|
+
## 1.8.0 - 20-Feb-2019
|
6
16
|
* Changed license to Apache-2.0.
|
7
17
|
* Now requires Ruby 2.2 or later.
|
8
18
|
* Now checks for <bsd/string.h> header and include's it if found. This was
|
@@ -13,21 +23,21 @@
|
|
13
23
|
* Removed some old macro checks/definitions that were no longer relevant.
|
14
24
|
* Added a proc-wait3.rb file for convenience.
|
15
25
|
|
16
|
-
|
26
|
+
## 1.7.3 - 21-Nov-2015
|
17
27
|
* Fixed a bug where tv_usec was divided by 1k instead of 1e6. Thanks go to
|
18
28
|
Jason Gladish for the spot.
|
19
29
|
* This gem is now signed.
|
20
30
|
* The gem related tasks in the Rakefile now assume Rubygems 2.x.
|
21
31
|
|
22
|
-
|
32
|
+
## 1.7.2 - 5-Sep-2014
|
23
33
|
* Added support for the RUSAGE_THREAD constant on Linux. Thanks go to
|
24
34
|
Bruno Michel for the patch.
|
25
35
|
|
26
|
-
|
36
|
+
## 1.7.1 - 24-Apr-2014
|
27
37
|
* Explicitly check for and include sys/resource.h because Debian. Thanks
|
28
38
|
go to Christos Trochalakis for the spot.
|
29
39
|
|
30
|
-
|
40
|
+
## 1.7.0 - 6-Apr-2014
|
31
41
|
* The wait3 and wait4 methods no longer set $? to a custom struct. The builtin
|
32
42
|
variable is still set, but if you need the custom Struct::ProcStat information
|
33
43
|
then use the $last_status global instead, or just use the return value. This
|
@@ -36,12 +46,12 @@
|
|
36
46
|
* Some build warning fixes for BSD platforms.
|
37
47
|
* Some test updates for BSD and Solaris.
|
38
48
|
|
39
|
-
|
49
|
+
## 1.6.0 - 28-Aug-2011
|
40
50
|
* Removed the getrlimit and setrlimit methods. Ruby has supported these methods
|
41
51
|
since Ruby 1.8.5, so I think it's time to finally dump them.
|
42
52
|
* Fixed two build warnings regarding unused variables and one 32/64 cast warning.
|
43
53
|
|
44
|
-
|
54
|
+
## 1.5.6 - 7-Jan-2010
|
45
55
|
* Checks are now made for the si_fd, si_utime, si_status and si_stime siginfo_t
|
46
56
|
struct members. This addresses build failures on OS X 10.5 and later where
|
47
57
|
those struct members went mysteriously MIA.
|
@@ -51,7 +61,7 @@
|
|
51
61
|
* Updates to the README.
|
52
62
|
* Source code moved to github.
|
53
63
|
|
54
|
-
|
64
|
+
## 1.5.5 - 8-Aug-2009
|
55
65
|
* Now compatible with Ruby 1.9.x.
|
56
66
|
* License changed to Artistic 2.0.
|
57
67
|
* Added test-unit 2.x as a development dependency.
|
@@ -62,7 +72,7 @@
|
|
62
72
|
* Example files renamed to avoid any confusion with actual test files.
|
63
73
|
* Several Rake tasks added to run individual example programs.
|
64
74
|
|
65
|
-
|
75
|
+
## 1.5.4 - 7-Feb-2008
|
66
76
|
* ALERT! ALERT! Now auto-patches your mkmf.rb file to add the 'have_const'
|
67
77
|
method if it's not already found. This is necessary to determine if certain
|
68
78
|
enum values exist on your system. Your original mkmf.rb is backed up first
|
@@ -73,7 +83,7 @@
|
|
73
83
|
* Fixed the extconf.rb file so that it sets the target directory properly.
|
74
84
|
* No source code changes (except for comment updates and a version bump).
|
75
85
|
|
76
|
-
|
86
|
+
## 1.5.3 - 25-Oct-2006
|
77
87
|
* Because not all platforms support automatically converting signal names
|
78
88
|
into their equivalent numbers, the Process.pause method now accepts names
|
79
89
|
or numbers. It will raise an ArgumentError if you try to use a signal name
|
@@ -86,7 +96,7 @@
|
|
86
96
|
* Internal fixes for platforms that don't support the strlcpy() function.
|
87
97
|
* Minor update for the test_pause.rb example program.
|
88
98
|
|
89
|
-
|
99
|
+
## 1.5.2 - 24-Jul-2006
|
90
100
|
* Fixed the way I was handling whether or not Ruby already defined the various
|
91
101
|
RLIMIT constants within wait3.c.
|
92
102
|
* Fixed the way in which certain RLIM constants were being converted. I
|
@@ -95,7 +105,7 @@
|
|
95
105
|
* Added the WAIT3_VERSION constant.
|
96
106
|
* The getrlimit and setrlimit tests are now skipped for Ruby 1.8.5 or later.
|
97
107
|
|
98
|
-
|
108
|
+
## 1.5.1 - 13-Jul-2006
|
99
109
|
* Fixed bugs with improper values being set for some of the rlimit constants.
|
100
110
|
* Cleaned up a few warnings related to signed-ness for the RLIM_xxx constants.
|
101
111
|
* Now only sets the various rlimit constants if they're not already defined
|
@@ -103,21 +113,21 @@
|
|
103
113
|
* Some internal cleanup.
|
104
114
|
* Created a gemspec and added a gem to RubyForge.
|
105
115
|
|
106
|
-
|
116
|
+
## 1.5.0 - 12-Jun-2006
|
107
117
|
* Removed the '?' character from the various struct members, since Ruby
|
108
118
|
no longer (properly) handles them.
|
109
119
|
* Fixed a 64 bit bug related to rb_struct_define.
|
110
120
|
* Added some more tests.
|
111
121
|
|
112
|
-
|
122
|
+
## 1.4.3 - 28-Jun-2005
|
113
123
|
* Added more #ifdef checks for some of the process flags which, it turns
|
114
124
|
out, are not defined in earlier versions of Linux.
|
115
125
|
|
116
|
-
|
126
|
+
## 1.4.2 - 14-Jun-2005
|
117
127
|
* Fixed a syntax error that could cause the build to fail.
|
118
128
|
* Removed some (but not all) possible warnings from gcc -Wall.
|
119
129
|
|
120
|
-
|
130
|
+
## 1.4.1 - 13-Jun-2005
|
121
131
|
* Added support for the Linux 2.6.9+ kernel (by adding more preprocessor
|
122
132
|
constant checks, which may help with other platforms as well).
|
123
133
|
* Moved project to RubyForge.
|
@@ -125,34 +135,34 @@
|
|
125
135
|
* Removed the wait3.rd file.
|
126
136
|
* Minor fix for the test_waitid.rb sample program.
|
127
137
|
|
128
|
-
|
138
|
+
## 1.4.0 - 16-Feb-2005
|
129
139
|
* Added the getrusage method.
|
130
140
|
* Added test cases and documentation for getrusage.
|
131
141
|
* Renamed a couple test files in the examples directory.
|
132
142
|
|
133
|
-
|
143
|
+
## 1.3.0 - 14-Feb-2005
|
134
144
|
* Added the pause and sigsend methods.
|
135
145
|
* I had to modify the process type constants to include the "P_", because
|
136
146
|
Ruby already has Process::GID and Process::UID defined. That makes this
|
137
147
|
release incompatible with previous versions.
|
138
148
|
* Updated tests and documentation.
|
139
149
|
|
140
|
-
|
150
|
+
## 1.2.0 - 7-Feb-2005
|
141
151
|
* Added the Proc.waitid method (for those platforms that support it).
|
142
152
|
* Made the wait3.c file more rdoc friendly.
|
143
153
|
* Added a test_waitid.rb file in the examples directory.
|
144
154
|
|
145
|
-
|
155
|
+
## 1.1.1 - 10-Jan-2005
|
146
156
|
* Eliminated some (harmless) warnings that cropped up in 1.8.2
|
147
157
|
* Moved the "examples" directory to the toplevel directory.
|
148
158
|
* Made docs slightly more rdoc friendly
|
149
159
|
|
150
|
-
|
160
|
+
## 1.1.0 - 14-Sep-2004
|
151
161
|
* Modified setup and source to handle the possibility that wait3() might
|
152
162
|
be defined while wait4() is not (e.g. HPUX).
|
153
163
|
* Modified the test scripts in the examples directory to play nice on HPUX
|
154
164
|
and Darwin.
|
155
165
|
* Added this file (oops).
|
156
166
|
|
157
|
-
|
167
|
+
## 1.0.0 - 13-Sep-2004
|
158
168
|
- Initial release
|
data/Gemfile
ADDED
@@ -1,11 +1,12 @@
|
|
1
|
-
* CHANGES.
|
1
|
+
* CHANGES.md
|
2
|
+
* Gemfile
|
2
3
|
* LICENSE
|
3
|
-
* MANIFEST.
|
4
|
+
* MANIFEST.md
|
4
5
|
* Rakefile
|
5
|
-
* README.
|
6
|
+
* README.md
|
6
7
|
* proc-wait3.gemspec
|
7
8
|
* certs/djberg96_pub.pem
|
8
|
-
* doc/wait3.
|
9
|
+
* doc/wait3.md
|
9
10
|
* ext/extconf.rb
|
10
11
|
* ext/proc/wait3.c
|
11
12
|
* examples/example_getrusage.rb
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,28 +1,32 @@
|
|
1
|
-
|
1
|
+
[![Ruby](https://github.com/djberg96/proc-wait3/actions/workflows/ruby.yml/badge.svg)](https://github.com/djberg96/proc-wait3/actions/workflows/ruby.yml)
|
2
|
+
|
3
|
+
## Description
|
2
4
|
Adds the wait3, wait4, waitid, pause, sigsend, and getrusage methods to the Process module.
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
## Installation
|
7
|
+
`gem install proc-wait3`
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
## Synopsis
|
10
|
+
```ruby
|
11
|
+
require 'proc/wait3'
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
pid = fork{
|
14
|
+
sleep 1
|
15
|
+
exit 2
|
16
|
+
}
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
puts Time.now.to_s
|
19
|
+
Process.wait3
|
20
|
+
puts $?.exitstatus # => 2
|
21
|
+
```
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
## Tested Platforms
|
24
|
+
* Solaris
|
25
|
+
* Linux
|
26
|
+
* FreeBSD
|
27
|
+
* OS X
|
24
28
|
|
25
|
-
|
29
|
+
## Warnings
|
26
30
|
Linux users who compile with gcc -Wall will notice a few warnings. These
|
27
31
|
are harmless (and unavoidable atm).
|
28
32
|
|
@@ -30,8 +34,11 @@ Linux users may also notice warnings about implicit declarations. These
|
|
30
34
|
are also harmless, and can be silenced by installing the libbsd-dev package
|
31
35
|
first.
|
32
36
|
|
33
|
-
|
37
|
+
These methods may fail in conjunction with `fork` with `Errno::EINTR` unless
|
38
|
+
you pass the WNOHANG flag, or explicitly ignore the `SIGCHLD` signal. Ruby's
|
39
|
+
own `wait` methods appear to essentially be doing that behind the scenes.
|
34
40
|
|
41
|
+
## Integration with Ruby's process.c
|
35
42
|
I considered simply providing a patch to the core process.c file, but I
|
36
43
|
decided against it for two reasons. First, I wanted to get something
|
37
44
|
out more quickly rather than waiting for approval from the core developers
|
@@ -44,6 +51,5 @@ The overloaded methods are also overkill, and do nothing but save me the
|
|
44
51
|
trouble of typing the word "status", since all they're for is comparing or
|
45
52
|
operating on the status attribute.
|
46
53
|
|
47
|
-
|
48
|
-
|
49
|
-
Please see the doc/wait3.txt file for detailed documentation.
|
54
|
+
## Additional Documentation
|
55
|
+
Please see the doc/wait3.md file for detailed documentation.
|
data/Rakefile
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/clean'
|
3
|
-
require '
|
3
|
+
require 'rspec/core/rake_task'
|
4
4
|
require 'fileutils'
|
5
5
|
require 'rbconfig'
|
6
6
|
include RbConfig
|
7
7
|
|
8
8
|
CLEAN.include(
|
9
|
-
'**/*.gem',
|
10
|
-
'**/*.rbc',
|
11
|
-
'**/*.o',
|
12
|
-
'**/*.log',
|
13
|
-
'**/Makefile',
|
14
|
-
'**/conftest.dSYM',
|
15
|
-
"**/*.#{CONFIG['DLEXT']}" # C shared object
|
9
|
+
'**/*.gem', # Gem files
|
10
|
+
'**/*.rbc', # Rubinius
|
11
|
+
'**/*.o', # C object file
|
12
|
+
'**/*.log', # Ruby extension build log
|
13
|
+
'**/Makefile', # C Makefile
|
14
|
+
'**/conftest.dSYM', # OS X build directory
|
15
|
+
"**/*.#{CONFIG['DLEXT']}", # C shared object
|
16
|
+
'**/*.lock' # Bundler
|
16
17
|
)
|
17
18
|
|
19
|
+
|
18
20
|
desc "Build the source (but don't install it)"
|
19
21
|
task :build => [:clean] do |t|
|
20
22
|
Dir.chdir('ext') do
|
@@ -28,9 +30,9 @@ namespace :gem do
|
|
28
30
|
desc "Create the proc-wait3 gem"
|
29
31
|
task :create => [:clean] do
|
30
32
|
require 'rubygems/package'
|
31
|
-
spec =
|
33
|
+
spec = Gem::Specification.load('proc-wait3.gemspec')
|
32
34
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
33
|
-
Gem::Package.build(spec
|
35
|
+
Gem::Package.build(spec)
|
34
36
|
end
|
35
37
|
|
36
38
|
desc "Install the proc-wait3 gem"
|
@@ -67,11 +69,9 @@ namespace :example do
|
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
-
t.
|
73
|
-
t.warning = true
|
74
|
-
t.verbose = true
|
72
|
+
desc "Run the test suite"
|
73
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
74
|
+
t.rspec_opts = '-Iext'
|
75
75
|
end
|
76
76
|
|
77
|
-
task :default => :
|
77
|
+
task :default => [:build, :spec]
|
data/doc/wait3.md
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
## Description
|
2
|
+
Adds the `wait3`, `wait4`, `waitid`, `pause`, `sigsend`, and `getrusage`
|
3
|
+
methods to the Process module.
|
4
|
+
|
5
|
+
## Synopsis
|
6
|
+
```ruby
|
7
|
+
require 'proc/wait3'
|
8
|
+
|
9
|
+
pid = fork{ sleep 1; exit 2 }
|
10
|
+
p Time.now
|
11
|
+
Process.wait3
|
12
|
+
p $?
|
13
|
+
```
|
14
|
+
|
15
|
+
## Module Methods
|
16
|
+
### `Process.pause(signals=nil)`
|
17
|
+
|
18
|
+
Pauses the current process. If the process receives any of the signals
|
19
|
+
you pass as arguments it will return from the pause and continue with
|
20
|
+
the execution of your code. Otherwise, it will exit.
|
21
|
+
|
22
|
+
Note that you must leave out the 'SIG' prefix for the signal name, e.g.
|
23
|
+
use 'INT', not 'SIGINT'.
|
24
|
+
|
25
|
+
Returns the result of the underlying `pause()` function, which should always be -1.
|
26
|
+
|
27
|
+
### `Process.sigsend(idtype, id, signal=0)`
|
28
|
+
|
29
|
+
Sends a signal of type "idtype" to a process or process group "id". This
|
30
|
+
is more versatile method of sending signals to processes than Process.kill.
|
31
|
+
|
32
|
+
For a list of valid idtype values, see the "Process type constants" below.
|
33
|
+
Not supported on all platforms.
|
34
|
+
|
35
|
+
### `Proc.wait3(flags=0)`
|
36
|
+
|
37
|
+
Delays its caller until a signal is received or one of its child processes
|
38
|
+
terminates or stops due to tracing.
|
39
|
+
|
40
|
+
The return value is a ProcStat structure and sets the `$last_status` global
|
41
|
+
variable. The special global $? is also set. Raises a SystemError if there
|
42
|
+
are no child processes.
|
43
|
+
|
44
|
+
### `Proc.wait4(pid, flags=0)`
|
45
|
+
|
46
|
+
Waits for the given child process to exit. Returns a ProcStat structure.
|
47
|
+
The `$last_status` global variable is set. Also sets the `$?` special global
|
48
|
+
variable.
|
49
|
+
|
50
|
+
### `Proc.waitid(id_type, id_num=nil, options=nil)`
|
51
|
+
|
52
|
+
Suspends the calling process until one of its children changes state,
|
53
|
+
returning immediately if a child process changed state prior to the call.
|
54
|
+
The state of a child process will change if it terminates, stops because
|
55
|
+
of a signal, becomes trapped or reaches a breakpoint.
|
56
|
+
|
57
|
+
The `id_num` corresponds to a process ID or process group ID, depending on
|
58
|
+
the value of `id_type`, which may be `Process::P_PID`, `Process::P_PGID` or
|
59
|
+
`Process::P_ALL`. If `id_type` is `Process::P_ALL`, then the `id_num` is ignored.
|
60
|
+
|
61
|
+
The options argument is used to specify which state changes are to be
|
62
|
+
waited for. It is constructed from the bitwise-OR of one or more of the
|
63
|
+
following constants:
|
64
|
+
|
65
|
+
* Process::WCONTINUED
|
66
|
+
* Process::WEXITED
|
67
|
+
* Process::WNOHANG
|
68
|
+
* Process::WNOWAIT
|
69
|
+
* Process::WSTOPPED
|
70
|
+
* Process::WTRAPPED (not supported on all platforms)
|
71
|
+
|
72
|
+
If `Process::WNOHANG` is set as an option, this method will return
|
73
|
+
immediately, whether or not a child has changed state.
|
74
|
+
|
75
|
+
Calling this method with an `id_type` of `Process::P_ALL` and the options set
|
76
|
+
to `Process::EXITED | Process::WTRAPPED` is equivalent to calling
|
77
|
+
Process.wait.
|
78
|
+
|
79
|
+
Returns a `Proc::SigInfo` struct and sets `$?`.
|
80
|
+
|
81
|
+
Not supported on all platforms.
|
82
|
+
|
83
|
+
## Standard Constants
|
84
|
+
`Process::WAIT3_VERSION`
|
85
|
+
|
86
|
+
Returns the version of this package as a string.
|
87
|
+
|
88
|
+
## Process type constants - all platforms
|
89
|
+
`Process::P_ALL`
|
90
|
+
|
91
|
+
All non-system process.
|
92
|
+
|
93
|
+
`Process::P_PID`
|
94
|
+
|
95
|
+
A standard process id.
|
96
|
+
|
97
|
+
`Process::P_PGID`
|
98
|
+
|
99
|
+
Any non-system process group id.
|
100
|
+
|
101
|
+
## Process type constants - not all platforms supported
|
102
|
+
`Process::P_CID`
|
103
|
+
|
104
|
+
A scheduler process id.
|
105
|
+
|
106
|
+
`Process::P_GID`
|
107
|
+
|
108
|
+
Any non-system effective process group id.
|
109
|
+
|
110
|
+
`Process::P_PROJID`
|
111
|
+
|
112
|
+
A project process id. Solaris 8 or later only.
|
113
|
+
|
114
|
+
`Process::P_SID`
|
115
|
+
|
116
|
+
A session process id.
|
117
|
+
|
118
|
+
`Process::P_TASKID`
|
119
|
+
|
120
|
+
A task process id. Solaris 8 or later only.
|
121
|
+
|
122
|
+
`Process::P_UID`
|
123
|
+
|
124
|
+
Any non-system effective process user id.
|
125
|
+
|
126
|
+
## Additional Process constants - defined if waitid is defined on your system
|
127
|
+
`Process::WCONTINUED`
|
128
|
+
|
129
|
+
Return the status for any child that was stopped and has been continued.
|
130
|
+
|
131
|
+
`Process::WEXITED`
|
132
|
+
|
133
|
+
Wait for process(es) to exit.
|
134
|
+
|
135
|
+
`Process::WNOWAIT`
|
136
|
+
|
137
|
+
Keep the process in a waitable state.
|
138
|
+
|
139
|
+
`Process::WSTOPPED`
|
140
|
+
|
141
|
+
Wait for and return the process status of any child that has stopped upon
|
142
|
+
receipt of a signal.
|
143
|
+
|
144
|
+
`Process::WTRAPPED`
|
145
|
+
|
146
|
+
Wait for traced process(es) to become trapped or reach a breakpoint.
|
147
|
+
|
148
|
+
Not supported on all platforms.
|
149
|
+
|
150
|
+
## RLIMIT constants
|
151
|
+
`Process::RLIMIT_AS`
|
152
|
+
|
153
|
+
A synonym for `RLIMIT_VMEM`.
|
154
|
+
|
155
|
+
`Process::RLIMIT_CORE`
|
156
|
+
|
157
|
+
The maximum size of a core file, in bytes, that may be created.
|
158
|
+
|
159
|
+
`Process::RLIMIT_CPU`
|
160
|
+
|
161
|
+
The maximum amount of CPU time, in seconds, the process is allowed to use.
|
162
|
+
|
163
|
+
`Process::RLIMIT_DATA`
|
164
|
+
|
165
|
+
The maximum size of the process' heap size, in bytes.
|
166
|
+
|
167
|
+
`Process::RLIMIT_FSIZE`
|
168
|
+
|
169
|
+
The maximum size of a file, in bytes, that the process may create.
|
170
|
+
|
171
|
+
`Process::RLIMIT_NOFILE`
|
172
|
+
|
173
|
+
The maximum value that the kernel may assign to a file descriptor,
|
174
|
+
effectively limiting the number of open files for the calling process.
|
175
|
+
|
176
|
+
`Process::RLIMIT_STACK`
|
177
|
+
|
178
|
+
The maximum size of the process' stack in bytes.
|
179
|
+
|
180
|
+
`Process::RLIMIT_VMEM`
|
181
|
+
|
182
|
+
The maximum size of the process' mapped address space.
|
183
|
+
|
184
|
+
`Process::RLIM_INFINITY`
|
185
|
+
|
186
|
+
A infinite limit.
|
187
|
+
|
188
|
+
`Process::RLIM_SAVED_CUR`
|
189
|
+
|
190
|
+
Current soft limit.
|
191
|
+
|
192
|
+
`Process::RLIM_SAVED_MAX`
|
193
|
+
|
194
|
+
Current hard limit.
|
195
|
+
|
196
|
+
## Notes
|
197
|
+
The `wait3` and `wait4` methods are similar to the `wait2` and `waitpid2`
|
198
|
+
methods, except that they return much more information via the rusage
|
199
|
+
struct.
|
200
|
+
|
201
|
+
## Future Plans
|
202
|
+
Wrap the wait6 function, and add better BSD support in general.
|
203
|
+
|
204
|
+
## Known Bugs
|
205
|
+
None that I'm aware of. Please log any bugs on the Github project
|
206
|
+
page at https://github.com/djberg96/proc-wait3.
|
207
|
+
|
208
|
+
## License
|
209
|
+
Apache-2.0
|
210
|
+
|
211
|
+
## Copyright
|
212
|
+
(C) 2003-2024 Daniel J. Berger
|
213
|
+
|
214
|
+
All Rights Reserved.
|
215
|
+
|
216
|
+
## Warranty
|
217
|
+
This package is provided "as is" and without any express or
|
218
|
+
implied warranties, including, without limitation, the implied
|
219
|
+
warranties of merchantability and fitness for a particular purpose.
|
220
|
+
|
221
|
+
## Author
|
222
|
+
Daniel J. Berger
|
223
|
+
|
224
|
+
## See also
|
225
|
+
wait3, wait4, waitid, pause, sigsend
|
data/examples/example_pause.rb
CHANGED
data/ext/extconf.rb
CHANGED
@@ -7,7 +7,7 @@ require 'mkmf'
|
|
7
7
|
dir_config('proc-wait3')
|
8
8
|
|
9
9
|
have_header('wait.h')
|
10
|
-
have_header('sys/resource.h')
|
10
|
+
have_header('sys/resource.h') # apt install libbsd-dev
|
11
11
|
have_header('sys/wait.h')
|
12
12
|
|
13
13
|
# wait3 is mandatory.
|
@@ -53,20 +53,7 @@ have_struct_member('struct siginfo', 'si_stime', 'signal.h')
|
|
53
53
|
|
54
54
|
have_const('P_CID', 'signal.h')
|
55
55
|
have_const('P_GID', 'signal.h')
|
56
|
-
have_const('P_MYID', 'signal.
|
57
|
-
layout(
|
58
|
-
:pw_name, :string,
|
59
|
-
:pw_passwd, :string,
|
60
|
-
:pw_uid, :uint,
|
61
|
-
:pw_gid, :uint,
|
62
|
-
:pw_change, :ulong,
|
63
|
-
:pw_class, :string,
|
64
|
-
:pw_gecos, :string,
|
65
|
-
:pw_dir, :string,
|
66
|
-
:pw_shell, :string,
|
67
|
-
:pw_expire, :ulong
|
68
|
-
)
|
69
|
-
end')
|
56
|
+
have_const('P_MYID', 'signal.h')
|
70
57
|
have_const('P_SID', 'signal.h')
|
71
58
|
have_const('P_UID', 'signal.h')
|
72
59
|
|