sys-proctable 1.2.6 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/{CHANGES.rdoc → CHANGES.md} +69 -49
  4. data/Gemfile +2 -0
  5. data/{MANIFEST.rdoc → MANIFEST.md} +9 -1
  6. data/README.md +9 -3
  7. data/Rakefile +10 -7
  8. data/certs/djberg96_pub.pem +26 -0
  9. data/lib/bsd/sys/dragonfly/sys/proctable/constants.rb +11 -0
  10. data/lib/bsd/sys/dragonfly/sys/proctable/functions.rb +14 -0
  11. data/lib/bsd/sys/dragonfly/sys/proctable/structs.rb +298 -0
  12. data/lib/bsd/sys/dragonfly/sys/proctable.rb +175 -0
  13. data/lib/bsd/sys/freebsd/sys/proctable/constants.rb +0 -0
  14. data/lib/bsd/sys/freebsd/sys/proctable/functions.rb +0 -0
  15. data/lib/bsd/sys/freebsd/sys/proctable/structs.rb +0 -0
  16. data/lib/{freebsd → bsd/sys/freebsd}/sys/proctable.rb +1 -1
  17. data/lib/bsd/sys/proctable.rb +8 -0
  18. data/lib/darwin/sys/proctable.rb +53 -20
  19. data/lib/linux/sys/proctable/cgroup_entry.rb +4 -2
  20. data/lib/linux/sys/proctable/smaps.rb +29 -17
  21. data/lib/linux/sys/proctable.rb +41 -35
  22. data/lib/sunos/sys/proctable.rb +2 -2
  23. data/lib/sys/proctable/version.rb +1 -1
  24. data/lib/sys/proctable.rb +2 -2
  25. data/lib/sys/top.rb +7 -2
  26. data/lib/windows/sys/proctable.rb +36 -32
  27. data/spec/spec_helper.rb +15 -0
  28. data/spec/sys_proctable_aix_spec.rb +74 -76
  29. data/spec/sys_proctable_all_spec.rb +45 -45
  30. data/spec/sys_proctable_bsd_spec.rb +244 -0
  31. data/spec/sys_proctable_darwin_spec.rb +85 -58
  32. data/spec/sys_proctable_linux_spec.rb +196 -195
  33. data/spec/sys_proctable_sunos_spec.rb +190 -192
  34. data/spec/sys_proctable_windows_spec.rb +153 -153
  35. data/spec/sys_top_spec.rb +20 -21
  36. data/sys-proctable.gemspec +16 -24
  37. data.tar.gz.sig +0 -0
  38. metadata +78 -18
  39. metadata.gz.sig +0 -0
  40. data/spec/sys_proctable_freebsd_spec.rb +0 -210
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67e97600844b87fee76e66de7ca9ce8dc437c4b0e37d8760a1a1211629ca0ad4
4
- data.tar.gz: 8f3940b17936f4fa4fdcbaae499728d54a0d20160f320021882435dc42fa8e1d
3
+ metadata.gz: 30b96245d1885b969f8aaa3098d42e38082ef4b3eb221c77aaa009aeff77f6af
4
+ data.tar.gz: 569dea384f6de6a9c1f1bea3a44cc62295e93f07fb7f6cc81d085a23746cf7c8
5
5
  SHA512:
