sys-proctable 0.9.9-universal-aix5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +353 -0
- data/MANIFEST +34 -0
- data/README +118 -0
- data/Rakefile +218 -0
- data/benchmarks/bench_ps.rb +21 -0
- data/doc/top.txt +47 -0
- data/examples/example_ps.rb +20 -0
- data/lib/aix/sys/proctable.rb +456 -0
- data/lib/sys-proctable.rb +1 -0
- data/lib/sys/proctable/version.rb +6 -0
- data/lib/sys/top.rb +31 -0
- data/sys-proctable.gemspec +40 -0
- data/test/test_sys_proctable_aix.rb +324 -0
- data/test/test_sys_proctable_all.rb +87 -0
- data/test/test_sys_top.rb +46 -0
- metadata +119 -0
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3f1a7d05879ecfaaaa74ebc0cd4a7b080d07559d
|
4
|
+
data.tar.gz: 6965442e24a4c4641994d7c21cc8af83451fa493
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d7a0ec3bb71919fda3d61f3a4c1708f2e74f5c0d3446aa9a032d1aff80411e5838e80e9a90f8c0e801b67b2d1f946bece56b2dfac7920b9834191a4ac7ec26ae
|
7
|
+
data.tar.gz: a018b2abe6b6cae7f95fe4387ff84977f572ad8476f599e92c28080bb4c71848ef4edd9b253010eda93051532a178031e01abb41b9a0e9ce44e20ff9e964413a
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
Binary file
|
data/CHANGES
ADDED
@@ -0,0 +1,353 @@
|
|
1
|
+
== 0.9.9 - 8-Nov-2015
|
2
|
+
* Added support for cgroups on Linux. Thanks go to Dennis Günnewig for the patch.
|
3
|
+
* Added a sys-proctable.rb file for convenience.
|
4
|
+
* This gem is now signed.
|
5
|
+
* Gem related tasks in the Rakefile now assume Rubygems 2.x.
|
6
|
+
|
7
|
+
== 0.9.8 - 18-Apr-2015
|
8
|
+
* Fixed a bug in the gemspec. Last version got yanked.
|
9
|
+
|
10
|
+
== 0.9.7 - 18-Apr-2015
|
11
|
+
* Fixed a bug in the OSX code that could cause the ps method to fail. Thanks
|
12
|
+
go to Koshevoy Anton for the spot.
|
13
|
+
* Some internal refactoring of version handling. Now all platforms use a
|
14
|
+
single version file.
|
15
|
+
* Replaced vm_size_t and lwpid_t with universal data types on FreeBSD because
|
16
|
+
FFI on FreeBSD 10 no longer understands them. Thanks go to Mike Owens for
|
17
|
+
the spot.
|
18
|
+
|
19
|
+
== 0.9.6 - 24-Feb-2015
|
20
|
+
* Added NLWP field on Linux. Thanks go to Rich Chatterton for the patch.
|
21
|
+
|
22
|
+
== 0.9.5 - 10-Feb-2015
|
23
|
+
* Significant cleanup and memory reduction of the OSX code. Thanks go
|
24
|
+
to Ivan (toy) for the patches.
|
25
|
+
* Skip over /proc/<file>/status if unreadable on Linux. Thanks go to Jianjun
|
26
|
+
Mao for the patch.
|
27
|
+
|
28
|
+
== 0.9.4 - 4-Mar-2014
|
29
|
+
* Added support for AIX 5.3 or later courtesy of Rick Ohnemus.
|
30
|
+
* The Solaris version now uses FFI structs instead of a packed array.
|
31
|
+
It solved issues with 64-bit versions of Ruby and it's self-documenting.
|
32
|
+
* The FreeBSD version has been converted to use FFI. In addition, additional
|
33
|
+
struct members have been added, and members that previously returned nil
|
34
|
+
now return meaningful data.
|
35
|
+
* Support for NetBSD and OpenBSD has been temporarily dropped. Considering
|
36
|
+
that the C code did not build on those platforms anyway, I doubt most of
|
37
|
+
you will notice. Patches for those platforms are welcome, but only using FFI.
|
38
|
+
|
39
|
+
== 0.9.3 - 17-Mar-2013
|
40
|
+
* Fixed a bug on OSX where a long command string arg could cause
|
41
|
+
a segfault. Thanks go to Nathaniel Bibler for the spot.
|
42
|
+
* Changed the gem platform from mingw to mingw32 for Windows.
|
43
|
+
|
44
|
+
== 0.9.2 - 8-Oct-2012
|
45
|
+
* Added cmdline support for OS X. Thanks go to Matthias Zirnstein for
|
46
|
+
the patch.
|
47
|
+
* Warning cleanup for 1.9.
|
48
|
+
* Updated the gem platform handling. Replaced the borked string approach
|
49
|
+
with a two element array for Gem::Platform.new.
|
50
|
+
* MS date strings are now parse with DateTime instead of Date.
|
51
|
+
|
52
|
+
== 0.9.1 - 3-Aug-2011
|
53
|
+
* Added the pctcpu and pctmem members for Linux.
|
54
|
+
* Added Errno::ESRCH to a rescue clause on Linux that fixed a bug
|
55
|
+
where a missing entry wasn't being skipped when run as root. Thanks
|
56
|
+
go to Austin Ziegler for the spot and patch.
|
57
|
+
* Fixed a build warning for Darwin.
|
58
|
+
* Updates to the test suite for both Darwin and Linux.
|
59
|
+
* Added an explicit type check for BSD for pids.
|
60
|
+
* Added nicer error messages for BSD if kvm_open fails.
|
61
|
+
* Added .core files to the clean task.
|
62
|
+
* Altered the platform settings in the Rakefile so that generated gems
|
63
|
+
use 'universal' platform architectures for any particular operating system.
|
64
|
+
|
65
|
+
== 0.9.0 - 14-Oct-2009
|
66
|
+
* Changed the license to Artistic 2.0.
|
67
|
+
* Fixed a bug in the OS X code where a segfault would occur when an attempt
|
68
|
+
was made to gather resource usage information on zombie processes. From
|
69
|
+
now on that information is always set to nil for zombie processes. Thanks
|
70
|
+
go to Tom Lianza for the spot and Philip Kromer for investigating the
|
71
|
+
root cause of the failure.
|
72
|
+
* Removed the FreeBSD code that read out of /proc. It was a pain from a
|
73
|
+
maintenance point of view, and most FreeBSD installs do not mount /proc
|
74
|
+
by default. The FreeBSD platform now uses the same code that the other
|
75
|
+
BSD platforms use.
|
76
|
+
* Fixed a bug in the BSD code where the ProcTable::Error class had the
|
77
|
+
wrong parent class.
|
78
|
+
* Some major gemspec updates, including an updated license. The platform
|
79
|
+
handling logic is now in the Rakefile in the 'gem' task.
|
80
|
+
* Updated the README file to include an additional acknowledgement, a
|
81
|
+
license change and some minor formatting changes.
|
82
|
+
* The test-unit library was changed from a runtime to a development dependency.
|
83
|
+
|
84
|
+
== 0.8.1 - 6-Apr-2009
|
85
|
+
* The Linux and Solaris libraries now handle the possibility of a process
|
86
|
+
terminating in the middle of a read more gracefully. If that happens, they
|
87
|
+
merely skip to the next record, i.e. it's all or nothing. Thanks go to
|
88
|
+
Heejong Lee for the spot and patch.
|
89
|
+
* Fixed a bug in the Linux version where embedded nulls were not being
|
90
|
+
stripped out of the cmdline data.
|
91
|
+
* Added the comm alias back to the Solaris version. Thanks go to Jun Young Kim
|
92
|
+
for the spot.
|
93
|
+
|
94
|
+
== 0.8.0 - 26-Jan-2009
|
95
|
+
* The Linux and Solaris versions of this library are now pure Ruby. Be warned,
|
96
|
+
however, that only Solaris 8 and later are now supported. This may change
|
97
|
+
in a future release if there's demand to support 2.6 and 2.7.
|
98
|
+
* Some Struct::ProcTableStruct members have changed. As a general rule they
|
99
|
+
now more closely match the C struct member name. See individual platforms
|
100
|
+
for more details.
|
101
|
+
* Bug fix for the cmd_args struct member on Solaris.
|
102
|
+
* Bug fixes for OS X. Added a VERSION constant, fixed struct name, and changed
|
103
|
+
pct_cpu to pctcpu.
|
104
|
+
* The .new method is now explicitly illegal.
|
105
|
+
* The Struct::ProcTableStruct instances are now frozen. This is read-only data.
|
106
|
+
* Added the peak_page_file_usage and status members on MS Windows. The status
|
107
|
+
member is always nil, but was added for completeness.
|
108
|
+
* Fixed the quota_peak_paged_pool_usage member on MS Windows.
|
109
|
+
* ProcTableError is now ProcTable::Error.
|
110
|
+
* Minor test case fix for kvm/bsd based versions.
|
111
|
+
* Added the 'time' library as a require for Windows (to parse MS date/time
|
112
|
+
format strings).
|
113
|
+
* The kvm (bsd.c) implementation now works for FreeBSD 7.
|
114
|
+
* Added many more tests.
|
115
|
+
* Added some benchmarking code in the 'benchmarks' directory.
|
116
|
+
* Added a 'bench' Rake task.
|
117
|
+
* Renamed the test_ps.rb file to example_ps.rb in order to avoid any possible
|
118
|
+
confusion with actual test files.
|
119
|
+
* Added an 'example' rake task to run the example file.
|
120
|
+
|
121
|
+
== 0.7.6 - 11-Jul-2007
|
122
|
+
* Fixed the starttime for Linux. Thanks go to Yaroslav Dmitriev for the spot.
|
123
|
+
* Fixed a bug in the MS Windows version within a private method that parsed
|
124
|
+
an MS specific date format. This was caused by a backwards incompatible
|
125
|
+
change in the Time.parse method in Ruby 1.8.6. See ruby-core: 11245 ff.
|
126
|
+
* Fixed the gemspec (I hope). Please let me know if you have problems.
|
127
|
+
* Added a Rakefile. Building, testing and installing should now be handled via
|
128
|
+
Rake tasks. The install.rb file has been removed - that code is now
|
129
|
+
integrated in the Rakefile.
|
130
|
+
* Minor directory layout changes and cleanup (mostly for the extconf.rb file).
|
131
|
+
* Side note - it seems that the code for OS X *does* work, at least on 10.4.10.
|
132
|
+
I can only conclude that previous reports about it failing were related to
|
133
|
+
bugs in OS X or were really just build issues. Apologies (and thanks, again)
|
134
|
+
to David Felstead for the code. However, see the README for more information
|
135
|
+
specific to OS X, as there are shortcomings.
|
136
|
+
|
137
|
+
== 0.7.5 - 23-Nov-2006
|
138
|
+
* Fixed int/long issues for Linux. Thanks go to Matt Lightner for the spot.
|
139
|
+
* Minor documentation fixes and changes to the extconf.rb file.
|
140
|
+
|
141
|
+
== 0.7.4 - 20-Nov-2006
|
142
|
+
* Added a patch that deals with the large file compilation issue on Solaris.
|
143
|
+
You no longer need to build Ruby with --disable-largefile, or build a
|
144
|
+
64 bit Ruby, in order for this package to work. Thanks go to Steven Jenkins
|
145
|
+
for the information that led to the patch.
|
146
|
+
* Added inline rdoc to the source code.
|
147
|
+
* Added a gemspec.
|
148
|
+
* Fixed some potential 64 bit issues (struct declarations).
|
149
|
+
* Added preliminary support for Darwin (OS X). The code was provided by
|
150
|
+
David Felstead, but does not appear to compile successfully. Help wanted.
|
151
|
+
|
152
|
+
== 0.7.3 - 27-Oct-2005
|
153
|
+
* Fix for 1.8.3 and later (rb_pid_t). This should have only affected
|
154
|
+
Solaris.
|
155
|
+
|
156
|
+
== 0.7.2 - 15-May-2005
|
157
|
+
* Bug fix for the FreeBSD version that reads from /proc.
|
158
|
+
* Eliminated the test bug on Linux (inexplicably caused by File.copy). The
|
159
|
+
test suite should now run without segfaulting.
|
160
|
+
* Include bsd.c in tarball (oops).
|
161
|
+
* Minor test updates for FreeBSD.
|
162
|
+
* The 'pct_cpu' member for the BSD/kvm version has been changed to 'pctcpu'
|
163
|
+
for consistency with other platforms.
|
164
|
+
|
165
|
+
== 0.7.1 - 8-May-2005
|
166
|
+
* Bug fixed for the cmdline info on Linux. Thanks go to Arash Abedinzadeh
|
167
|
+
for the spot.
|
168
|
+
* Added an example program.
|
169
|
+
* Minor setup fix for Win32 in tc_all.rb.
|
170
|
+
|
171
|
+
== 0.7.0 - 25-Apr-2005
|
172
|
+
* Scrapped the C implementation for Windows in favor of an OLE + WMI pure Ruby
|
173
|
+
approach. See documentation for details.
|
174
|
+
* Added an optional lkvm implementation for BSD users. This is automatically
|
175
|
+
used if the /proc filesystem isn't found.
|
176
|
+
* Added prusage info for the Solaris version.
|
177
|
+
* Added name, eid, euid, gid and guid information for Linux. Thanks go to
|
178
|
+
James Hranicky for the patch.
|
179
|
+
* Fixed some potential bugs in the Linux version. Thanks go to James
|
180
|
+
Hranicky for the spot.
|
181
|
+
* Added the 'sys/top' package.
|
182
|
+
* ProcTable.fields no longer supports a block form.
|
183
|
+
* The BTIME (boot time) information has been removed from the Linux version.
|
184
|
+
If you want that information, use sys-uptime instead.
|
185
|
+
* The .html and .rd files have been removed. You can generate html on your
|
186
|
+
own with rdoc if you like.
|
187
|
+
* Some code cleanup on the C side of the house.
|
188
|
+
* Most documents made rdoc friendly.
|
189
|
+
* Renamed 'install_pure_ruby.rb' to just 'install.rb'.
|
190
|
+
* Removed the 'INSTALL' file. Installation instructions are in the README.
|
191
|
+
* Some test suite cleanup and reorganization.
|
192
|
+
* Moved project to RubyForge.
|
193
|
+
|
194
|
+
== 0.6.4 - 31-Mar-2004
|
195
|
+
* Fixed a bug in the pure Ruby version for Win32. Thanks go to Mark Hudson
|
196
|
+
for the spot.
|
197
|
+
* Fixed a bug in the C implementation for Win32 where the cmdline and path
|
198
|
+
values were sometimes wrong for running processes. Thanks go to Park Heesob
|
199
|
+
for the fix.
|
200
|
+
* Updated the VERSION constant and removed the VERSION class method in the
|
201
|
+
pure Ruby version for Win32.
|
202
|
+
* Updated install_pure_ruby.rb and test.rb scripts.
|
203
|
+
* Updated warranty information.
|
204
|
+
* The extconf.rb script has been revamped. See the INSTALL and README files
|
205
|
+
for important changes since the last release.
|
206
|
+
* The start ProcInfo struct member on Solaris, HP-UX and FreeBSD is now a
|
207
|
+
Time object, not a Fixnum/Bignum.
|
208
|
+
* Modified linux.c yet again to make gcc happy when it comes to multi-line
|
209
|
+
string literals.
|
210
|
+
* Minor change to way process state is handled on HP-UX.
|
211
|
+
* Documentation additions and updates, including warranty information.
|
212
|
+
|
213
|
+
== 0.6.3 - 24-Feb-2004
|
214
|
+
* Fixed a bug in the Solaris version where the cmd_args array did not
|
215
|
+
necessarily contain data on 2.7 and later. The current patch still
|
216
|
+
does not quite fix the problem for 2.6 and earlier but can be easily
|
217
|
+
derived manually by parsing the cmdline string.
|
218
|
+
|
219
|
+
== 0.6.2 - 20-Jan-2004
|
220
|
+
* Fixed a small memory leak in the solaris version.
|
221
|
+
|
222
|
+
== 0.6.1 - 31-Dec-2003
|
223
|
+
* Fixed a minor bug in the cmdline field on Linux where a blank character
|
224
|
+
was being appended to the end of the field.
|
225
|
+
* Fixed a minor annoyance where the windows.rb file was being copied into
|
226
|
+
the Ruby lib directory on install.
|
227
|
+
* Added a test_memleak.rb file. Currently only supported on Linux and
|
228
|
+
only does a file descriptor count check. I plan to expand this to
|
229
|
+
other platforms in the future.
|
230
|
+
* Minor test suite changes
|
231
|
+
* MANIFEST correction and update.
|
232
|
+
|
233
|
+
== 0.6.0 - 22-Oct-2003
|
234
|
+
* Significant API change (and thus, a version jump) - only a
|
235
|
+
single argument is now accepted to the ps() method, and only a PID
|
236
|
+
(Fixnum) is regarded as a valid argument.
|
237
|
+
* Calling ps() with a pid returns a single ProcTable struct (or nil
|
238
|
+
if the pid is not found), instead of a one element array.
|
239
|
+
* Argument to ps() now works properly on HP-UX and Win32.
|
240
|
+
* Removed the '#include <sys/types32.h>' in sunos.h. It wasn't needed
|
241
|
+
and you're not supposed to include it directly.
|
242
|
+
* Fixed 2.6 compatibility issue with regards to cmdline on Solaris.
|
243
|
+
* Removed the ProcStatException completely on Linux. There was no reason
|
244
|
+
to fail on a directory read for /proc/xxx/stat. If the read fails
|
245
|
+
(meaning the process died in the middle of collecting info for it), it
|
246
|
+
is simply ignored.
|
247
|
+
* The ttynum bug on HPUX has been fixed. In addition, the return value for
|
248
|
+
this field is now a string rather than an int and the field name has
|
249
|
+
been changed to "ttydev".
|
250
|
+
* The ttynum field has been changed to ttydev on Solaris and HPUX. On
|
251
|
+
Solaris, the ttydev is now reported as -1 if there is no associated tty.
|
252
|
+
In a future release, Solaris and the other *nix platforms will be changed
|
253
|
+
so that ttydev is always a device name (i.e String).
|
254
|
+
* Added plain text documentation for all platforms.
|
255
|
+
* Some test suite cleanup.
|
256
|
+
* Changed .rd2 extension to just '.rd'.
|
257
|
+
|
258
|
+
== 0.5.2 - 18-Jul-2003
|
259
|
+
* Modified cmdline to extend past the traditional 80 character limit on
|
260
|
+
Solaris, where possible (Solaris 2.6+ only).
|
261
|
+
* Added the cmdline_args and num_args fields on Solaris, which returns
|
262
|
+
an array of cmdline arguments and the number of cmdline arguments,
|
263
|
+
respectively.
|
264
|
+
* Minor modification to fields() method, in addition to warning cleanup
|
265
|
+
for Solaris.
|
266
|
+
* Changed "defunct" state string to "zombie" for Solaris.
|
267
|
+
* Should cleanly compile with -Wall -W now (gcc) on Solaris.
|
268
|
+
* Added solaris.txt to doc directory.
|
269
|
+
* MANIFEST corrections.
|
270
|
+
|
271
|
+
== 0.5.1 - 16-Jul-2003
|
272
|
+
* Fixed a nasty file descriptor bug in the Linux code, where file descriptors
|
273
|
+
were continuously being used up.
|
274
|
+
* Added the BTIME (boot time) constant for Linux.
|
275
|
+
* Fixed up the test/test.rb file a bit.
|
276
|
+
* Added BTIME tests to tc_linux.rb.
|
277
|
+
|
278
|
+
== 0.5.0 - 11-Jul-200
|
279
|
+
* Added HP-UX support!
|
280
|
+
* Note that passing PID's or strings as arguments to ps() is not supported
|
281
|
+
in the HP-UX version. This functionality will be stripped out of the
|
282
|
+
other versions in a future release. See the README file for more details.
|
283
|
+
* Removed the VERSION() class method. Use the constant instead.
|
284
|
+
* Separated the rd docs from their respective source files. Now in the doc
|
285
|
+
directory.
|
286
|
+
* Got rid of the interactive html generation in extconf.rb.
|
287
|
+
* Changed License to Artistic.
|
288
|
+
|
289
|
+
== 0.4.3 - 30-May-2003
|
290
|
+
* Added a version.h file to store the version number. Modified all of the
|
291
|
+
C source files to use that instead of hard coding the version everywhere.
|
292
|
+
* Added a generic test.rb script for those without TestUnit installed, or
|
293
|
+
just futzing in general. Modified the extconf.rb script to copy this
|
294
|
+
instead of writing an inline HERE document.
|
295
|
+
* Modified extconf.rb so that it builds with mingw or cygwin. Thanks go to
|
296
|
+
Peter Fischer for the spot and patch.
|
297
|
+
* Modified test suite to work with TestUnit 0.1.6 or 0.1.8.
|
298
|
+
|
299
|
+
== 0.4.2 - 14-Apr-2003
|
300
|
+
* Added pure Ruby version for Win32 - thanks Park Heesob.
|
301
|
+
* Modified extconf.rb file to handle pure Ruby versions.
|
302
|
+
* Added install_pure_ruby.rb file, an alternate installation
|
303
|
+
script for pure Ruby versions.
|
304
|
+
|
305
|
+
== 0.4.1 - 31-Mar-2003
|
306
|
+
* Added support for Solaris 2.5.x.
|
307
|
+
* All exceptions are now a direct subclass of StandardError.
|
308
|
+
* Value returned for wchan now more meaningful (2.5.x only for now).
|
309
|
+
* Fixed the start, utime and ctime for FreeBSD.
|
310
|
+
* Minor fix to FreeBSD test suite.
|
311
|
+
* Some changes to extconf.rb.
|
312
|
+
* Minor doc changes.
|
313
|
+
* Added License and Copyright info.
|
314
|
+
|
315
|
+
== 0.4.0 - 10-Mar-2003
|
316
|
+
* Added MS Windows support (non-cygwin).
|
317
|
+
* Added environment information for Linux version.
|
318
|
+
* Added real exceptions (type depends on platform).
|
319
|
+
* Added a test suite (for those with testunit installed).
|
320
|
+
* Removed the sys-uname requirement.
|
321
|
+
* Heavily modified the extconf.rb script.
|
322
|
+
* Changed "Changelog" to "CHANGES" and "Manifest" to "MANIFEST".
|
323
|
+
* Added a VERSION constant and class method.
|
324
|
+
* Minor internal directory layout change (put 'os' under 'lib').
|
325
|
+
* Changed package name to lower case.
|
326
|
+
* Doc changes, including license information.
|
327
|
+
|
328
|
+
== 0.3.1 - 16-Aug-2002
|
329
|
+
* Added a "comm" field to the sunos version. I am going to try to make this a
|
330
|
+
common field for all platforms to help reduce RUBY_PLATFORM checking.
|
331
|
+
* Fixed the release date for 0.3.0 (was accidentally marked *July*).
|
332
|
+
* Added an INSTALL file.
|
333
|
+
* Minor documentation change to the sunos.c source file.
|
334
|
+
|
335
|
+
== 0.3.0 - 11-Aug-2002
|
336
|
+
* Added FreeBSD support!
|
337
|
+
* Struct name changed to just "ProcTableStruct" to be compliant with future
|
338
|
+
versions of Ruby.
|
339
|
+
* The ps() function now returns an array of ProcTableStruct's in lvalue context.
|
340
|
+
* Fixed the ability to search by process name in Linux.
|
341
|
+
* Modified Linux "comm" field to strip parenthesis.
|
342
|
+
* Some doc changes/additions.
|
343
|
+
* Added Sean Chittenden to the "Acknowledgements" section. Sean provided me
|
344
|
+
with access to a FreeBSD box, which is how I was able to provide FreeBSD
|
345
|
+
support. Thanks Sean!
|
346
|
+
|
347
|
+
== 0.2.0 - 19-Jul-2002
|
348
|
+
* Added the ability to search by process name.
|
349
|
+
* test.rb modified to be cross-platform.
|
350
|
+
* Solaris - fixed bug with fname (was accidentally called "name").
|
351
|
+
|
352
|
+
== 0.1.0 - 2-Jul-2002
|
353
|
+
- Initial release.
|
data/MANIFEST
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
* CHANGES
|
2
|
+
* MANIFEST
|
3
|
+
* Rakefile
|
4
|
+
* README
|
5
|
+
* sys-proctable.gemspec
|
6
|
+
* doc/aix.txt
|
7
|
+
* doc/bsd.txt
|
8
|
+
* doc/hpux.txt
|
9
|
+
* doc/linux.txt
|
10
|
+
* doc/solaris.txt
|
11
|
+
* doc/top.txt
|
12
|
+
* doc/windows.txt
|
13
|
+
* example/example_ps.rb
|
14
|
+
* ext/darwin/extconf.rb
|
15
|
+
* ext/darwin/sys/proctable.c
|
16
|
+
* ext/hpux/extconf.rb
|
17
|
+
* ext/hpux/sys/proctable.c
|
18
|
+
* lib/sys-proctable.rb
|
19
|
+
* lib/sys/top.rb
|
20
|
+
* lib/sys/proctable/version.rb
|
21
|
+
* lib/aix/sys/proctable.rb
|
22
|
+
* lib/freebsd/sys/proctable.rb
|
23
|
+
* lib/linux/sys/proctable.rb
|
24
|
+
* lib/sunos/sys/proctable.rb
|
25
|
+
* lib/windows/sys/proctable.rb
|
26
|
+
* test/test_sys_proctable_aix.rb
|
27
|
+
* test/test_sys_proctable_all.rb
|
28
|
+
* test/test_sys_proctable_darwin.rb
|
29
|
+
* test/test_sys_proctable_freebsd.rb
|
30
|
+
* test/test_sys_proctable_hpux.rb
|
31
|
+
* test/test_sys_proctable_linux.rb
|
32
|
+
* test/test_sys_proctable_sunos.rb
|
33
|
+
* test/test_sys_proctable_windows.rb
|
34
|
+
* test/test_sys_top.rb
|
data/README
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
== Description
|
2
|
+
A Ruby interface for gathering process information.
|
3
|
+
|
4
|
+
== Prerequisites
|
5
|
+
* Test::Unit 2.x (development only)
|
6
|
+
|
7
|
+
== Supported Platforms
|
8
|
+
* Windows 2000 or later
|
9
|
+
* Linux 2.6+
|
10
|
+
* FreeBSD
|
11
|
+
* Solaris 8+
|
12
|
+
* HP-UX 10+
|
13
|
+
* OS X 10.4+
|
14
|
+
* AIX 5.3+
|
15
|
+
|
16
|
+
== Installation
|
17
|
+
gem install sys-proctable
|
18
|
+
|
19
|
+
You may need to specify a platform in some cases. For example:
|
20
|
+
|
21
|
+
gem install sys-proctable --platform mswin32 # Windows
|
22
|
+
gem install sys-proctable --platform sunos # Solaris
|
23
|
+
gem install sys-proctable --platform linux # Linux
|
24
|
+
gem install sys-proctable --platform freebsd # FreeBSD
|
25
|
+
|
26
|
+
== Synopsis
|
27
|
+
require 'sys/proctable'
|
28
|
+
include Sys
|
29
|
+
|
30
|
+
# Everything
|
31
|
+
ProcTable.ps{ |p|
|
32
|
+
puts p.pid.to_s
|
33
|
+
puts p.comm
|
34
|
+
# ...
|
35
|
+
}
|
36
|
+
|
37
|
+
# Just one process
|
38
|
+
s = ProcTable.ps(2123)
|
39
|
+
puts s.pid.to_s
|
40
|
+
puts s.comm
|
41
|
+
# ...
|
42
|
+
|
43
|
+
# Return the results as an array of ProcTableStructs
|
44
|
+
a = ProcTable.ps
|
45
|
+
a.each do |p|
|
46
|
+
puts p.pid
|
47
|
+
# ...
|
48
|
+
end
|
49
|
+
|
50
|
+
== Notes
|
51
|
+
Windows users may pass a host name as a second argument to get process
|
52
|
+
information from a different host. This relies on the WMI service running.
|
53
|
+
|
54
|
+
== Known Issues
|
55
|
+
=== FreeBSD
|
56
|
+
A kvm interface is used. That means the owner of the process using the
|
57
|
+
sys-proctable library needs to be a member of the kvm group (or root).
|
58
|
+
|
59
|
+
=== Solaris
|
60
|
+
The cmdline member on Solaris is limited to 80 characters unless you (or
|
61
|
+
your program) own the process. This is a Solaris design flaw/feature.
|
62
|
+
|
63
|
+
=== Thread Safety
|
64
|
+
I am not currently using a thread-safe version of readdir() for versions
|
65
|
+
of this library that use C. I am not especially concerned about it either.
|
66
|
+
If you are trying to read information out of /proc from different threads
|
67
|
+
at the same time there is something seriously wrong with your code logic.
|
68
|
+
Using readdir_r() still won't solve all potential thread safety issues anyway.
|
69
|
+
|
70
|
+
== Future Plans
|
71
|
+
Add support for NetBSD and OpenBSD.
|
72
|
+
Convert existing C code to FFI.
|
73
|
+
|
74
|
+
== Acknowledgements
|
75
|
+
This library was originally based on the Perl module Proc::ProcessTable
|
76
|
+
by Dan Urist. Many ideas, as well as large chunks of code, were taken
|
77
|
+
from his work. So, a big THANK YOU goes out to Dan Urist.
|
78
|
+
|
79
|
+
A big thanks also goes out to Mike Hall who was very helpful with ideas,
|
80
|
+
logic and testing.
|
81
|
+
|
82
|
+
Thanks also go to Sean Chittenden for providing an account on one of his
|
83
|
+
FreeBSD machines. This is how the FreeBSD support was (initially) added.
|
84
|
+
|
85
|
+
Thanks go to James Hranicky for providing a patch that grabs name, eid,
|
86
|
+
euid, gid and guid info in the Linux version, along with some general
|
87
|
+
debugging help.
|
88
|
+
|
89
|
+
Thanks go to David Felstead for the original OS X code. Thanks also go
|
90
|
+
to Matthias Zirnstein for adding cmdline support for OS X.
|
91
|
+
|
92
|
+
Finally I'd like to thank all the folks who have submitted bug reports
|
93
|
+
and/or patches.
|
94
|
+
|
95
|
+
== Help Wanted
|
96
|
+
I do not have access to all platforms. If your platform is not supported
|
97
|
+
then you will need to either submit a patch or give me a remote account
|
98
|
+
on a box with a compiler so that I can write the code.
|
99
|
+
|
100
|
+
== More documentation
|
101
|
+
See the documentation under the 'doc' directory for more information,
|
102
|
+
including platform specific notes and issues.
|
103
|
+
|
104
|
+
== License
|
105
|
+
Artistic 2.0
|
106
|
+
|
107
|
+
== Copyright
|
108
|
+
(C) 2003-2015 Daniel J. Berger
|
109
|
+
All Rights Reserved.
|
110
|
+
|
111
|
+
== Contributions
|
112
|
+
Although this library is free, please consider having your company
|
113
|
+
setup a gittip if used by your company professionally.
|
114
|
+
|
115
|
+
http://www.gittip.com/djberg96/
|
116
|
+
|
117
|
+
== Author
|
118
|
+
Daniel J. Berger
|