commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
83d36cde7ec57d721f04ad0f0cb7c2bf2ae13e0c | Guillaume Gomez | 2021-06-06T19:48:59 | Extend processor test | diff --git a/src/lib.rs b/src/lib.rs
index ae91406..859aeea 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -316,6 +316,7 @@ mod test {
assert!(s.processors().is_empty());
assert_eq!(s.physical_core_count(), None);
}
+ assert!(s.physical_core_count().unwrap_or(0) <= s.processors().... | 1 | 1 | 0 |
c3bfacdde4e6ece011e70290d43f1ca38d18303e | Guillaume Gomez | 2021-10-12T12:29:40 | Upgrade crate version to 0.20.5 | diff --git a/Cargo.toml b/Cargo.toml
index 60aff36..14ce0ae 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.20.4"
+version = "0.20.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
0b40f1f05a856c626299be9ec12dd6ec3206fcea | Guillaume Gomez | 2021-10-12T10:07:05 | Fix new clippy lints | diff --git a/src/apple/system.rs b/src/apple/system.rs
index 5a73c24..b35fe7c 100644
--- a/src/apple/system.rs
+++ b/src/apple/system.rs
@@ -89,8 +89,8 @@ impl System {
let mut to_delete = Vec::new();
- for (pid, mut proc_) in &mut self.process_list {
- if !process::has_been_updated(&mut ... | 2 | 33 | 33 |
60014cda90ded12000bf8e42a53e00d37a12e391 | Vadim Dyadkin | 2021-10-12T09:21:06 | Use Wrapping on the stat numbers due to a potential overflow in the following multiplications | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index cdb37d8..48de52f 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -11,6 +11,7 @@ use libc::statvfs;
use std::ffi::{OsStr, OsString};
use std::fs;
use std::mem;
+use std::num::Wrapping;
use std::os::unix::ffi::OsStrExt;
use std::path::{Path, PathBuf}... | 1 | 6 | 2 |
af2cd38f288284918e64bda9dc2cd47d80bf29d5 | Guillaume Gomez | 2021-09-28T09:20:45 | Update crate version to 0.20.4 | diff --git a/Cargo.toml b/Cargo.toml
index f754684..60aff36 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.20.3"
+version = "0.20.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
085777d8a145bd68b0b4b790f2f54dd133d52aaa | Guillaume Gomez | 2021-09-27T19:22:46 | Update libc version | diff --git a/Cargo.toml b/Cargo.toml
index 4776e1f..f754684 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ifdef", "ioap
ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
-libc = "^0.2.102... | 7 | 15 | 60 |
d6c0765ec9cac14a84be6d230f00200540a5de20 | Guillaume Gomez | 2021-09-16T15:19:16 | clean up types | diff --git a/src/apple/ffi.rs b/src/apple/ffi.rs
index ea7316c..bfa51bf 100644
--- a/src/apple/ffi.rs
+++ b/src/apple/ffi.rs
@@ -10,14 +10,12 @@ use libc::{c_int, c_void, kern_return_t};
pub use crate::sys::inner::ffi::*;
extern "C" {
- //pub fn task_for_pid(host: u32, pid: pid_t, task: *mut task_t) -> u32;
- ... | 2 | 7 | 29 |
6ddbe7020b2409c43d790285bebb4d17a6d5be0b | Guillaume Gomez | 2021-09-16T13:16:01 | Replace ".ok().flatten()" with a simple match | diff --git a/src/apple/system.rs b/src/apple/system.rs
index 96dc38c..9580345 100644
--- a/src/apple/system.rs
+++ b/src/apple/system.rs
@@ -279,9 +279,10 @@ impl SystemExt for System {
into_iter(pids)
.flat_map(|pid| {
- update_process(wrap, pid, arg_max a... | 1 | 4 | 3 |
5e98a39543156a38db239a4dcab5bfed07557a8a | Guillaume Gomez | 2021-09-16T10:09:18 | Update libc version | diff --git a/Cargo.toml b/Cargo.toml
index c4a18f3..4776e1f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ifdef", "ioap
ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
-libc = "^0.2.100... | 7 | 19 | 144 |
549ffe624f67b24bcf49c3e121772f7b1efc3304 | Guillaume Gomez | 2021-09-16T12:35:35 | Fix test on mac | diff --git a/src/apple/ffi.rs b/src/apple/ffi.rs
index 0d86842..d8a0e52 100644
--- a/src/apple/ffi.rs
+++ b/src/apple/ffi.rs
@@ -212,3 +212,4 @@ pub struct RUsageInfoV2 {
//pub const TASK_BASIC_INFO_64_COUNT: u32 = 10;
pub const HOST_VM_INFO64: u32 = 4;
pub const HOST_VM_INFO64_COUNT: u32 = 38;
+pub const RUSAGE_INF... | 4 | 37 | 15 |
e684b7fe6266dfcf02f82f66edcd460a0c7aca24 | Guillaume Gomez | 2021-09-16T11:09:53 | Fix apple warning | diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs
index 0e07ab7..1bcc77d 100644
--- a/src/apple/macos/process.rs
+++ b/src/apple/macos/process.rs
@@ -32,8 +32,6 @@ pub struct Process {
pub(crate) root: PathBuf,
pub(crate) memory: u64,
pub(crate) virtual_memory: u64,
- utime: u64,
- ... | 1 | 0 | 8 |
68ee21fa5fb05bce5f229c56c2c8fcb0c05ebc6b | Guillaume Gomez | 2021-09-04T11:34:02 | Upgrade crate version to 0.20.3 | diff --git a/Cargo.toml b/Cargo.toml
index 4d784a0..677d4b3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.20.2"
+version = "0.20.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
6ca5abb438107b41a64fc302586c142b97d9e019 | Guillaume Gomez | 2021-09-04T11:27:47 | Enable std feature on winapi to fix size issue | diff --git a/Cargo.toml b/Cargo.toml
index 4d784a0..a13324d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,8 @@ rayon = { version = "^1.5.1", optional = true }
once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwi... | 1 | 2 | 1 |
d27f81d62382b0a8c41c3196f68244cca7a3ddf7 | Guillaume Gomez | 2021-09-01T15:10:36 | Rework windows process information retrieval | diff --git a/src/windows/process.rs b/src/windows/process.rs
index f7d27f0..be521cb 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -233,15 +233,22 @@ impl Process {
let exe = unsafe { get_exe(handle, h_mod) };
let mut root = exe.clone();
root.pop();
+ ... | 1 | 146 | 137 |
14130fa43d04732200366f0b6e534413a0475865 | Guillaume Gomez | 2021-08-31T15:55:09 | Update ProcessExt::environ documentation | diff --git a/src/traits.rs b/src/traits.rs
index 123ab3b..a9c5c88 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -202,7 +202,7 @@ pub trait ProcessExt: Debug {
/// ```
fn pid(&self) -> Pid;
- /// Returns the environment of the process.
+ /// Returns the environment variables of the process.
//... | 1 | 1 | 1 |
17ad6d7213ee8eac720d08ec0661e02b48fbcec8 | Guillaume Gomez | 2021-08-30T12:12:30 | Upgrade crate version to 0.20.2 | diff --git a/Cargo.toml b/Cargo.toml
index 077387b..4d784a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.20.1"
+version = "0.20.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
bc475a68f2383bc887dc604ac930485b68b4de24 | Guillaume Gomez | 2021-08-29T21:51:32 | Update documentation | diff --git a/src/traits.rs b/src/traits.rs
index 99451b0..123ab3b 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -204,8 +204,6 @@ pub trait ProcessExt: Debug {
/// Returns the environment of the process.
///
- /// Always empty on Windows, except for current process.
- ///
/// ```no_run
//... | 1 | 0 | 6 |
b37194ee997ccba38ffece1c0dc46823f4517f3b | Manuel Ceron | 2021-08-16T12:15:03 | Added support for getting process cwd and environ on Windows.
Additionally code to get cmd has been updated to use a new
get_process_data function. | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 45fa5e4..f7d27f0 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -6,9 +6,11 @@
use crate::{DiskUsage, Pid, ProcessExt, Signal};
+use std::ffi::OsString;
use std::fmt::{self, Debug};
use std::mem::{size_of, zeroed, MaybeUninit}... | 2 | 292 | 200 |
45e779fd5adc5f506074afdec40dbd0c63954b3d | Guillaume Gomez | 2021-08-27T11:11:22 | Use more types from libc | diff --git a/src/apple/ffi.rs b/src/apple/ffi.rs
index 1542341..0d86842 100644
--- a/src/apple/ffi.rs
+++ b/src/apple/ffi.rs
@@ -5,8 +5,8 @@
//
use libc::{
- c_int, c_uchar, c_ushort, c_void, mach_msg_type_number_t, natural_t, processor_flavor_t,
- processor_info_array_t,
+ c_int, c_uchar, c_ushort, c_void... | 7 | 11 | 23 |
0d2d8ccb4fd1f5c2047a224c1fd4c6de1e0da848 | Guillaume Gomez | 2021-08-23T13:56:10 | Update rayon version | diff --git a/Cargo.toml b/Cargo.toml
index 3fd8ec6..077387b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,7 +15,7 @@ edition = "2018"
[dependencies]
cfg-if = "1.0"
-rayon = { version = "^1.5", optional = true }
+rayon = { version = "^1.5.1", optional = true }
once_cell = "1.0"
[target.'cfg(windows)'.dependenc... | 1 | 1 | 1 |
8d9a87a167663941084819b13265c98d96192124 | Guillaume Gomez | 2021-08-23T13:36:38 | Upgrade crate version to 0.20.1 | diff --git a/Cargo.toml b/Cargo.toml
index ddb755c..3fd8ec6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.20.0"
+version = "0.20.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
01933eaa07d7954f36bd9cdc58255ad3074f3b71 | Guillaume Gomez | 2021-08-23T12:43:19 | Update to last sysinfo version | diff --git a/Cargo.toml b/Cargo.toml
index 9a19504..ddb755c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ifdef", "ioap
ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
-libc = "^0.2.94"... | 5 | 18 | 84 |
97408422c6526733f11af44fd560a06518ea1332 | Manuel Ceron | 2021-08-12T09:33:42 | Add support for getting process current working directory on macOS
This uses the `proc_pidinfo` macOS system call to get information
about a running process. It uses the PROC_PIDVNODEPATHINFO to
get vnode information which contains the current working directory
of the project. | diff --git a/src/apple/macos/ffi.rs b/src/apple/macos/ffi.rs
index c47199e..0eb6ec0 100644
--- a/src/apple/macos/ffi.rs
+++ b/src/apple/macos/ffi.rs
@@ -14,6 +14,57 @@ use libc::{c_int, mach_port_t, size_t};
pub(crate) use crate::sys::ffi::*;
+pub const MAXPATHLEN: usize = libc::PATH_MAX as usize;
+
+#[repr(C)]
+#... | 3 | 108 | 5 |
550d89c7bf2ac69819c6f5e6053e39cc20fb628d | sigaloid | 2021-08-20T18:12:10 | Cargo fix + clippy suggestions (#559)
Fix clippy warnings | diff --git a/src/lib.rs b/src/lib.rs
index a744da0..ae91406 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -184,23 +184,19 @@ mod test {
s.refresh_all();
// All CPU usage will start at zero until the second refresh
- assert_eq!(
- s.processes()
- .iter()
- ... | 1 | 9 | 13 |
9c61b4cae83e676e52d6a21c18a311a03937bdfd | Guillaume Gomez | 2021-08-19T09:36:39 | Add test for environment variables | diff --git a/tests/process.rs b/tests/process.rs
index a3a5f2f..c92f178 100644
--- a/tests/process.rs
+++ b/tests/process.rs
@@ -84,6 +84,38 @@ fn unix_like_cmd() {
}
}
+#[test]
+#[cfg(not(windows))]
+fn test_environ() {
+ if !sysinfo::System::IS_SUPPORTED {
+ return;
+ }
+
+ let mut p = std::pr... | 1 | 32 | 0 |
d63bf2adc1c8cbe52a022869f3c3b00eb8551840 | ComplexSpaces | 2021-08-04T20:42:53 | Support default sandboxing configuration on macOS
Applications running in the macOS sandbox have access to very little
by default. Without giving your application extra entitlements to access
specific services, any attempt to access them will trigger a violation.
With minimal usage via `System::new_with_specifics(Ref... | diff --git a/src/apple/ios/component.rs b/src/apple/app_store/component.rs
similarity index 81%
rename from src/apple/ios/component.rs
rename to src/apple/app_store/component.rs
index 16333a2..fb16564 100644
--- a/src/apple/ios/component.rs
+++ b/src/apple/app_store/component.rs
@@ -6,7 +6,7 @@
use crate::ComponentE... | 12 | 174 | 153 |
fd41b1880ec45cdf9ad778050b713ccaa10f8f6c | Guillaume Gomez | 2021-08-04T18:55:33 | Upgrade crate version to 0.20.0 | diff --git a/Cargo.toml b/Cargo.toml
index 4b99a0e..dd3e5a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.19.3"
+version = "0.20.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
522ef46774f65900dd975d928e2a4b219cee1c74 | Guillaume Gomez | 2021-08-04T12:32:09 | Upgrade crate version to 0.19.3 | diff --git a/Cargo.toml b/Cargo.toml
index 79b9b46..4b99a0e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.19.2"
+version = "0.19.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
9f2f873b423ce74c873f33338f33b547c648f380 | FssAy | 2021-08-04T12:25:39 | Add `CREATE_NO_WINDOW` flag for Windows process kill method (#548)
Add `CREATE_NO_WINDOW` flag for Windows process kill method:
Prevents the taskkill.exe console windows from appearing. | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 235a638..45fa5e4 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -9,6 +9,7 @@ use crate::{DiskUsage, Pid, ProcessExt, Signal};
use std::fmt::{self, Debug};
use std::mem::{size_of, zeroed, MaybeUninit};
use std::ops::Deref;
+use st... | 1 | 3 | 1 |
eb309ae4e4b3abe4473798ef89ce8c906b482b9c | Guillaume Gomez | 2021-07-23T11:17:52 | Improve mac code readability | diff --git a/src/apple/processor.rs b/src/apple/processor.rs
index 514951f..8282036 100644
--- a/src/apple/processor.rs
+++ b/src/apple/processor.rs
@@ -133,15 +133,82 @@ pub fn get_cpu_frequency() -> u64 {
speed / 1_000_000
}
+#[inline]
+fn get_in_use(cpu_info: *mut i32, offset: isize) -> i32 {
+ unsafe {
+... | 3 | 109 | 92 |
f49aa19180de5029976f335c496e704b6b0f2aa5 | uhuntu | 2021-07-20T08:47:50 | Fix compile issue. | diff --git a/benches/basic.rs b/benches/basic.rs
index 7c6e545..0d92aa0 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -1,5 +1,7 @@
#![feature(test)]
+extern crate test;
+
use sysinfo::get_current_pid;
use sysinfo::{DiskExt, SystemExt}; | 1 | 2 | 0 |
01218743c7e656b7f12f530713ba417d2c5940ad | Guillaume Gomez | 2021-07-15T15:23:20 | Upgrade crate version to 0.19.2 | diff --git a/Cargo.toml b/Cargo.toml
index c0595f1..875d5f4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.19.1"
+version = "0.19.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
e49416784e67df71f02f819190ca9d6f7a60dd06 | Guillaume Gomez | 2021-07-15T15:19:41 | Fix swap computation on windows | diff --git a/src/windows/system.rs b/src/windows/system.rs
index 69ba9ba..9446e83 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -20,7 +20,6 @@ use crate::sys::users::get_users;
use crate::utils::into_iter;
use std::cell::UnsafeCell;
-use std::cmp;
use std::collections::HashMap;
use std::ffi::O... | 1 | 25 | 14 |
365d1eae3ccd950dabe007cbe9f68ad69b46c6ca | Guillaume Gomez | 2021-07-08T20:54:41 | Upgrade crate version to 0.19.1 | diff --git a/Cargo.toml b/Cargo.toml
index 8afc220..c0595f1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.19.0"
+version = "0.19.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
d23ce505daf991d541092ba9978728bcdd5ca454 | Guillaume Gomez | 2021-07-08T20:02:50 | Update memory tests and fix some clippy lints | diff --git a/src/lib.rs b/src/lib.rs
index bddef8d..94420f8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -198,16 +198,45 @@ pub fn set_open_files_limit(mut _new_limit: isize) -> bool {
mod test {
use crate::*;
+ #[test]
+ fn check_process_memory_usage() {
+ let mut s = System::new();
+ s.refr... | 3 | 38 | 13 |
ceaa6aa3815617243fb0651db595959828c4178e | Guillaume Gomez | 2021-07-08T20:02:23 | Fix memory information gathering on linux | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 066d80d..a2c276d 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -300,7 +300,8 @@ impl SystemExt for System {
fn refresh_memory(&mut self) {
if let Ok(data) = get_all_data("/proc/meminfo", 16_385) {
for line in data.sp... | 1 | 3 | 2 |
7c90e42173e11e7b5a4d7c22a9b11348e537908d | Guillaume Gomez | 2021-07-08T19:54:47 | Get swap memory information on Windows | diff --git a/src/windows/system.rs b/src/windows/system.rs
index b510495..69ba9ba 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -20,6 +20,7 @@ use crate::sys::users::get_users;
use crate::utils::into_iter;
use std::cell::UnsafeCell;
+use std::cmp;
use std::collections::HashMap;
use std::ffi::O... | 1 | 6 | 2 |
fa7ba11962c52f160f7f560282403854b6f5d31f | Guillaume Gomez | 2021-06-29T13:20:31 | Upgrade crate version to 0.19.0 | diff --git a/Cargo.toml b/Cargo.toml
index 823cf3d..8afc220 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.18.2"
+version = "0.19.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
216058cf808b3d1835ae3f37941d6b56481d46bb | Guillaume Gomez | 2021-06-29T09:54:30 | Fix CPU usage subtraction overflow | diff --git a/src/linux/process.rs b/src/linux/process.rs
index f4b72fc..bbb926c 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -289,8 +289,10 @@ pub fn compute_cpu_usage(p: &mut Process, nb_processors: u64, total_time: f32) {
return;
}
- p.cpu_usage =
- ((p.utime - p.old_utime... | 1 | 4 | 2 |
f938ba1383dfb23622e624ae207abeaf4d921091 | Guillaume Gomez | 2021-06-28T20:07:51 | Update disk test | diff --git a/tests/disk_list.rs b/tests/disk_list.rs
index 716349f..7ce6d72 100644
--- a/tests/disk_list.rs
+++ b/tests/disk_list.rs
@@ -10,6 +10,9 @@ fn test_disks() {
if sysinfo::System::IS_SUPPORTED {
let s = sysinfo::System::new_all();
- assert!(!s.disks().is_empty());
+ // If we don't... | 1 | 4 | 1 |
e7254b1aa89a7f52a9e25d4efbbdb818cae121c7 | Guillaume Gomez | 2021-06-28T13:41:25 | Fix check_processors_number test | diff --git a/src/lib.rs b/src/lib.rs
index e031cc3..bddef8d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -341,10 +341,11 @@ mod test {
if System::IS_SUPPORTED {
assert!(!s.processors().is_empty());
+ // In case we are running inside a VM, it's possible to not have a physical core, only... | 2 | 4 | 5 |
0ad99b650f69993937ab6ddd23dd5d9a56df6822 | Guillaume Gomez | 2021-06-28T09:49:48 | Clean up check_uid_gid test | diff --git a/src/lib.rs b/src/lib.rs
index 735dd8e..e031cc3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -261,8 +261,6 @@ mod test {
let users = s.users();
assert!(users.len() >= MIN_USERS);
- println!("{:?}", users);
-
if System::IS_SUPPORTED {
#[cfg(not(target_os = "win... | 1 | 4 | 5 |
f5ae9f334c8a784e2622e78ecc280c273a34a943 | Rohan Jain | 2021-06-26T17:34:39 | Ensure there's a value in linux `global_processor`
Currently, there is no frequency set for `global_processor` for linux.
This results in my project [sysit](https://github.com/crodjer/sysit)
rendering `0` for CPU Frequency on my Raspberry Pi.
I couldn't find the best heuristic to use for global processor
frequency. S... | diff --git a/examples/simple.rs b/examples/simple.rs
index 7d8e1ac..a736532 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -201,7 +201,11 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
}
}
"frequency" => {
- writeln!(&mut io::stdout(), "{} MHz", sys... | 2 | 13 | 1 |
bb5cdc53c430c361ce6b69b338689f8f875a29f1 | Guillaume Gomez | 2021-06-25T20:30:43 | Add support for disk removable on linux | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index 666c6af..cdb37d8 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -24,7 +24,7 @@ macro_rules! cast {
#[derive(PartialEq)]
pub struct Disk {
type_: DiskType,
- name: OsString,
+ device_name: OsString,
file_system: Vec<u8>,
mount_poi... | 1 | 54 | 21 |
758fa332a371b7c89cc973d5fe49413db58a563b | Guillaume Gomez | 2021-06-24T20:36:14 | Rework DiskType enum | diff --git a/src/apple/disk.rs b/src/apple/disk.rs
index 5b65138..227671b 100644
--- a/src/apple/disk.rs
+++ b/src/apple/disk.rs
@@ -23,6 +23,7 @@ pub struct Disk {
pub(crate) mount_point: PathBuf,
pub(crate) total_space: u64,
pub(crate) available_space: u64,
+ pub(crate) is_removable: bool,
}
imp... | 9 | 51 | 25 |
d1394c99688d57220c4b28ae472f7d82bf541230 | Guillaume Gomez | 2021-06-24T20:00:34 | Fix user test | diff --git a/src/lib.rs b/src/lib.rs
index cb5b09c..735dd8e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -261,17 +261,24 @@ mod test {
let users = s.users();
assert!(users.len() >= MIN_USERS);
- for user in users {
- match user.name() {
- "root" => {
- ... | 1 | 18 | 11 |
223e8e32513ca60a807723b88d4f08ae9ad4c1e8 | Guillaume Gomez | 2021-06-15T13:27:15 | Fix broken links | diff --git a/src/common.rs b/src/common.rs
index df1f800..9866342 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -334,7 +334,7 @@ pub enum Signal {
/// A struct representing system load average value.
///
-/// It is returned by [`SystemExt::get_load_average`][crate::SystemExt::get_load_average].
+/// It is retur... | 2 | 3 | 3 |
f324306016c855a4dc3ad2b3828860c56e5a68c2 | Guillaume Gomez | 2021-06-14T19:12:26 | Remove unneeded (re)import of CoreFoundation | diff --git a/build.rs b/build.rs
index 138489b..4373009 100644
--- a/build.rs
+++ b/build.rs
@@ -15,6 +15,5 @@ fn main() {
}
println!("cargo:rustc-link-lib=framework=Foundation");
- println!("cargo:rustc-link-lib=framework=CoreFoundation");
}
} | 1 | 0 | 1 |
3df95e794559ce37399cfe76c38d3d1efd31b316 | Guillaume Gomez | 2021-06-14T13:18:33 | Improve ProcessExt::name documentation | diff --git a/src/traits.rs b/src/traits.rs
index b17e11a..e846d85 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -141,8 +141,8 @@ pub trait ProcessExt: Debug {
/// 1. It is limited to 15 characters.
/// 2. It is not always the exe name.
///
- /// If you are looking for process, unless you know wh... | 1 | 2 | 2 |
50ba16a94961f113b68eaaffa061d56344438a7f | Guillaume Gomez | 2021-06-14T13:13:12 | Set exe path from cmd if not found | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 8715383..f4b72fc 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -458,7 +458,11 @@ pub(crate) fn _get_process_data(
p.exe = exe_path;
}
Err(_) => {
- p.exe = PathBuf::new();
+ ... | 1 | 5 | 1 |
d7ab26e7d8b3f2f992d99c9f51727ac0a01b6f8b | Guillaume Gomez | 2021-06-14T12:00:50 | Add extra information for ProcessExt::name method | diff --git a/src/traits.rs b/src/traits.rs
index a1a6609..b17e11a 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -135,6 +135,15 @@ pub trait ProcessExt: Debug {
/// Returns the name of the process.
///
+ /// **⚠️ Important ⚠️**
+ ///
+ /// On **linux**, there are two things to know about process... | 1 | 9 | 0 |
0bdb2a4707adad6c62deaab656021980d9e4574d | Guillaume Gomez | 2021-06-13T21:57:13 | Clean linux code by moving process-related code to process file | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index ff1e6a9..c725d7d 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -4,7 +4,7 @@
// Copyright (c) 2017 Guillaume Gomez
//
-use crate::sys::system::get_all_data;
+use crate::sys::utils::get_all_data;
use crate::{utils, DiskExt, DiskType};
use libc::... | 5 | 400 | 387 |
62de89cd8ebeecade53671b3d75f4c6db70b4ee5 | Guillaume Gomez | 2021-06-11T08:29:51 | Ensure that linux uptime is computed every time in System::get_uptime | diff --git a/src/linux/system.rs b/src/linux/system.rs
index f64b46b..b149530 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -121,7 +121,6 @@ pub struct System {
components: Vec<Component>,
disks: Vec<Disk>,
networks: Networks,
- uptime: u64,
users: Vec<User>,
boot_time: u64,
... | 2 | 21 | 18 |
9b9d523e5858e8e3f5c78955deb0e14e57306467 | Guillaume Gomez | 2021-06-07T17:30:54 | Ensure that there is at least one physical core | diff --git a/src/lib.rs b/src/lib.rs
index c46bede..f6538e3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -343,11 +343,11 @@ mod test {
if System::IS_SUPPORTED {
assert!(!s.get_processors().is_empty());
- assert!(
- s.get_physical_core_count()
- .expect... | 1 | 5 | 5 |
b7b865c55e4a8b6e8c21a142b31b42167e635e74 | Guillaume Gomez | 2021-06-07T13:05:18 | Add physical core count information to processor command in example | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 7c3b676..92e8998 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -166,6 +166,13 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
"processors" => {
// Note: you should refresh a few times before usi... | 1 | 7 | 0 |
24f4280938159b866a08a13afa75bb092c95168f | Guillaume Gomez | 2021-06-07T13:03:37 | Fix physical processor count on windows | diff --git a/src/windows/processor.rs b/src/windows/processor.rs
index abc3b31..d0b5958 100644
--- a/src/windows/processor.rs
+++ b/src/windows/processor.rs
@@ -8,6 +8,7 @@ use crate::sys::tools::KeyHandler;
use crate::{LoadAvg, ProcessorExt};
use std::collections::HashMap;
+use std::io::Error;
use std::mem;
use ... | 1 | 42 | 20 |
90f7d867beeeee2c8e7b3d830782a31cd994902b | Guillaume Gomez | 2021-06-06T19:48:59 | Extend processor test | diff --git a/src/lib.rs b/src/lib.rs
index 270047f..c46bede 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -343,8 +343,14 @@ mod test {
if System::IS_SUPPORTED {
assert!(!s.get_processors().is_empty());
+ assert!(
+ s.get_physical_core_count()
+ .expect(... | 1 | 6 | 0 |
b1f4b3c8ae0d26382c4e5550050c20f9987a1079 | Guillaume Gomez | 2021-06-05T22:03:40 | Upgrade crate version to 0.18.2 | diff --git a/Cargo.toml b/Cargo.toml
index 066e9c3..823cf3d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.18.1"
+version = "0.18.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
c0b13c77b1bae4e75f8670e94df9083d253c9ce5 | Guillaume Gomez | 2021-06-05T21:32:05 | Check that there is always at least one processor listed | diff --git a/src/lib.rs b/src/lib.rs
index 8648751..270047f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -336,6 +336,17 @@ mod test {
assert!(!System::IS_SUPPORTED);
}
}
+
+ #[test]
+ fn check_processors_number() {
+ let s = System::new();
+
+ if System::IS_SUPPORTED {
+ ... | 1 | 11 | 0 |
5763e5f6840f060468efbf01b9c0b71f84cd478a | Guillaume Gomez | 2021-06-05T21:31:47 | Add test to check brand and vendor ID for processors | diff --git a/src/apple/processor.rs b/src/apple/processor.rs
index 6466ed6..c06b12b 100644
--- a/src/apple/processor.rs
+++ b/src/apple/processor.rs
@@ -241,7 +241,8 @@ fn get_sysctl_str(s: &[u8]) -> String {
}
pub fn get_vendor_id_and_brand() -> (String, String) {
- // On apple M1, `sysctl machdep.cpu.vendor` r... | 1 | 34 | 1 |
848f2a1d362fe3cec24e0485d05b6f5b4d8d008d | Reagan McFarland | 2021-06-05T20:11:55 | Apple: Processor.vendor_id fallsback to "Apple"
For the Apple M1 architecture, `sysctl machdep.cpu.vendor` returns an
empty string because the oid is not found. M1 seems to be the only
architecture where this occurs. As a result, if an empty string is
returned when trying to get the vendor_id, return "Apple" instead. | diff --git a/src/apple/processor.rs b/src/apple/processor.rs
index 1dc598d..6466ed6 100644
--- a/src/apple/processor.rs
+++ b/src/apple/processor.rs
@@ -241,8 +241,11 @@ fn get_sysctl_str(s: &[u8]) -> String {
}
pub fn get_vendor_id_and_brand() -> (String, String) {
- (
- get_sysctl_str(b"machdep.cpu.vend... | 1 | 7 | 4 |
b209d26f62ddb5f3780bd2870a54bb99300b3c76 | Guillaume Gomez | 2021-06-05T19:58:46 | Fix example signals | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index a17dc3c..7c3b676 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -16,7 +16,7 @@ use sysinfo::{
NetworkExt, NetworksExt, Pid, ProcessExt, ProcessorExt, Signal, System, SystemExt, UserExt,
};
-const signals: [Signal; 31] = [
+c... | 1 | 2 | 3 |
7ea5c2c6259acf39340065ad7cce97171e8aa3d7 | Guillaume Gomez | 2021-06-05T19:46:16 | Fix clippy warnings on windows | diff --git a/src/windows/disk.rs b/src/windows/disk.rs
index d21843f..5465902 100644
--- a/src/windows/disk.rs
+++ b/src/windows/disk.rs
@@ -60,7 +60,7 @@ impl DiskExt for Disk {
}
fn get_mount_point(&self) -> &Path {
- &Path::new(&self.s_mount_point)
+ Path::new(&self.s_mount_point)
}
... | 2 | 3 | 3 |
2812b93ded89bdbc588832982a75678bcf7ba65d | Guillaume Gomez | 2021-06-05T19:41:19 | Fix clippy warning on mac | diff --git a/src/apple/macos/component.rs b/src/apple/macos/component.rs
index 42b135e..f33288e 100644
--- a/src/apple/macos/component.rs
+++ b/src/apple/macos/component.rs
@@ -214,6 +214,6 @@ fn get_temperature_inner(
}
pub(crate) fn get_temperature(con: ffi::io_connect_t, key: &[i8]) -> Option<f32> {
- let (in... | 1 | 1 | 1 |
bf6c9c85cdccd9ac3282befd9a620d0efd6819f2 | Reagan McFarland | 2021-06-05T19:20:28 | Fix cpu.get_brand() returning empty string on M1
This patch fixes the bug where on Apple M1 machines, calling
cpu.get_brand() returns an empty string. | diff --git a/src/apple/processor.rs b/src/apple/processor.rs
index 642c00e..1dc598d 100644
--- a/src/apple/processor.rs
+++ b/src/apple/processor.rs
@@ -242,7 +242,7 @@ fn get_sysctl_str(s: &[u8]) -> String {
pub fn get_vendor_id_and_brand() -> (String, String) {
(
- get_sysctl_str(b"machdep.cpu.brand_st... | 1 | 1 | 1 |
377617023d65d21d2cf86ea812fd1a6118d91879 | Guillaume Gomez | 2021-06-03T15:15:14 | Upgrade crate version to 0.18.1 | diff --git a/Cargo.toml b/Cargo.toml
index 7c77f1a..066e9c3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.18.0"
+version = "0.18.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
560d6e94ab433cb7fdf89e879e396e55b1718561 | Guillaume Gomez | 2021-06-03T13:40:36 | Fix tests on non-supported targets | diff --git a/src/common.rs b/src/common.rs
index a02e86f..5e6b9a1 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -105,7 +105,9 @@ assert_eq!(r.", stringify!($name), "(), false);
/// let mut system = System::new_with_specifics(RefreshKind::everything().without_disks_list());
///
/// assert_eq!(system.get_disks().l... | 9 | 71 | 44 |
84ce3a18a27e0864844de3deaab29760512cfd8f | Guillaume Gomez | 2021-06-03T13:19:16 | Add SystemExt::IS_SUPPORTED constant | diff --git a/src/apple/system.rs b/src/apple/system.rs
index 5ba4d40..f173b8d 100644
--- a/src/apple/system.rs
+++ b/src/apple/system.rs
@@ -124,6 +124,8 @@ fn boot_time() -> u64 {
}
impl SystemExt for System {
+ const IS_SUPPORTED: bool = true;
+
fn new_with_specifics(refreshes: RefreshKind) -> System {
... | 6 | 47 | 1 |
4f23caa99db89743b1f6bc535228418a7016f77f | Guillaume Gomez | 2021-05-23T13:52:05 | Upgrade crate version to 0.18.0 | diff --git a/Cargo.toml b/Cargo.toml
index 8643371..7c77f1a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.5"
+version = "0.18.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
b690a43142732d35c6ad5614daa66938c55d2d43 | Luciano Cerqueira Torres | 2021-05-23T18:58:12 | Update disk.rs
Removed extra line at beginning | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index 08b4684..ff1e6a9 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -1,4 +1,3 @@
-
//
// Sysinfo
// | 1 | 0 | 1 |
26ab775278705ba1f45a002df12aff17ebabae30 | Guillaume Gomez | 2021-05-23T13:37:01 | Rework Signal enum and remove #[repr(C)] on it | diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs
index f0de2df..63d1055 100644
--- a/src/apple/macos/process.rs
+++ b/src/apple/macos/process.rs
@@ -158,7 +158,43 @@ impl ProcessExt for Process {
}
fn kill(&self, signal: Signal) -> bool {
- unsafe { kill(self.pid, signal as c_int)... | 3 | 114 | 42 |
66225d4b46049d62e9912d6027e6d8ca2b8e6582 | Guillaume Gomez | 2021-05-23T13:43:27 | Make it more clear how to use use the different information | diff --git a/src/lib.rs b/src/lib.rs
index 7c71719..7bd73ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -6,8 +6,12 @@
//! `sysinfo` is a crate used to get a system's information.
//!
-//! Before any attempt to read the different structs' information, you need to update them to
-//! get up-to-date information.
+//! ... | 1 | 6 | 2 |
69c1f8a1e92632c374166314d1e8376160dae325 | Luciano Torres | 2021-05-20T20:20:06 | Added support for paravirtualized disks | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index fe211dc..08b4684 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -1,3 +1,4 @@
+
//
// Sysinfo
//
@@ -116,8 +117,8 @@ fn find_type_for_name(name: &OsStr) -> DiskType {
if real_path != name_path {
return find_type_for_name(OsStr::... | 1 | 3 | 2 |
b0ca80d6ea2a7e9f0d7d86dbae9ac6586717f602 | Guillaume Gomez | 2021-05-17T13:07:55 | Upgrade crate version to 0.17.5 | diff --git a/Cargo.toml b/Cargo.toml
index 56d904b..8643371 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.4"
+version = "0.17.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
cad7d48dad58cf505784ceb78c38b101c27b0d8e | Guillaume Gomez | 2021-05-17T12:40:47 | Small linux code improvement | diff --git a/src/linux/network.rs b/src/linux/network.rs
index ee92453..c3df908 100644
--- a/src/linux/network.rs
+++ b/src/linux/network.rs
@@ -122,8 +122,8 @@ fn refresh_networks_list_from_sysfs(
};
}
- // Remove interfaces that are gone
- interfaces.retain(|_n, d| d.updated);
+ ... | 1 | 2 | 2 |
ae6a72c211c23d21a2b15ec88a20cd261fe17e30 | Guillaume Gomez | 2021-05-17T12:40:32 | Improve refresh_networks_list code on Apple targets | diff --git a/src/apple/network.rs b/src/apple/network.rs
index 736df3f..40d63a3 100644
--- a/src/apple/network.rs
+++ b/src/apple/network.rs
@@ -8,7 +8,7 @@ use crate::sys::ffi;
use libc::{self, c_char, CTL_NET, NET_RT_IFLIST2, PF_ROUTE, RTM_IFINFO2};
-use std::collections::HashMap;
+use std::collections::{hash_ma... | 1 | 67 | 43 |
9220d58ce7124e69a1e116c89e7c89a1109bf7f4 | Guillaume Gomez | 2021-05-17T12:35:14 | Improve refresh_networks_list code on Windows | diff --git a/src/windows/network.rs b/src/windows/network.rs
index a2785b7..4fc2584 100644
--- a/src/windows/network.rs
+++ b/src/windows/network.rs
@@ -6,7 +6,7 @@
use crate::{NetworkExt, NetworksExt, NetworksIter};
-use std::collections::{HashMap, HashSet};
+use std::collections::{hash_map, HashMap};
use wina... | 1 | 44 | 36 |
abf7b7ff86ef815e9cca46d734caebd6c826eb0c | desbma | 2021-05-13T20:25:00 | Linux: Cleanup removed interfaces in refresh_networks_list (fixes #479) (#481)
Remove interfaces in refresh_networks_list on Linux | diff --git a/src/linux/network.rs b/src/linux/network.rs
index ed1c948..ee92453 100644
--- a/src/linux/network.rs
+++ b/src/linux/network.rs
@@ -9,7 +9,7 @@ use std::io::Read;
use std::path::Path;
use crate::{NetworkExt, NetworksExt, NetworksIter};
-use std::collections::HashMap;
+use std::collections::{hash_map, H... | 1 | 119 | 45 |
9f0ed8e261ef44e6bb26a80560299e4dea3b9b0b | Guillaume Gomez | 2021-05-13T12:47:49 | Upgrade crate version to 0.17.4 | diff --git a/Cargo.toml b/Cargo.toml
index 67cc5aa..56d904b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.3"
+version = "0.17.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
964e99d0a2584937eb72074f218d6730d1259316 | Guillaume Gomez | 2021-05-12T20:14:24 | Fix tests for unsupported systems | diff --git a/src/lib.rs b/src/lib.rs
index 35f2e26..7c71719 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -82,7 +82,7 @@ cfg_if::cfg_if! {
extern crate core_foundation_sys;
#[cfg(test)]
- const MIN_USERS: usize = 1;
+ pub(crate) const MIN_USERS: usize = 1;
} else if #[cfg(windows)] ... | 2 | 47 | 30 |
af653f609efc364a97c6814dc2ff16682dbbb1d0 | Oleksandr Anyshchenko | 2021-05-12T09:13:31 | Fix build on freebsd host | diff --git a/src/unknown/component.rs b/src/unknown/component.rs
index 7b029c9..98c659e 100644
--- a/src/unknown/component.rs
+++ b/src/unknown/component.rs
@@ -4,7 +4,7 @@
// Copyright (c) 2018 Guillaume Gomez
//
-use ComponentExt;
+use crate::ComponentExt;
/// Dummy struct representing a component.
pub struct... | 6 | 24 | 25 |
1ea6e9717f6392afb6ef23782d3a948bf0a17f02 | Guillaume Gomez | 2021-05-07T13:48:25 | Upgrade crate version to 0.17.3 | diff --git a/Cargo.toml b/Cargo.toml
index 1ff49b2..67cc5aa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.2"
+version = "0.17.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
d2712f07dc70b85451f28a93d78048239080d0c7 | Guillaume Gomez | 2021-05-07T13:16:01 | Remove manual struct definition and use libc one | diff --git a/Cargo.toml b/Cargo.toml
index 88423a4..1ff49b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ winapi = { version = "0.3.9", features = ["fileapi", "handleapi", "ifdef", "ioap
ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
-libc = "^0.2.92"... | 3 | 4 | 14 |
b68853b2b90ab4763843232f266832e0dca3f0bd | Guillaume Gomez | 2021-05-07T11:56:30 | Update winapi version and remove FFI defined items | diff --git a/Cargo.toml b/Cargo.toml
index c3f17eb..88423a4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@ doc-comment = "0.3"
once_cell = "1.0"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["fileapi", "handleapi", "ifdef", "ioapiset", "minwindef", "pdh", "psapi", "syncha... | 6 | 20 | 270 |
7a3bfeaba80761536b80af7d2bacf2a928a19867 | Guillaume Gomez | 2021-04-29T12:05:37 | Fix new clippy lint | diff --git a/src/windows/component.rs b/src/windows/component.rs
index 16d0660..6607f8b 100644
--- a/src/windows/component.rs
+++ b/src/windows/component.rs
@@ -321,13 +321,14 @@ impl Connection {
unsafe {
(*p_obj).BeginEnumeration(WBEM_FLAG_NONSYSTEM_ONLY as _);
- let mut p_val: VARI... | 3 | 16 | 9 |
ddbb2e47629330bebb75402294cfb569d9114a46 | Guillaume Gomez | 2021-04-22T17:31:14 | Upgrade crate version to 0.17.2 | diff --git a/Cargo.toml b/Cargo.toml
index fda81c5..c3f17eb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.1"
+version = "0.17.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
7bc9e045f8064db6943b276b10d1624a160f1833 | Guillaume Gomez | 2021-04-22T15:57:55 | Add test to enforce the return value of System::refresh_process | diff --git a/src/lib.rs b/src/lib.rs
index f3f413a..ba0ad77 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -291,6 +291,20 @@ mod test {
.is_empty());
}
}
+
+ #[test]
+ fn check_refresh_process_return_value() {
+ // We don't want to test on unknown systems.
+ if MIN_USERS ... | 1 | 14 | 0 |
41e7fc01890ce805b0cb19586d4234fde5808ce9 | Joshua Koo | 2021-04-19T17:28:43 | Fix bug in linux's refresh_process()
refresh_process(pid) is called for the first time, the linux implementation returns false when a process is not cached which is incorrect.
compare that with the mac and windows version which returns true.
windows: https://github.com/GuillaumeGomez/sysinfo/blob/58b31e3a5d2821f... | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 1d01ba3..3f394fb 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -347,7 +347,7 @@ impl SystemExt for System {
) {
Ok((Some(p), pid)) => {
self.process_list.tasks.insert(pid, p);
- false
+ ... | 1 | 1 | 1 |
d958d79381fc102a5587585f420546a6860ca077 | Guillaume Gomez | 2021-04-16T14:19:43 | Upgrade crate version to 0.17.1 | diff --git a/Cargo.toml b/Cargo.toml
index 8e05c0b..fda81c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.17.0"
+version = "0.17.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
ae1707b7c5db69672055c1cb9cf0d8fc59da2c60 | Guillaume Gomez | 2021-04-16T14:06:08 | Add PID command | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 54a244b..a17dc3c 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -136,7 +136,11 @@ fn print_help() {
&mut io::stdout(),
"system : Displays system information (such as name, version and hostname)"
);... | 1 | 16 | 3 |
ce801e42eae91786a11d464e45e8bd95bcbf0def | Guillaume Gomez | 2021-04-16T12:07:23 | Remove time limitation for CPU usage on windows | diff --git a/src/traits.rs b/src/traits.rs
index 15081dd..01d3b67 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -283,10 +283,14 @@ pub trait ProcessExt: Debug {
/// ```
fn start_time(&self) -> u64;
- /// Returns the total CPU usage (in %). Notice that it might be bigger than 100 if run on a multicore... | 2 | 39 | 72 |
8224e8049c7d3e3fc64265a124bf82f3300720e2 | Sebastián Felgueras | 2021-04-14T01:58:49 | fixed cpu_usage on windows, and improved the documentation of the method | diff --git a/src/traits.rs b/src/traits.rs
index 8a3e66b..15081dd 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -283,7 +283,10 @@ pub trait ProcessExt: Debug {
/// ```
fn start_time(&self) -> u64;
- /// Returns the total CPU usage (in %).
+ /// Returns the total CPU usage (in %). Notice that it mi... | 2 | 121 | 33 |
9735d905b07cfcd30502ae50d23b8346e99bc77e | Guillaume Gomez | 2021-04-14T17:53:42 | Fix some lint warnings | diff --git a/src/lib.rs b/src/lib.rs
index a944200..f3f413a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -50,10 +50,9 @@
#![crate_name = "sysinfo"]
#![crate_type = "lib"]
#![crate_type = "rlib"]
+#![allow(unknown_lints)]
#![deny(missing_docs)]
#![deny(broken_intra_doc_links)]
-//#![deny(warnings)]
-#![allow(unknown... | 1 | 2 | 2 |
e858fdc3ed512be96acc9399e79321d5ed2f29d1 | Patrick José Pereira | 2021-04-14T16:14:58 | src: lib: Add test for usage usage
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com> | diff --git a/src/lib.rs b/src/lib.rs
index 5902f4f..a944200 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -191,6 +191,32 @@ mod test {
);
}
+ #[cfg(target_os = "linux")]
+ #[test]
+ fn check_cpu_usage() {
+ let mut s = System::new();
+
+ s.refresh_all();
+ // All CPU usage wi... | 1 | 26 | 0 |
0e2735d7996f1748d7698f1718f037aae7022f03 | Patrick José Pereira | 2021-04-14T16:13:56 | linux: process: Check for old values before updating cpu_usage
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com> | diff --git a/src/linux/process.rs b/src/linux/process.rs
index b0ac4c5..dd78457 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -244,6 +244,11 @@ impl Drop for Process {
}
pub fn compute_cpu_usage(p: &mut Process, nb_processors: u64, total_time: f32) {
+ // First time updating the values without ... | 1 | 5 | 0 |
7194163d46640862fccc3c6fdf258d0a6efd453b | Patrick José Pereira | 2021-04-14T14:26:35 | linux: system: Fetch process name from stat
Command line does not exist for kernel process.
A more reliable approach is to fetch the process name
from the stat file, where it exists under the second string
inside parenthesis.
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com> | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 99df625..1d01ba3 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -756,12 +756,14 @@ fn parse_stat_file(data: &str) -> Result<Vec<&str>, ()> {
let mut parts = Vec::with_capacity(52);
let mut data_it = data.splitn(2, ' ');
parts.pus... | 1 | 6 | 30 |
c5773a197f702b1c616d5879a8027f499f32ded4 | Jason Ozias | 2021-04-13T18:59:57 | fix clippy error | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 1b40c38..99df625 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -211,7 +211,6 @@ impl System {
vendor_id.clone(),
brand.clone(),
));
- i += 1;
... | 1 | 1 | 2 |
bc9cc6469311f1795b0a33a1c1511ce040f3241f | Jason Ozias | 2021-04-13T18:15:52 | formatting | diff --git a/src/apple/users.rs b/src/apple/users.rs
index 8e7437f..37ead2d 100644
--- a/src/apple/users.rs
+++ b/src/apple/users.rs
@@ -64,7 +64,7 @@ where
break;
}
- if !filter(unsafe { (*pw).pw_shell}, unsafe { (*pw).pw_uid }) {
+ if !filter(unsafe { (*pw).pw_shell }, unsafe { (... | 1 | 4 | 2 |
e23f82b34f958d9a40abbcadaf9084c7aab4b19b | Jason Ozias | 2021-04-13T18:11:11 | first attempt at filtering out external users | diff --git a/src/apple/users.rs b/src/apple/users.rs
index 4ca1499..8e7437f 100644
--- a/src/apple/users.rs
+++ b/src/apple/users.rs
@@ -53,7 +53,7 @@ fn endswith(s1: *const c_char, s2: &[u8]) -> bool {
fn users_list<F>(filter: F) -> Vec<User>
where
- F: Fn(*const c_char) -> bool,
+ F: Fn(*const c_char, u32) ... | 1 | 6 | 4 |
2740a34020e461bd521bb7f66eecb3e96ee06b0f | Guillaume Gomez | 2021-04-08T19:08:59 | Upgrade crate version to 0.17.0 | diff --git a/Cargo.toml b/Cargo.toml
index 8aa4316..8e05c0b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.16.5"
+version = "0.17.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, pro... | 1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.