6
- metadata.gz: 7d9abfefc12b38b3e9961aaed71e4c0cf220418d6e719e945bcb72fe0d66a9782375ad860bb9f9dd37cedb5aefa410d689cdc97cfeb8ecc9f61e9c6eecf6fcf1
7
- data.tar.gz: b1bb3b2a1fad203879b6a3c79066e730c074e9b6a5c090da0abdaebe86e4648dbccf07955c27e575ea52aa0c38acc08ae781754ee68dc50c8527f7c054433c56
6
+ metadata.gz: e16055b962e3d7af78309f5e47286e1def1f391b28a818fd4a8f2937e561b17c5dfcf050a5db0b355846639c7314f9a8c1615db6028bf8f4ba9130832532f84a
7
+ data.tar.gz: f2b69818ad45bb9e959eff7c9fe9e4137dc7aecc59378c332ef1637011d8ea1c9ec19749a9ea912f19d694502ba1d989eb37a5e0ab0a4cea51c63a304c134c13
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,4 +1,24 @@
1
- == 1.2.6 - 25-Aug-2020
1
+ ## 1.3.0 - 26-Dec-2022
2
+ * Added DragonflyBSD support.
3
+ * Reorganized the BSD code so that FreeBSD and Dragonfly BSD live in their
4
+ own space for easier maintenance.
5
+
6
+ ## 1.2.7 - 28-Oct-2022
7
+ * Fix bug on Solaris where it would fail trying to read zero-byte pseudo-kernel
8
+ processes. Thanks go to Robert Waffen for the spot and the patch.
9
+ * Fixed a bug for MacOS that potentially caused it to miss thread info.
10
+ * Fixed specs for AIX that had gotten mangled when I switched to rspec
11
+ * Some gemspec updates, including the addition of rubocop as a development
12
+ dependency, and mandatory MFA.
13
+ * Lots of rubocop related updates, mostly stylistic, but in some cases things
14
+ that were always meant to be private (like C struct wrappers) have been
15
+ explicitly marked as private.
16
+ * Lots of general spec refactoring, including updates for MacOS since Catalina
17
+ and later that no longer allow you to collect env information for spawned
18
+ processes.
19
+ * Switched to github actions.
20
+
21
+ ## 1.2.6 - 25-Aug-2020
2
22
  * Made some updates so that it worked properly with TruffleRuby on Mac.
3
23
  * Fixed an issue on Linux where non-ascii environ strings could cause failure.
4
24
  Thanks go to deemytch for the spot and original patch.
@@ -7,22 +27,22 @@
7
27
  that don't support fork.
8
28
  * Updated the MANIFEST.
9
29
 
10
- == 1.2.5 - 19-Jun-2020
30
+ ## 1.2.5 - 19-Jun-2020
11
31
  * Added the delayacct_blkio_ticks, guest_time, and cguest_time fields on Linux.
12
32
  These require 2.6.18 or later, but will simply be nil on earlier versions.
13
33
  * Added the rsslim synonym for the rlim field for Linux.
14
34
 
15
- == 1.2.4 - 18-Jun-2020
35
+ ## 1.2.4 - 18-Jun-2020
16
36
  * Added the num_threads field for Linux. This was originally a dead field in
17
37
  older versions of Linux that was skipped, but as of Linux 2.6+ it actually
18
38
  holds meaningful data.
19
39
  * Updated the specs for Linux.
20
40
 
21
- == 1.2.3 - 17-Mar-2020
41
+ ## 1.2.3 - 17-Mar-2020
22
42
  * Properly include a copy of Apache-2.0 in LICENSE file as part of library.
23
43
  * Add explicit .rdoc extensions to CHANGES and MANIFEST files.
24
44
 
25
- == 1.2.2 - 12-Aug-2019
45
+ ## 1.2.2 - 12-Aug-2019
26
46
  * Added compatibility for JRuby on Mac which apparently doesn't define a
27
47
  read_uint64 method, nor a CharArray. Thanks go to Adithya Pentela for
28
48
  the spot.
@@ -35,7 +55,7 @@
35
55
  * Cleaned up the MANIFEST file, updated the gemspec, and fixed the
36
56
  license name, which was missing a hyphen.
37
57
 
38
- == 1.2.1 - 8-Jun-2018
58
+ ## 1.2.1 - 8-Jun-2018
39
59
  * The code for OSX is now more efficient when a pid argument is provided.
40
60
  Thanks go to Nick LaMuro for his efforts.
41
61
  * Added metadata to the gemspec.
@@ -43,7 +63,7 @@
43
63
  Tim Meusel for the update.
44
64
  * Updated the cert. Should be good for ten years now.
45
65
 
46
- == 1.2.0 - 20-Feb-2018
66
+ ## 1.2.0 - 20-Feb-2018
47
67
  * There has been an API change. The ProcTable.ps method now uses keyword
48
68
  arguments. The 'pid' option is universal, the rest depend on the platform.
49
69
  As part of this change, support for Ruby < 2.0 has been dropped.
@@ -55,27 +75,27 @@
55
75
  * Lots of Rakefile updates based on the above changes.
56
76
  * The cert was updated.
57
77
 
58
- == 1.1.5 - 10-Aug-2017
78
+ ## 1.1.5 - 10-Aug-2017
59
79
  * Fixed a warning that cropped up in Ruby 2.4.x because I was type checking
60
80
  against Fixnum. Those have been replaced with Numeric.
61
81
 
62
- == 1.1.4 - 30-Mar-2017
82
+ ## 1.1.4 - 30-Mar-2017
63
83
  * Fixed a potential issue where OSX could return a struct with invalid data.
64
84
  * Set the default field to :pid for OSX when using Sys::Top.
65
85
  * Fixed a duplicate test warning for OSX.
66
86
 
67
- == 1.1.3 - 28-Sep-2016
87
+ ## 1.1.3 - 28-Sep-2016
68
88
  * Fixed an issue on OSX where the value returned for argc is invalid.
69
89
 
70
- == 1.1.2 - 18-Sep-2016
90
+ ## 1.1.2 - 18-Sep-2016
71
91
  * Fixed cmdline parsing and handling for OSX. Thanks go to Ben Mathwig for
72
92
  the spot and the patch.
73
93
 
74
- == 1.1.1 - 30-Jun-2016
94
+ ## 1.1.1 - 30-Jun-2016
75
95
  * Added thread information for OS X.
76
96
  * Fixed VERSION constant for HP-UX.
77
97
 
78
- == 1.1.0 - 27-Jun-2016
98
+ ## 1.1.0 - 27-Jun-2016
79
99
  * License was changed to Apache 2.0.
80
100
  * The OS X version now requires OS X 10.7 or later.
81
101
  * Scrapped the C implementation for OS X, and replaced it with a libproc wrapper
@@ -85,20 +105,20 @@
85
105
  * Rakefile updates to accomodate the changes for OS X.
86
106
  * Some test suite updates and refactoring.
87
107
 
88
- == 1.0.0 - 11-Jan-2016
108
+ ## 1.0.0 - 11-Jan-2016
89
109
  * Added smaps information for Linux. Thanks go to Joe Rafaniello for the patch.
90
110
  * This really should not have been a major release, sorry.
91
111
 
92
- == 0.9.9 - 8-Nov-2015
112
+ ## 0.9.9 - 8-Nov-2015
93
113
  * Added support for cgroups on Linux. Thanks go to Dennis Günnewig for the patch.
94
114
  * Added a sys-proctable.rb file for convenience.
95
115
  * This gem is now signed.
96
116
  * Gem related tasks in the Rakefile now assume Rubygems 2.x.
97
117
 
98
- == 0.9.8 - 18-Apr-2015
118
+ ## 0.9.8 - 18-Apr-2015
99
119
  * Fixed a bug in the gemspec. Last version got yanked.
100
120
 
101
- == 0.9.7 - 18-Apr-2015
121
+ ## 0.9.7 - 18-Apr-2015
102
122
  * Fixed a bug in the OSX code that could cause the ps method to fail. Thanks
103
123
  go to Koshevoy Anton for the spot.
104
124
  * Some internal refactoring of version handling. Now all platforms use a
@@ -107,16 +127,16 @@
107
127
  FFI on FreeBSD 10 no longer understands them. Thanks go to Mike Owens for
108
128
  the spot.
109
129
 
110
- == 0.9.6 - 24-Feb-2015
130
+ ## 0.9.6 - 24-Feb-2015
111
131
  * Added NLWP field on Linux. Thanks go to Rich Chatterton for the patch.
112
132
 
113
- == 0.9.5 - 10-Feb-2015
133
+ ## 0.9.5 - 10-Feb-2015
114
134
  * Significant cleanup and memory reduction of the OSX code. Thanks go
115
135
  to Ivan (toy) for the patches.
116
136
  * Skip over /proc/<file>/status if unreadable on Linux. Thanks go to Jianjun
117
137
  Mao for the patch.
118
138
 
119
- == 0.9.4 - 4-Mar-2014
139
+ ## 0.9.4 - 4-Mar-2014
120
140
  * Added support for AIX 5.3 or later courtesy of Rick Ohnemus.
121
141
  * The Solaris version now uses FFI structs instead of a packed array.
122
142
  It solved issues with 64-bit versions of Ruby and it's self-documenting.
@@ -127,12 +147,12 @@
127
147
  that the C code did not build on those platforms anyway, I doubt most of
128
148
  you will notice. Patches for those platforms are welcome, but only using FFI.
129
149
 
130
- == 0.9.3 - 17-Mar-2013
150
+ ## 0.9.3 - 17-Mar-2013
131
151
  * Fixed a bug on OSX where a long command string arg could cause
132
152
  a segfault. Thanks go to Nathaniel Bibler for the spot.
133
153
  * Changed the gem platform from mingw to mingw32 for Windows.
134
154
 
135
- == 0.9.2 - 8-Oct-2012
155
+ ## 0.9.2 - 8-Oct-2012
136
156
  * Added cmdline support for OS X. Thanks go to Matthias Zirnstein for
137
157
  the patch.
138
158
  * Warning cleanup for 1.9.
@@ -140,7 +160,7 @@
140
160
  with a two element array for Gem::Platform.new.
141
161
  * MS date strings are now parse with DateTime instead of Date.
142
162
 
143
- == 0.9.1 - 3-Aug-2011
163
+ ## 0.9.1 - 3-Aug-2011
144
164
  * Added the pctcpu and pctmem members for Linux.
145
165
  * Added Errno::ESRCH to a rescue clause on Linux that fixed a bug
146
166
  where a missing entry wasn't being skipped when run as root. Thanks
@@ -153,7 +173,7 @@
153
173
  * Altered the platform settings in the Rakefile so that generated gems
154
174
  use 'universal' platform architectures for any particular operating system.
155
175
 
156
- == 0.9.0 - 14-Oct-2009
176
+ ## 0.9.0 - 14-Oct-2009
157
177
  * Changed the license to Artistic 2.0.
158
178
  * Fixed a bug in the OS X code where a segfault would occur when an attempt
159
179
  was made to gather resource usage information on zombie processes. From
@@ -172,7 +192,7 @@
172
192
  license change and some minor formatting changes.
173
193
  * The test-unit library was changed from a runtime to a development dependency.
174
194
 
175
- == 0.8.1 - 6-Apr-2009
195
+ ## 0.8.1 - 6-Apr-2009
176
196
  * The Linux and Solaris libraries now handle the possibility of a process
177
197
  terminating in the middle of a read more gracefully. If that happens, they
178
198
  merely skip to the next record, i.e. it's all or nothing. Thanks go to
@@ -182,7 +202,7 @@
182
202
  * Added the comm alias back to the Solaris version. Thanks go to Jun Young Kim
183
203
  for the spot.
184
204
 
185
- == 0.8.0 - 26-Jan-2009
205
+ ## 0.8.0 - 26-Jan-2009
186
206
  * The Linux and Solaris versions of this library are now pure Ruby. Be warned,
187
207
  however, that only Solaris 8 and later are now supported. This may change
188
208
  in a future release if there's demand to support 2.6 and 2.7.
@@ -209,7 +229,7 @@
209
229
  confusion with actual test files.
210
230
  * Added an 'example' rake task to run the example file.
211
231
 
212
- == 0.7.6 - 11-Jul-2007
232
+ ## 0.7.6 - 11-Jul-2007
213
233
  * Fixed the starttime for Linux. Thanks go to Yaroslav Dmitriev for the spot.
214
234
  * Fixed a bug in the MS Windows version within a private method that parsed
215
235
  an MS specific date format. This was caused by a backwards incompatible
@@ -225,11 +245,11 @@
225
245
  to David Felstead for the code. However, see the README for more information
226
246
  specific to OS X, as there are shortcomings.
227
247
 
228
- == 0.7.5 - 23-Nov-2006
248
+ ## 0.7.5 - 23-Nov-2006
229
249
  * Fixed int/long issues for Linux. Thanks go to Matt Lightner for the spot.
230
250
  * Minor documentation fixes and changes to the extconf.rb file.
231
251
 
232
- == 0.7.4 - 20-Nov-2006
252
+ ## 0.7.4 - 20-Nov-2006
233
253
  * Added a patch that deals with the large file compilation issue on Solaris.
234
254
  You no longer need to build Ruby with --disable-largefile, or build a
235
255
  64 bit Ruby, in order for this package to work. Thanks go to Steven Jenkins
@@ -240,11 +260,11 @@
240
260
  * Added preliminary support for Darwin (OS X). The code was provided by
241
261
  David Felstead, but does not appear to compile successfully. Help wanted.
242
262
 
243
- == 0.7.3 - 27-Oct-2005
263
+ ## 0.7.3 - 27-Oct-2005
244
264
  * Fix for 1.8.3 and later (rb_pid_t). This should have only affected
245
265
  Solaris.
246
266
 
247
- == 0.7.2 - 15-May-2005
267
+ ## 0.7.2 - 15-May-2005
248
268
  * Bug fix for the FreeBSD version that reads from /proc.
249
269
  * Eliminated the test bug on Linux (inexplicably caused by File.copy). The
250
270
  test suite should now run without segfaulting.
@@ -253,13 +273,13 @@
253
273
  * The 'pct_cpu' member for the BSD/kvm version has been changed to 'pctcpu'
254
274
  for consistency with other platforms.
255
275
 
256
- == 0.7.1 - 8-May-2005
276
+ ## 0.7.1 - 8-May-2005
257
277
  * Bug fixed for the cmdline info on Linux. Thanks go to Arash Abedinzadeh
258
278
  for the spot.
259
279
  * Added an example program.
260
280
  * Minor setup fix for Win32 in tc_all.rb.
261
281
 
262
- == 0.7.0 - 25-Apr-2005
282
+ ## 0.7.0 - 25-Apr-2005
263
283
  * Scrapped the C implementation for Windows in favor of an OLE + WMI pure Ruby
264
284
  approach. See documentation for details.
265
285
  * Added an optional lkvm implementation for BSD users. This is automatically
@@ -282,7 +302,7 @@
282
302
  * Some test suite cleanup and reorganization.
283
303
  * Moved project to RubyForge.
284
304
 
285
- == 0.6.4 - 31-Mar-2004
305
+ ## 0.6.4 - 31-Mar-2004
286
306
  * Fixed a bug in the pure Ruby version for Win32. Thanks go to Mark Hudson
287
307
  for the spot.
288
308
  * Fixed a bug in the C implementation for Win32 where the cmdline and path
@@ -301,16 +321,16 @@
301
321
  * Minor change to way process state is handled on HP-UX.
302
322
  * Documentation additions and updates, including warranty information.
303
323
 
304
- == 0.6.3 - 24-Feb-2004
324
+ ## 0.6.3 - 24-Feb-2004
305
325
  * Fixed a bug in the Solaris version where the cmd_args array did not
306
326
  necessarily contain data on 2.7 and later. The current patch still
307
327
  does not quite fix the problem for 2.6 and earlier but can be easily
308
328
  derived manually by parsing the cmdline string.
309
329
 
310
- == 0.6.2 - 20-Jan-2004
330
+ ## 0.6.2 - 20-Jan-2004
311
331
  * Fixed a small memory leak in the solaris version.
312
332
 
313
- == 0.6.1 - 31-Dec-2003
333
+ ## 0.6.1 - 31-Dec-2003
314
334
  * Fixed a minor bug in the cmdline field on Linux where a blank character
315
335
  was being appended to the end of the field.
316
336
  * Fixed a minor annoyance where the windows.rb file was being copied into
@@ -321,7 +341,7 @@
321
341
  * Minor test suite changes
322
342
  * MANIFEST correction and update.
323
343
 
324
- == 0.6.0 - 22-Oct-2003
344
+ ## 0.6.0 - 22-Oct-2003
325
345
  * Significant API change (and thus, a version jump) - only a
326
346
  single argument is now accepted to the ps() method, and only a PID
327
347
  (Fixnum) is regarded as a valid argument.
@@ -346,7 +366,7 @@
346
366
  * Some test suite cleanup.
347
367
  * Changed .rd2 extension to just '.rd'.
348
368
 
349
- == 0.5.2 - 18-Jul-2003
369
+ ## 0.5.2 - 18-Jul-2003
350
370
  * Modified cmdline to extend past the traditional 80 character limit on
351
371
  Solaris, where possible (Solaris 2.6+ only).
352
372
  * Added the cmdline_args and num_args fields on Solaris, which returns
@@ -359,14 +379,14 @@
359
379
  * Added solaris.txt to doc directory.
360
380
  * MANIFEST corrections.
361
381
 
362
- == 0.5.1 - 16-Jul-2003
382
+ ## 0.5.1 - 16-Jul-2003
363
383
  * Fixed a nasty file descriptor bug in the Linux code, where file descriptors
364
384
  were continuously being used up.
365
385
  * Added the BTIME (boot time) constant for Linux.
366
386
  * Fixed up the test/test.rb file a bit.
367
387
  * Added BTIME tests to tc_linux.rb.
368
388
 
369
- == 0.5.0 - 11-Jul-200
389
+ ## 0.5.0 - 11-Jul-200
370
390
  * Added HP-UX support!
371
391
  * Note that passing PID's or strings as arguments to ps() is not supported
372
392
  in the HP-UX version. This functionality will be stripped out of the
@@ -377,7 +397,7 @@
377
397
  * Got rid of the interactive html generation in extconf.rb.
378
398
  * Changed License to Artistic.
379
399
 
380
- == 0.4.3 - 30-May-2003
400
+ ## 0.4.3 - 30-May-2003
381
401
  * Added a version.h file to store the version number. Modified all of the
382
402
  C source files to use that instead of hard coding the version everywhere.
383
403
  * Added a generic test.rb script for those without TestUnit installed, or
@@ -387,13 +407,13 @@
387
407
  Peter Fischer for the spot and patch.
388
408
  * Modified test suite to work with TestUnit 0.1.6 or 0.1.8.
389
409
 
390
- == 0.4.2 - 14-Apr-2003
410
+ ## 0.4.2 - 14-Apr-2003
391
411
  * Added pure Ruby version for Win32 - thanks Park Heesob.
392
412
  * Modified extconf.rb file to handle pure Ruby versions.
393
413
  * Added install_pure_ruby.rb file, an alternate installation
394
414
  script for pure Ruby versions.
395
415
 
396
- == 0.4.1 - 31-Mar-2003
416
+ ## 0.4.1 - 31-Mar-2003
397
417
  * Added support for Solaris 2.5.x.
398
418
  * All exceptions are now a direct subclass of StandardError.
399
419
  * Value returned for wchan now more meaningful (2.5.x only for now).
@@ -403,7 +423,7 @@
403
423
  * Minor doc changes.
404
424
  * Added License and Copyright info.
405
425
 
406
- == 0.4.0 - 10-Mar-2003
426
+ ## 0.4.0 - 10-Mar-2003
407
427
  * Added MS Windows support (non-cygwin).
408
428
  * Added environment information for Linux version.
409
429
  * Added real exceptions (type depends on platform).
@@ -416,14 +436,14 @@
416
436
  * Changed package name to lower case.
417
437
  * Doc changes, including license information.
418
438
 
419
- == 0.3.1 - 16-Aug-2002
439
+ ## 0.3.1 - 16-Aug-2002
420
440
  * Added a "comm" field to the sunos version. I am going to try to make this a
421
441
  common field for all platforms to help reduce RUBY_PLATFORM checking.
422
442
  * Fixed the release date for 0.3.0 (was accidentally marked *July*).
423
443
  * Added an INSTALL file.
424
444
  * Minor documentation change to the sunos.c source file.
425
445
 
426
- == 0.3.0 - 11-Aug-2002
446
+ ## 0.3.0 - 11-Aug-2002
427
447
  * Added FreeBSD support!
428
448
  * Struct name changed to just "ProcTableStruct" to be compliant with future
429
449
  versions of Ruby.
@@ -435,10 +455,10 @@
435
455
  with access to a FreeBSD box, which is how I was able to provide FreeBSD
436
456
  support. Thanks Sean!
437
457
 
438
- == 0.2.0 - 19-Jul-2002
458
+ ## 0.2.0 - 19-Jul-2002
439
459
  * Added the ability to search by process name.
440
460
  * test.rb modified to be cross-platform.
441
461
  * Solaris - fixed bug with fname (was accidentally called "name").
442
462
 
443
- == 0.1.0 - 2-Jul-2002
463
+ ## 0.1.0 - 2-Jul-2002
444
464
  - Initial release.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -14,10 +14,18 @@
14
14
  * lib/sys/proctable/version.rb
15
15
  * lib/aix/sys/proctable.rb
16
16
  * lib/darwin/sys/proctable.rb
17
- * lib/freebsd/sys/proctable.rb
17
+ * lib/bsd/sys/dragonfly/sys/proctable.rb
18
+ * lib/bsd/sys/dragonfly/sys/proctable/constants.rb
19
+ * lib/bsd/sys/dragonfly/sys/proctable/functions.rb
20
+ * lib/bsd/sys/dragonfly/sys/proctable/structs.rb
21
+ * lib/bsd/sys/freebsd/sys/proctable.rb
22
+ * lib/bsd/sys/freebsd/sys/proctable/constants.rb
23
+ * lib/bsd/sys/freebsd/sys/proctable/functions.rb
24
+ * lib/bsd/sys/freebsd/sys/proctable/structs.rb
18
25
  * lib/linux/sys/proctable.rb
19
26
  * lib/sunos/sys/proctable.rb
20
27
  * lib/windows/sys/proctable.rb
28
+ * spec/spec_helper.rb
21
29
  * spec/sys_proctable_aix_spec.rb
22
30
  * spec/sys_proctable_all_spec.rb
23
31
  * spec/sys_proctable_darwin_spec.rb
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Ruby](https://github.com/djberg96/sys-proctable/actions/workflows/ruby.yml/badge.svg)](https://github.com/djberg96/sys-proctable/actions/workflows/ruby.yml)
2
+
1
3
  # sys-proctable
2
4
 
3
5
  ## Description
@@ -6,13 +8,17 @@
6
8
 
7
9
  ## Prerequisites
8
10
 
9
- * RSpec 3.x (development only)
11
+ * ffi
12
+ * rspec (development only)
13
+ * rake (development only)
14
+ * rubocop (development only)
10
15
 
11
16
  ## Supported Platforms
12
17
 
13
18
  * Windows 2000 or later
14
19
  * Linux 2.6+
15
20
  * FreeBSD
21
+ * DragonflyBSD
16
22
  * Solaris 8+
17
23
  * OS X 10.7+
18
24
  * AIX 5.3+
@@ -146,11 +152,11 @@ including platform specific notes and issues.
146
152
 
147
153
  ## License
148
154
 
149
- Apache 2.0
155
+ Apache-2.0
150
156
 
151
157
  ## Copyright
152
158
 
153
- (C) 2003-2019 Daniel J. Berger
159
+ (C) 2003-2022 Daniel J. Berger
154
160
  All Rights Reserved.
155
161
 
156
162
  ## Author
data/Rakefile CHANGED
@@ -3,9 +3,12 @@ require 'rake/clean'
3
3
  require 'rake/testtask'
4
4
  require 'rbconfig'
5
5
  require 'rspec/core/rake_task'
6
+ require 'rubocop/rake_task'
6
7
  include RbConfig
7
8
 
8
- CLEAN.include('**/*.gem', '**/*.rbc')
9
+ CLEAN.include('**/*.gem', '**/*.rbc', '**/*.lock')
10
+
11
+ RuboCop::RakeTask.new
9
12
 
10
13
  desc 'Install the sys-proctable library'
11
14
  task :install do
@@ -51,7 +54,7 @@ end
51
54
 
52
55
  desc 'Run the test suite for the sys-proctable library'
53
56
  RSpec::Core::RakeTask.new(:spec) do |t|
54
- t.pattern = ['spec/sys_proctable_all_spec.rb']
57
+ t.pattern = ['spec/sys_proctable_all_spec.rb', 'spec/sys_top_spec.rb']
55
58
 
56
59
  case CONFIG['host_os']
57
60
  when /aix/i
@@ -60,9 +63,9 @@ RSpec::Core::RakeTask.new(:spec) do |t|
60
63
  when /darwin/i
61
64
  t.rspec_opts = '-Ilib/darwin'
62
65
  t.pattern << 'spec/sys_proctable_darwin_spec.rb'
63
- when /freebsd/i
64
- t.rspec_opts = '-Ilib/freebsd'
65
- t.pattern << 'spec/sys_proctable_freebsd_spec.rb'
66
+ when /bsd|dragonfly/i
67
+ t.rspec_opts = '-Ilib/bsd'
68
+ t.pattern << 'spec/sys_proctable_bsd_spec.rb'
66
69
  when /linux/i
67
70
  t.rspec_opts = '-Ilib/linux'
68
71
  t.pattern << 'spec/sys_proctable_linux_spec.rb'
@@ -79,9 +82,9 @@ namespace :gem do
79
82
  desc 'Create a gem for the specified OS, or your current OS by default'
80
83
  task :create => [:clean] do
81
84
  require 'rubygems/package'
82
- spec = eval(IO.read('sys-proctable.gemspec'))
85
+ spec = Gem::Specification.load('sys-proctable.gemspec')
83
86
  spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
84
- Gem::Package.build(spec, true)
87
+ Gem::Package.build(spec)
85
88
  end
86
89
 
87
90
  desc 'Install the sys-proctable library as a gem'
@@ -0,0 +1,26 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
7
+ A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
8
+ u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
9
+ 75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
10
+ 6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
11
+ iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
12
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
13
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
14
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
15
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
16
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
17
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
18
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
19
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
20
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
21
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
22
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
23
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
24
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
25
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
26
+ -----END CERTIFICATE-----
@@ -0,0 +1,11 @@
1
+ module Sys
2
+ module ProcTableConstants
3
+ WMESGLEN = 8
4
+ MAXCOMLEN = 16
5
+ NGROUPS = 16
6
+ MAXLOGNAME = 33
7
+
8
+ KERN_PROC_ALL = 0
9
+ KERN_PROC_PID = 1
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ require 'ffi'
2
+
3
+ module Sys
4
+ module ProcTableFunctions
5
+ extend FFI::Library
6
+ ffi_lib :kvm
7
+
8
+ attach_function :devname, [:dev_t, :mode_t], :string
9
+ attach_function :kvm_open, [:string, :string, :string, :int, :string], :pointer
10
+ attach_function :kvm_close, [:pointer], :int
11
+ attach_function :kvm_getprocs, [:pointer, :int, :int, :pointer], :pointer
12
+ attach_function :kvm_getargv, [:pointer, :pointer, :int], :pointer
13
+ end
14
+ end