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 |
|---|---|---|---|---|---|---|---|
751c348f6cedc5e0c48b699d6ea34e221012c05d | Guillaume Gomez | 2020-01-26T21:49:06 | Clean up mac interface | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index eabc5f4..9386827 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -84,7 +84,7 @@ extern "C" {
pub fn vm_deallocate(target_task: u32, address: *mut i32, size: u32) -> kern_return_t;
pub fn sysctlbyname(
name: *const c_char,
- oldp: *mut u64,... | 5 | 74 | 24 |
159022d179c9433d2bdeb01e22d2bd469c7f0bee | Guillaume Gomez | 2020-01-26T21:24:52 | Clean up linux new methods | diff --git a/src/linux/mod.rs b/src/linux/mod.rs
index 6ce307c..9238248 100644
--- a/src/linux/mod.rs
+++ b/src/linux/mod.rs
@@ -15,5 +15,5 @@ pub use self::component::Component;
pub use self::disk::{Disk, DiskType};
pub use self::network::NetworkData;
pub use self::process::{Process, ProcessStatus};
-pub use self::... | 8 | 116 | 132 |
1473e52e1d0dea18633b95af30796cc7cf8eda0a | Nick Cameron | 2020-01-22T18:52:12 | Add get_vendor_id function
Signed-off-by: Nick Cameron <nick@ncameron.org> | diff --git a/src/linux/mod.rs b/src/linux/mod.rs
index 913a1c9..6ce307c 100644
--- a/src/linux/mod.rs
+++ b/src/linux/mod.rs
@@ -15,5 +15,5 @@ pub use self::component::Component;
pub use self::disk::{Disk, DiskType};
pub use self::network::NetworkData;
pub use self::process::{Process, ProcessStatus};
-pub use self::... | 9 | 40 | 6 |
b57d44d2b92318ed1911354a4d74304b354ffa37 | Nick Cameron | 2020-01-22T18:51:47 | Fix io issue with modern Linux versions
Signed-off-by: Nick Cameron <nick@ncameron.org> | diff --git a/src/io.rs b/src/io.rs
index 05bdc33..ae6debd 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -68,7 +68,7 @@ impl IOLoad {
.split_whitespace()
.map(|w| w.parse().unwrap_or_default())
.collect::<Vec<f64>>();
- if parts.le... | 1 | 1 | 1 |
97922cb9e3224494744d21b6881131c716265f36 | Lonng | 2019-12-04T08:44:50 | wrap num_cpus/pnet_datalink/cache_size crates
Signed-off-by: Lonng <heng@lonng.org> | diff --git a/Cargo.toml b/Cargo.toml
index 425b684..016327e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,9 @@ cfg-if = "0.1"
rayon = "^1.0"
doc-comment = "0.3"
walkdir = "2.2.9"
+pnet_datalink = "0.23.0"
+num_cpus = "1.11.1"
+cache-size = "0.4.0"
[target.'cfg(windows)'.dependencies]
winapi = { version =... | 2 | 32 | 1 |
1f52533aeebab1b724f7abd7d8b0728c3039e1da | Lonng | 2019-12-03T11:21:12 | support retrieve system wide configuration list
Signed-off-by: Lonng <heng@lonng.org> | diff --git a/Cargo.toml b/Cargo.toml
index dfdf9be..425b684 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,7 @@ build = "build.rs"
cfg-if = "0.1"
rayon = "^1.0"
doc-comment = "0.3"
+walkdir = "2.2.9"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioap... | 2 | 32 | 0 |
776ff789ec77c560ee8309dacc330c5ad21ee45b | Lonng | 2019-12-03T09:02:14 | support retrieve block device IO statistics
Signed-off-by: Lonng <heng@lonng.org> | diff --git a/src/io.rs b/src/io.rs
new file mode 100644
index 0000000..05bdc33
--- /dev/null
+++ b/src/io.rs
@@ -0,0 +1,93 @@
+use std::collections::HashMap;
+use std::fs::File;
+use std::io::Read;
+
+/// IOLoad represents current system block devices IO statistics
+#[derive(Debug)]
+pub struct IOLoad {
+ /// number... | 3 | 103 | 3 |
b33d66e149a5d908179cbacb33a6ea65e3483b87 | Lonng | 2019-12-03T08:09:39 | support retrieve network statistics
Signed-off-by: Lonng <heng@lonng.org> | diff --git a/src/net.rs b/src/net.rs
new file mode 100644
index 0000000..6abd848
--- /dev/null
+++ b/src/net.rs
@@ -0,0 +1,72 @@
+use std::collections::HashMap;
+
+/// NICLoad represents the network interface card load informations
+#[derive(Debug)]
+pub struct NICLoad {
+ /// a total number of bytes received over i... | 2 | 79 | 0 |
7300479663d6985e6c7d910f065f42df086d643a | Lonng | 2019-12-03T06:40:39 | add functions get_cpu_frequency/get_avg_load
Signed-off-by: Lonng <heng@lonng.org> | diff --git a/src/linux/mod.rs b/src/linux/mod.rs
index 9238248..913a1c9 100644
--- a/src/linux/mod.rs
+++ b/src/linux/mod.rs
@@ -15,5 +15,5 @@ pub use self::component::Component;
pub use self::disk::{Disk, DiskType};
pub use self::network::NetworkData;
pub use self::process::{Process, ProcessStatus};
-pub use self::... | 10 | 140 | 5 |
34bba033fe8dc23410fdc3bec02e6e95f3e11132 | Guillaume Gomez | 2020-01-17T09:51:21 | Fix FD limiter | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 42b9e79..9002ed2 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -37,7 +37,7 @@ pub(crate) static mut REMAINING_FILES: once_cell::sync::Lazy<Arc<Mutex<isize>>>
{
// The constant "RLIMIT_NOFILE" doesn't exist on Android so w... | 1 | 9 | 8 |
d5e47eaa1fca510a442f966cb13e1313dcf87b3f | Guillaume Gomez | 2020-01-15T09:45:12 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 504960f..dfdf9be 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.10.4"
+version = "0.10.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
289636e2d8c876639962df5e537755efbacf2b7a | Guillaume Gomez | 2020-01-14T09:59:24 | Allow to set the open files limit, reduce the limit of maximum open files to half of the system maximum | diff --git a/src/linux/system.rs b/src/linux/system.rs
index ce21a58..42b9e79 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -31,13 +31,13 @@ use rayon::prelude::*;
// This whole thing is to prevent having too much files open at once. It could be problematic
// for processes using a lot of files and ... | 2 | 67 | 8 |
223a5f5e1fcad115206097042800c2732d41e5af | Guillaume Gomez | 2020-01-06T02:40:27 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 9bb39fc..504960f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.10.3"
+version = "0.10.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
e85f719eaa0ac5fa01fe1481ad7299a696a34591 | Guillaume Gomez | 2020-01-06T00:41:49 | Fix race condition on disk types | diff --git a/Cargo.toml b/Cargo.toml
index 8865632..9bb39fc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
libc = "0.2"
-[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
+[target.'cfg(unix)... | 2 | 20 | 41 |
4a8e0f897c39af309390166b32026ea1268b0457 | Guillaume Gomez | 2020-01-06T00:35:01 | Greatly improve refresh_processes performance and get more processes info | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index b53c24b..73a82df 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -17,10 +17,11 @@ extern "C" {
buffersize: c_int,
) -> c_int;
pub fn proc_listallpids(buffer: *mut c_void, buffersize: c_int) -> c_int;
+ //pub fn proc_listpids(kind: u32, x: u32,... | 3 | 74 | 111 |
ed3d68d4f5e2bfa46893fbcba8546b26d8844227 | Guillaume Gomez | 2020-01-05T21:44:14 | Move functions after struct declaration | diff --git a/src/mac/process.rs b/src/mac/process.rs
index 2b6cbc1..004e607 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -17,8 +17,8 @@ use libc::{c_int, c_void, gid_t, kill, size_t, uid_t};
use Pid;
use ProcessExt;
-use sys::system::Wrap;
use sys::ffi;
+use sys::system::Wrap;
/// Enum describing... | 2 | 99 | 99 |
a08d67d303571f3674f46ce6795ca683e1e24f3b | Guillaume Gomez | 2020-01-05T21:37:03 | Clean up process source code | diff --git a/src/mac/process.rs b/src/mac/process.rs
index a8271c6..2b6cbc1 100644
--- a/src/mac/process.rs
+++ b/src/mac/process.rs
@@ -4,14 +4,22 @@
// Copyright (c) 2015 Guillaume Gomez
//
+use std::borrow::Borrow;
+use std::ffi::OsStr;
use std::fmt::{self, Debug, Formatter};
+use std::mem;
+use std::ops::Deref... | 2 | 326 | 323 |
a82f57488a69a4d756fb3294770b53261dab8806 | Guillaume Gomez | 2020-01-05T18:00:49 | Move disk code into its own file | diff --git a/src/mac/disk.rs b/src/mac/disk.rs
index 5a1d6d6..70d0261 100644
--- a/src/mac/disk.rs
+++ b/src/mac/disk.rs
@@ -7,11 +7,18 @@
use utils;
use DiskExt;
-use libc::statfs;
+use libc::{c_char, c_void, statfs};
+use std::cell::RefCell;
+use std::collections::HashMap;
use std::ffi::{OsStr, OsString};
use s... | 2 | 179 | 178 |
6c8c5d4ba7c01dc2f2a8f5af163fe54b30bf0df9 | Guillaume Gomez | 2020-01-05T17:51:31 | Clean up temperature source code | diff --git a/src/mac/component.rs b/src/mac/component.rs
index b180cf2..85c9ac3 100644
--- a/src/mac/component.rs
+++ b/src/mac/component.rs
@@ -15,14 +15,33 @@ pub(crate) const COMPONENTS_TEMPERATURE_IDS: &[(&str, &[i8])] = &[
("Battery", &['T' as i8, 'B' as i8, '0' as i8, 'T' as i8]), // Battery "TB0T"
];
+pu... | 2 | 30 | 11 |
36a134aaf2cb7ea4b12e79d46a0417ed961f67ae | Guillaume Gomez | 2020-01-05T17:45:17 | Greatly improve refresh_temperatures | diff --git a/src/mac/component.rs b/src/mac/component.rs
index 90fba0b..b180cf2 100644
--- a/src/mac/component.rs
+++ b/src/mac/component.rs
@@ -10,9 +10,9 @@ use sys::ffi;
use ComponentExt;
pub(crate) const COMPONENTS_TEMPERATURE_IDS: &[(&str, &[i8])] = &[
- ("CPU", &['T' as i8, 'C' as i8, '0' as i8, 'P' as i8,... | 3 | 43 | 22 |
0053c90c076228fd4899498212c29fd322aaf9b6 | Guillaume Gomez | 2020-01-05T16:08:14 | Code cleanup | diff --git a/src/mac/component.rs b/src/mac/component.rs
index 8694f42..90fba0b 100644
--- a/src/mac/component.rs
+++ b/src/mac/component.rs
@@ -4,24 +4,50 @@
// Copyright (c) 2018 Guillaume Gomez
//
+use libc::{c_char, c_int, c_void};
+use std::mem;
+use sys::ffi;
use ComponentExt;
+pub(crate) const COMPONENTS_... | 3 | 145 | 175 |
a1805b144197fddb7021db5c4c59c14e162c5a94 | Guillaume Gomez | 2020-01-05T13:31:41 | Code cleanup and great performance improvement on refresh_disk_list | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 4ef0f82..e61b350 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -149,7 +149,11 @@ impl ProcessExt for Process {
uid: 0,
gid: 0,
status: ProcessStatus::Unknown(0),
- tasks: if pid == 0 { Hash... | 4 | 285 | 155 |
041d57df202b7708c9ea90c54e4d75562fd9136f | Guillaume Gomez | 2020-01-04T21:47:15 | Only add once_cell dependency for linux | diff --git a/Cargo.toml b/Cargo.toml
index 9bb39fc..8865632 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
libc = "0.2"
-[target.'cfg(unix)'.dependencies]
+[target.'cfg(all(unix, not(target_os = "macos")))... | 1 | 1 | 1 |
ca15f6c3f41927cb1e0a36be2f2f469daf8d1a5f | Guillaume Gomez | 2020-01-04T17:59:01 | Handle Android separately for REMANING_FILES initialization | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 3cad843..4c30d2e 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -32,27 +32,36 @@ use rayon::prelude::*;
// This whole thing is to prevent having too much files open at once. It could be problematic
// for processes using a lot of files and us... | 1 | 29 | 20 |
137ea0d7c66df61f9efdf42fb789ecceb35a64e3 | Guillaume Gomez | 2020-01-04T17:07:10 | Replace Vec::new and HashMap::new calls with with_capacity when possible | diff --git a/src/linux/component.rs b/src/linux/component.rs
index f23b738..ce2b517 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -44,7 +44,7 @@ fn is_file<T: AsRef<Path>>(path: T) -> bool {
}
fn append_files(components: &mut Vec<Component>, folder: &Path) {
- let mut matchings: HashMap<u32... | 2 | 13 | 11 |
c8f0440d298f9fec2fe9032c4571fa5e1047d5c8 | Guillaume Gomez | 2020-01-04T16:52:25 | Limit potential number of open files at the same time | diff --git a/Cargo.toml b/Cargo.toml
index ed6a8de..9bb39fc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,9 @@ ntapi = "0.3"
[target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies]
libc = "0.2"
+[target.'cfg(unix)'.dependencies]
+once_cell = "1.0"
+
[lib]
name = "sysinfo"
cra... | 4 | 108 | 38 |
612729eae60f2027dc08020875625ee23fce253a | Guillaume Gomez | 2019-12-16T22:31:43 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 919af42..ed6a8de 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.10.2"
+version = "0.10.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
f6c775eabda26290336cd220c53d0190e4337c9e | Guillaume Gomez | 2019-12-16T22:19:25 | remove commented code | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 7f24c05..c7af4dc 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -642,10 +642,6 @@ fn copy_from_file(entry: &Path) -> Vec<String> {
}
}
out
- /*data.split(|x| *x == b'\0')
- ... | 2 | 0 | 6 |
c847d83305f38b392fc8e637e0d8163165179dc6 | Guillaume Gomez | 2019-12-16T22:18:30 | Keep stat File open and fix environment variables get | diff --git a/src/linux/process.rs b/src/linux/process.rs
index 202448a..390ef45 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -98,7 +98,6 @@ impl fmt::Display for ProcessStatus {
}
/// Struct containing a process' information.
-#[derive(Clone)]
pub struct Process {
pub(crate) name: String,
... | 2 | 57 | 91 |
6aa9a51cf206356f5338cd35d21f9218ee2b014a | Guillaume Gomez | 2019-12-16T20:18:10 | more tests | diff --git a/src/linux/disk.rs b/src/linux/disk.rs
index e3795dd..9df169b 100644
--- a/src/linux/disk.rs
+++ b/src/linux/disk.rs
@@ -51,7 +51,8 @@ fn find_type_for_name(name: &OsStr) -> DiskType {
.to_owned()
.join(trimmed)
.join("queue/rotational");
- let rotational_int = get_all_data(pat... | 3 | 30 | 30 |
c3461af63a8688e07811dd808e295c8b4baecba0 | Guillaume Gomez | 2019-12-16T19:02:39 | refresh status for existing processes as well | diff --git a/src/linux/system.rs b/src/linux/system.rs
index fdcda28..3e93d20 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -477,6 +477,15 @@ fn _get_process_data(
Some(Ok(nb)) if nb != pid => nb,
_ => return Err(()),
};
+
+ let get_status = |p: &mut Process, part: &str| {
+ ... | 1 | 11 | 5 |
b64eced5d0fce9ba4e3198f0a37f0dbab5e160af | Guillaume Gomez | 2019-12-11T23:36:11 | new attempt | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 9464b44..f2fd8c1 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -14,7 +14,7 @@ use sys::NetworkData;
use Pid;
use {DiskExt, ProcessExt, RefreshKind, SystemExt};
-use libc::{sysconf, uid_t, _SC_CLK_TCK, _SC_PAGESIZE};
+use libc::{sysconf, gi... | 1 | 97 | 56 |
d03a8a275475d108e71cf03d379e73ecced90dfd | Guillaume Gomez | 2019-12-11T22:37:56 | Clean up linux code | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 8213fda..9464b44 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -54,7 +54,7 @@ impl System {
if !self.processors.is_empty() {
let (new, old) = get_raw_times(&self.processors[0]);
let total_time = (if old > new... | 1 | 140 | 143 |
6f523f82eac0a7266c72151b8088a0178f85fad8 | Ashley | 2019-12-14T17:05:28 | Support wasi | diff --git a/Cargo.toml b/Cargo.toml
index f0cde00..919af42 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,7 +21,7 @@ doc-comment = "0.3"
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "winbase", "winerror", "winioctl", "winnt", "olea... | 4 | 11 | 11 |
522b1dca3494b8032a405d4ac81540d1b0da5e64 | Guillaume Gomez | 2019-12-13T18:11:31 | Fix doc example | diff --git a/src/traits.rs b/src/traits.rs
index e2773ae..54f1447 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -138,7 +138,7 @@ pub trait SystemExt: Sized {
/// // If you want the disks list afterwards, just call the corresponding
/// // "refresh_disk_list":
/// system.refresh_disk_list();
- /// ... | 1 | 1 | 1 |
f7cff91d4d6faf96c3c981e1833f8ee9d1be7ea4 | Guillaume Gomez | 2019-12-10T17:33:14 | Add more benchmarks | diff --git a/benches/basic.rs b/benches/basic.rs
index 407c877..6fae247 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -77,3 +77,30 @@ fn bench_refresh_network(b: &mut test::Bencher) {
s.refresh_network();
});
}
+
+#[bench]
+fn bench_refresh_memory(b: &mut test::Bencher) {
+ let mut s = sysin... | 1 | 27 | 0 |
a5a524bafb759adb0d08196d12873809989a4850 | GuillaumeGomez | 2019-12-10T00:17:14 | Upgrade version | diff --git a/Cargo.toml b/Cargo.toml
index 5708353..f0cde00 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.10.1"
+version = "0.10.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
5e147e644c27a454c5ca990c8e93b8430229cb24 | GuillaumeGomez | 2019-12-10T00:12:55 | clean temperatures code | diff --git a/src/windows/component.rs b/src/windows/component.rs
index 0b44561..b6c7c04 100644
--- a/src/windows/component.rs
+++ b/src/windows/component.rs
@@ -4,24 +4,74 @@
// Copyright (c) 2018 Guillaume Gomez
//
+use std::ptr::null_mut;
+
+use winapi::shared::rpcdce::{RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_... | 2 | 130 | 119 |
4597f39c5a6b0d974138b9a2420e4db11cbb8d46 | GuillaumeGomez | 2019-12-09T23:06:10 | Working version | diff --git a/src/windows/component.rs b/src/windows/component.rs
index 2c50e72..0b44561 100644
--- a/src/windows/component.rs
+++ b/src/windows/component.rs
@@ -67,17 +67,18 @@ use winapi::um::combaseapi::{CoCreateInstance, CoInitializeEx, CoUninitialize, C
use winapi::um::objbase::COINIT_MULTITHREADED;
use winapi::u... | 1 | 51 | 25 |
4afec8513baeaea05181f91e9ef0e16bb04f5f95 | GuillaumeGomez | 2019-12-09T00:15:54 | Start implementation to get temperatures | diff --git a/Cargo.toml b/Cargo.toml
index e86463d..5708353 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ rayon = "^1.0"
doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinf... | 2 | 271 | 1 |
ffb273d62b90ce5bf74bee2163e458f7ef460fd1 | GuillaumeGomez | 2019-12-07T16:03:26 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 77cded6..e86463d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.10.0"
+version = "0.10.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
020b7ad01f40356557e4b3924c1d871bc233eb70 | GuillaumeGomez | 2019-12-07T16:02:52 | Improve disks API speed | diff --git a/src/windows/system.rs b/src/windows/system.rs
index 203a0df..83012da 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -368,9 +368,9 @@ impl SystemExt for System {
}
fn refresh_disks(&mut self) {
- for disk in &mut self.disks {
+ self.disks.par_iter_mut().for_each(... | 2 | 117 | 117 |
f9c4dd011f6388c387340a227d9de67d3ad0ec2d | GuillaumeGomez | 2019-12-07T15:44:05 | Remove unneeded winapi feature | diff --git a/Cargo.toml b/Cargo.toml
index 5c5bedb..77cded6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,7 @@ rayon = "^1.0"
doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinf... | 1 | 1 | 1 |
055c6ba81e9eb8d1c964286e92cdb418073b5b57 | GuillaumeGomez | 2019-12-07T15:36:45 | Improve process name getter | diff --git a/src/windows/system.rs b/src/windows/system.rs
index 7cf9559..203a0df 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -328,14 +328,7 @@ impl SystemExt for System {
proc_.updated = true;
return None;
}
- ... | 1 | 23 | 9 |
535bafabaafd9a109bf332b5d24680aeb1212bcc | GuillaumeGomez | 2019-12-07T15:28:16 | Don't get system time more than necessary | diff --git a/src/windows/process.rs b/src/windows/process.rs
index 37a4491..8b6ac64 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -509,7 +509,7 @@ unsafe fn get_proc_env(_handle: HANDLE, _pid: u32, _name: &str) -> Vec<String> {
ret
}
-pub fn get_executable_path(_pid: Pid) -> PathBuf {
+pub... | 2 | 19 | 11 |
ea42fb4533d2efa91694f2bc2c5d0f963d2cc227 | GuillaumeGomez | 2019-12-07T00:56:56 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 03d747e..5c5bedb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.6"
+version = "0.10.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
ac315a038bf6953173f83a8a96d67d5dba569bc5 | GuillaumeGomez | 2019-12-07T00:38:07 | Greatly improve windows performance | diff --git a/Cargo.toml b/Cargo.toml
index 4081c2a..03d747e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,6 +19,7 @@ doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioapiset", "minwindef", "pdh", "psapi", "synchapi", "sysinfoapi", "tlhelp32... | 5 | 257 | 137 |
dd520a8df3d2c94104ec87758f5bd92aa40f6a5b | Guillaume Gomez | 2019-12-05T22:38:25 | fix RefreshKind examples | diff --git a/src/common.rs b/src/common.rs
index d7891a2..a80b596 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -131,11 +131,13 @@ impl RefreshKind {
///
/// let r = RefreshKind::new();
///
- /// assert_eq!(r.system(), false);
/// assert_eq!(r.network(), false);
/// assert_eq!(r.processe... | 1 | 6 | 2 |
baaf33399d8c70fb53759a8b786d6339fbcef198 | Guillaume Gomez | 2019-12-05T22:32:51 | Add new refresh methods for unknown | diff --git a/src/unknown/system.rs b/src/unknown/system.rs
index bf2e90b..14ed598 100644
--- a/src/unknown/system.rs
+++ b/src/unknown/system.rs
@@ -29,7 +29,11 @@ impl SystemExt for System {
}
}
- fn refresh_system(&mut self) {}
+ fn refresh_memory(&mut self) {}
+
+ fn refresh_cpu(&mut self) {... | 1 | 5 | 1 |
494ea162c6443c7d2c873e15eef09081736f4ff5 | Guillaume Gomez | 2019-12-05T22:31:57 | Add new refresh methods for windows | diff --git a/src/windows/system.rs b/src/windows/system.rs
index ab29d21..83d3d27 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -248,16 +248,7 @@ impl SystemExt for System {
s
}
- fn refresh_system(&mut self) {
- unsafe {
- let mut mem_info: MEMORYSTATUSEX = zero... | 1 | 18 | 10 |
a1c2466f9728fc0802f1f2a1b4d5974685a909fb | Guillaume Gomez | 2019-12-05T22:29:01 | Add new refresh methods for mac | diff --git a/src/mac/system.rs b/src/mac/system.rs
index f697e98..80071bc 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -637,6 +637,25 @@ fn get_arg_max() -> usize {
}
}
+unsafe fn get_sys_value(
+ high: u32,
+ low: u32,
+ mut len: usize,
+ value: *mut c_void,
+ mib: &mut [i32; 2],
+)... | 1 | 33 | 21 |
28458b3d8b37f9b93524fdb544b8d466ae0016a4 | Guillaume Gomez | 2019-12-05T22:17:23 | Add new refresh functions for the C interface | diff --git a/src/c_interface.rs b/src/c_interface.rs
index 2592f3b..d144c35 100644
--- a/src/c_interface.rs
+++ b/src/c_interface.rs
@@ -46,6 +46,42 @@ pub extern "C" fn sysinfo_refresh_system(system: CSystem) {
Box::into_raw(system);
}
+/// Equivalent of `System::refresh_memory()`.
+#[no_mangle]
+pub extern "C... | 1 | 36 | 0 |
45d7d54f2d5e992270b7a1d074c15b65c0a05132 | Guillaume Gomez | 2019-12-05T22:14:25 | Implement new refresh functions for linux | diff --git a/src/linux/system.rs b/src/linux/system.rs
index b8c6934..8213fda 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -145,11 +145,8 @@ impl SystemExt for System {
s
}
- fn refresh_system(&mut self) {
+ fn refresh_memory(&mut self) {
self.uptime = get_uptime();
- ... | 1 | 11 | 4 |
acd082b141741283f6f84b80b587f57c1bfdc77d | Guillaume Gomez | 2019-12-05T22:05:26 | Add more specific refresh methods | diff --git a/src/common.rs b/src/common.rs
index 5224699..d7891a2 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -112,11 +112,13 @@ assert_eq!(r.", stringify!($name), "(), false);
/// ```
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct RefreshKind {
- system: bool,
network: bool,
processes: b... | 2 | 41 | 7 |
01e0c7339348a9100ac3ab13b7511af159fd042d | Guillaume Gomez | 2019-12-05T17:11:15 | Add specific path to get raspberry pi CPU temperature | diff --git a/src/linux/component.rs b/src/linux/component.rs
index 4568910..f23b738 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -8,7 +8,7 @@ use ComponentExt;
use std::collections::HashMap;
use std::ffi::OsStr;
-use std::fs::{read_dir, File};
+use std::fs::{metadata, read_dir, File};
use st... | 1 | 61 | 42 |
905e9abbe6d27fd09255a1f0dc19a13409237cde | Guillaume Gomez | 2019-11-25T22:19:30 | Replace some String::new() calls with String::with_capacity | diff --git a/src/linux/component.rs b/src/linux/component.rs
index ce13a6c..4568910 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -23,8 +23,8 @@ pub struct Component {
input_file: PathBuf,
}
-fn get_file_line(file: &Path) -> Option<String> {
- let mut reader = String::new();
+fn get_fil... | 2 | 9 | 9 |
2e1fff9f1e8d9c572e1d0faee214b2c526fcce12 | Shane Lillie | 2019-11-20T02:55:29 | Don't blindly progress past errors... | diff --git a/src/windows/system.rs b/src/windows/system.rs
index b8ba69a..ab29d21 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -175,68 +175,69 @@ impl SystemExt for System {
};
if status != PDH_MORE_DATA as i32 {
eprintln!("PdhEnumObjectItems i... | 1 | 62 | 61 |
4515c3c233cd4d5118f29ff06d91cd2580930880 | Shane Lillie | 2019-11-20T02:19:01 | Replace Windows panic's with print output
Make sure that Windows InternalQuery cleans up when dropped | diff --git a/src/windows/processor.rs b/src/windows/processor.rs
index 18df24c..0b1ef53 100644
--- a/src/windows/processor.rs
+++ b/src/windows/processor.rs
@@ -14,9 +14,10 @@ use windows::tools::KeyHandler;
use winapi::shared::minwindef::{FALSE, ULONG};
use winapi::shared::winerror::ERROR_SUCCESS;
+use winapi::um:... | 2 | 27 | 5 |
dee88161aadf9890ef0a894d197d6424f6493503 | Guillaume Gomez | 2019-11-19T20:46:54 | Improve C interface documentation | diff --git a/src/c_interface.rs b/src/c_interface.rs
index f4e9cb5..bb11b0e 100644
--- a/src/c_interface.rs
+++ b/src/c_interface.rs
@@ -25,14 +25,14 @@ pub extern "C" fn sysinfo_init() -> CSystem {
Box::into_raw(system) as CSystem
}
-/// Equivalent of `System::drop`. Important in C to cleanup memory.
+/// Equi... | 1 | 27 | 27 |
76d804a28dbb33cabb924b73bbfea236814d9093 | Shane Lillie | 2019-11-19T18:53:06 | Add process virtual memory usage | diff --git a/src/linux/process.rs b/src/linux/process.rs
index d3deadd..26b420c 100644
--- a/src/linux/process.rs
+++ b/src/linux/process.rs
@@ -108,6 +108,7 @@ pub struct Process {
pub(crate) cwd: PathBuf,
pub(crate) root: PathBuf,
pub(crate) memory: u64,
+ pub(crate) virtual_memory: u64,
utime:... | 7 | 47 | 8 |
637a9337f174eba162830a28e10e2ff1085559e0 | Guillaume Gomez | 2019-11-07T15:53:15 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index df0091c..4081c2a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.5"
+version = "0.9.6"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
8263ccba0ada1c99228d1dbe0dc7ba574d121325 | Lee Fitchett | 2019-11-07T09:05:42 | Add disk support for Raspbian (#205)
Add root and mmcblk to linux included disks | diff --git a/src/linux/system.rs b/src/linux/system.rs
index d3e57a6..1d0c070 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -1,6 +1,6 @@
-//
+//
// Sysinfo
-//
+//
// Copyright (c) 2015 Guillaume Gomez
//
@@ -566,9 +566,13 @@ fn get_all_disks() -> Vec<Disk> {
//
// In so... | 1 | 8 | 4 |
d22c3cdb59af8a222159996893250b9fe55ab893 | Guillaume Gomez | 2019-10-10T19:59:10 | Fix doc url | diff --git a/src/linux/component.rs b/src/linux/component.rs
index bae4bf1..c1defdb 100644
--- a/src/linux/component.rs
+++ b/src/linux/component.rs
@@ -12,8 +12,9 @@ use std::fs::{File, read_dir};
use std::io::Read;
use std::path::{Path, PathBuf};
-/// More information can be found at
-/// <http://lxr.free-electro... | 1 | 3 | 2 |
09f8eae6dbd0a07736c98c449725c685d00a1de5 | Guillaume Gomez | 2019-09-08T13:25:20 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 60a3db1..df0091c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.4"
+version = "0.9.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
1b57bfa83fe4123ed2e796f0931e392edcf08408 | Guillaume Gomez | 2019-09-08T13:04:21 | remove warning | diff --git a/src/mac/system.rs b/src/mac/system.rs
index 2debfe5..e82c001 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -226,7 +226,7 @@ fn get_disk_types() -> HashMap<OsString, DiskType> {
let mut props = MaybeUninit::<ffi::CFMutableDictionaryRef>::uninit();
let result = ffi::IORe... | 1 | 1 | 1 |
fc193d73ab646b1ed648e565deaaef3cde891e63 | Guillaume Gomez | 2019-09-06T09:49:03 | Update to new uninitialized api | diff --git a/src/mac/system.rs b/src/mac/system.rs
index 068c92c..2debfe5 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -17,6 +17,7 @@ use std::borrow::Borrow;
use std::cell::UnsafeCell;
use std::collections::HashMap;
use std::ffi::{OsStr, OsString};
+use std::mem::MaybeUninit;
use std::ops::Deref;
use... | 1 | 32 | 30 |
62bc1e611221fd21671dad4ffb7039df5de1300a | Guillaume Gomez | 2019-09-06T09:35:17 | Prevent potential failure in OSX network usage computation | diff --git a/src/mac/network.rs b/src/mac/network.rs
index 72ee8e8..8d5fb93 100644
--- a/src/mac/network.rs
+++ b/src/mac/network.rs
@@ -69,8 +69,16 @@ pub fn update_network(n: &mut NetworkData) {
}
}
}
- n.old_in = n.current_in;
+ n.old_in = if n.current_in > totalibytes {
+ 0
+... | 1 | 10 | 2 |
1b67b41e5af7e58a01dc6b9db6369f1518def310 | Guillaume Gomez | 2019-09-04T13:08:04 | update version | diff --git a/Cargo.toml b/Cargo.toml
index 8bafdf4..60a3db1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.3"
+version = "0.9.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
27559e32232eb22ee584b6659c4d4f61686f5891 | Guillaume Gomez | 2019-09-04T13:07:53 | remove compilation warning | diff --git a/src/linux/system.rs b/src/linux/system.rs
index e9ee973..d3e57a6 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -454,7 +454,7 @@ fn _get_process_data(
let clock_cycle = unsafe { sysconf(_SC_CLK_TCK) } as u64;
let since_boot = u64::from_str(parts[21]).unwrap_or(0) / ... | 2 | 6 | 4 |
9be756062b4f585e2aa79ae7f11aaeb382531cc2 | Guillaume Gomez | 2019-09-04T12:42:15 | fix underflow | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 6111c16..e9ee973 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -453,7 +453,9 @@ fn _get_process_data(
let clock_cycle = unsafe { sysconf(_SC_CLK_TCK) } as u64;
let since_boot = u64::from_str(parts[21]).unwrap_or(0) ... | 1 | 3 | 1 |
0275a3e9fa4a1b70214cc468b9bfb73be32a09f6 | Guillaume Gomez | 2019-09-04T12:28:07 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index bd8d8d2..8bafdf4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.2"
+version = "0.9.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
7f69b354d39ca9da85e39203bc9c2103e4c6dcc4 | Guillaume Gomez | 2019-09-04T12:27:37 | Fix computation of starting time on linux | diff --git a/examples/src/simple.rs b/examples/src/simple.rs
index 547909c..d16b488 100644
--- a/examples/src/simple.rs
+++ b/examples/src/simple.rs
@@ -87,7 +87,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool {
} else if let Ok(pid) = Pid::from_str(tmp[1]) {
match sys.get_p... | 2 | 58 | 22 |
9a3cf9a90da7d9335197e64548cbcbe6d883ea25 | GuillaumeGomez | 2019-08-29T20:50:08 | update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 20bb8b4..bd8d8d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.1"
+version = "0.9.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
50192170b5f511240e5a907a8fa3108feabd1f66 | GuillaumeGomez | 2019-08-29T20:49:38 | Fix windows load_symbols failure | diff --git a/src/windows/tools.rs b/src/windows/tools.rs
index f5e2b2d..0c9a0f4 100644
--- a/src/windows/tools.rs
+++ b/src/windows/tools.rs
@@ -254,12 +254,23 @@ pub unsafe fn load_symbols() -> HashMap<String, u32> {
&mut dwType as *mut i32 as *mut _,
... | 1 | 14 | 3 |
63bb48c0c7d5bc19637cc7fcf832a7e6144b66eb | Guillaume Gomez | 2019-07-26T13:51:05 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index d989f4e..20bb8b4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.9.0"
+version = "0.9.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
b5c4c617c80fe5accba838fc5c18119ad3e010d7 | Guillaume Gomez | 2019-07-26T13:50:00 | Add disk list loading on SystemExt::new | diff --git a/src/traits.rs b/src/traits.rs
index c839013..ddb40f4 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -113,6 +113,7 @@ pub trait SystemExt: Sized {
/// [`refresh_all`]: #method.refresh_all
fn new() -> Self {
let mut s = Self::new_with_specifics(RefreshKind::new());
+ s.refresh_di... | 1 | 1 | 0 |
676e1facc3a5d8a8a60e2eb6687c0949b3b6646c | Guillaume Gomez | 2019-07-26T13:49:31 | Handle mapper disk type | diff --git a/src/linux/system.rs b/src/linux/system.rs
index de48a0f..97b9d6d 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -532,7 +532,12 @@ fn get_all_disks() -> Vec<Disk> {
// prefix refers to NVM (non-volatile memory) cabale SSDs. These disks run on the NVMe
// storage cont... | 1 | 6 | 1 |
db4fa17b0c9f6dd1e1764f9532e4c3809194af69 | Guillaume Gomez | 2019-06-24T15:31:33 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 75c4ea3..d989f4e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.6"
+version = "0.9.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
c41b0230da2b70f77d4247f3df75410430abe7ae | Guillaume Gomez | 2019-06-24T15:30:42 | change get_current_pid signature | diff --git a/src/system.rs b/src/system.rs
index 3f2345d..3ddb43b 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -25,14 +25,15 @@ mod tests {
#[test]
fn test_refresh_process() {
let mut sys = System::new();
- assert!(sys.refresh_process(utils::get_current_pid()));
+ assert!(sys.refre... | 2 | 29 | 19 |
fa0d1efbad04e7afaf18e67dbe443ecdefc56d97 | Pierre Krieger | 2019-06-24T13:40:29 | Make it compile on unknown operating system | diff --git a/Cargo.toml b/Cargo.toml
index 952ea02..75c4ea3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,12 +15,14 @@ build = "build.rs"
[dependencies]
cfg-if = "0.1"
rayon = "^1.0"
-libc = "0.2"
doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "hand... | 11 | 355 | 11 |
9b176f5195fe5730d3f247318039658b4d345396 | Guillaume Gomez | 2019-06-23T09:31:14 | Update crate version | diff --git a/Cargo.toml b/Cargo.toml
index 58eb254..952ea02 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.5"
+version = "0.8.6"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
cb8f0411d32bb901fd965dcd4a89c5cd47c919f1 | Guillaume Gomez | 2019-06-22T11:18:16 | Add methods to specify which parts to refresh | diff --git a/Cargo.toml b/Cargo.toml
index 1cddd28..58eb254 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,8 +16,6 @@ build = "build.rs"
cfg-if = "0.1"
rayon = "^1.0"
libc = "0.2"
-
-[dev-dependencies]
doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
diff --git a/src/common.rs b/src/common.rs
index b5e6... | 7 | 222 | 22 |
a9f6582613178718c3c61aaa3ec320004feec7d0 | Guillaume Gomez | 2019-06-21T23:19:17 | Fix weird indent | diff --git a/src/windows/system.rs b/src/windows/system.rs
index 2df0167..94ec776 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -78,12 +78,14 @@ struct Wrap(Process);
unsafe impl Send for Wrap {}
struct WrapSystem<'a>(UnsafeCell<&'a mut System>);
- impl<'a> WrapSystem<'a> {
+
+impl<'a> WrapSyste... | 1 | 4 | 2 |
608f27e9e1a73cf75e28fce459ece66160a62be4 | Guillaume Gomez | 2019-06-09T15:36:12 | Update version | diff --git a/Cargo.toml b/Cargo.toml
index 969392a..1cddd28 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.4"
+version = "0.8.5"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
fe568236c9e38c00710beaf866e28f6409c79cbb | Guillaume Gomez | 2019-06-09T13:02:27 | Fix android build | diff --git a/src/utils.rs b/src/utils.rs
index d973efb..e3d3527 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -18,6 +18,10 @@ use Pid;
#[cfg(not(target_os = "windows"))]
pub fn realpath(original: &Path) -> PathBuf {
+ fn and(x: u32, y: u32) -> u32 {
+ x & y
+ }
+
if let Some(original_str) = orig... | 1 | 5 | 1 |
60751b292ae1fa9eb38cd1da2e7265f897b84d64 | Guillaume Gomez | 2019-06-09T13:02:21 | Update linux part to last compiler version | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 7d7e12e..30ee62f 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -72,7 +72,7 @@ impl System {
fn refresh_processors(&mut self, limit: Option<u32>) {
if let Ok(f) = File::open("/proc/stat") {
- let mut buf = BufReader::... | 1 | 2 | 2 |
2f60288ed1b5e8f475e6b475b5ee81c5dec1a72f | Guillaume Gomez | 2019-06-09T12:44:58 | Update mac code to last version | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index f4f2aac..da0642e 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -4,7 +4,7 @@
// Copyright (c) 2015 Guillaume Gomez
//
-use libc::{c_int, c_char, c_void, c_uchar, c_uint, size_t, uint32_t, uint64_t, c_ushort};
+use libc::{c_int, c_char, c_void, c_uchar, c_uint,... | 2 | 18 | 18 |
425a6ba8c18c54c60604bc36a76f4d7eb2f0b781 | Guillaume Gomez | 2019-05-17T06:48:15 | Update version | diff --git a/Cargo.toml b/Cargo.toml
index fe72587..969392a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.3"
+version = "0.8.4"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
5e4d03c8e8327ae3da2d7421bc511236dc6bb962 | Brandon Marc-Aurele | 2019-05-17T05:08:05 | Properly support cross compilation on unix | diff --git a/build.rs b/build.rs
index 4bace6c..37dc0b0 100644
--- a/build.rs
+++ b/build.rs
@@ -1,8 +1,6 @@
-#[cfg(target_os = "macos")]
fn main() {
- println!("cargo:rustc-link-lib=framework=IOKit");
- println!("cargo:rustc-link-lib=framework=CoreFoundation");
+ if std::env::var("TARGET").unwrap().contains(... | 1 | 4 | 6 |
7aabe2725de3ef4ba8c741de7fccccf9d6ad91b7 | Guillaume Gomez | 2019-04-29T11:11:37 | update version | diff --git a/Cargo.toml b/Cargo.toml
index 405c561..fe72587 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.2"
+version = "0.8.3"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
5b3f5d7c60cb9aa2d6ec0c5ac9accdd70a539a2c | Guillaume Gomez | 2019-04-29T11:10:50 | Add tests for README file | diff --git a/Cargo.toml b/Cargo.toml
index e096181..405c561 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,9 @@ cfg-if = "0.1"
rayon = "^1.0"
libc = "0.2"
+[dev-dependencies]
+doc-comment = "0.3"
+
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["fileapi", "handleapi", "ioapise... | 2 | 10 | 0 |
9d0ff72646a4c2ad1e1ca25d18f7b981310df0af | Guillaume Gomez | 2019-03-03T18:02:04 | Update version | diff --git a/Cargo.toml b/Cargo.toml
index fc35913..e096181 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.1"
+version = "0.8.2"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
532668137b875ebd7db13a40f97639adb00ac583 | Guillaume Gomez | 2019-03-03T16:39:18 | improve parsing for command line | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index 1f93104..f4f2aac 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -57,8 +57,8 @@ extern "C" {
// host_count: *const u32) -> u32;
pub fn vm_deallocate(target_task: u32, address: *mut i32, size: u32) -> kern_return_t;
- pub fn proc... | 2 | 34 | 51 |
e5bbfbb44ec12fea721e8b52233c8efdf78dcac3 | Guillaume Gomez | 2019-03-03T01:01:53 | Get process owned by other users | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index dcfa4a5..1f93104 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -50,12 +50,12 @@ extern "C" {
pub fn mach_task_self() -> u32;
pub fn mach_host_self() -> u32;
//pub fn task_info(host_info: u32, t: u32, c: *mut c_void, x: *mut u32) -> u32;
- pub fn... | 3 | 73 | 10 |
6f8f5f6d639afc6bf72560d17aa28b5a4ce10a8e | Guillaume Gomez | 2019-03-01T13:31:35 | Handle MemFree as well | diff --git a/src/linux/system.rs b/src/linux/system.rs
index 2327e30..7d7e12e 100644
--- a/src/linux/system.rs
+++ b/src/linux/system.rs
@@ -151,7 +151,7 @@ impl SystemExt for System {
for line in data.split('\n') {
let field = match line.split(':').next() {
Some("MemT... | 1 | 1 | 1 |
eb00a2f14d4c8746628bef85cfa230c9eda43f18 | Guillaume Gomez | 2019-03-01T00:44:13 | Update version | diff --git a/Cargo.toml b/Cargo.toml
index ddd947a..1c99982 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
-version = "0.8.0"
+version = "0.8.1"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to handle processes" | 1 | 1 | 1 |
92e1d0beb26a95d6fec561d5c9dfdccd84a8bdbc | Guillaume Gomez | 2019-03-01T00:41:44 | Add debug feature | diff --git a/Cargo.toml b/Cargo.toml
index c0a1893..c9cd2a0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,10 +15,7 @@ build = "build.rs"
[dependencies]
cfg-if = "0.1"
rayon = "^1.0"
-
-[dependencies.libc]
-version = "0.2"
-features = ["extra_traits"]
+libc = "0.2"
[target.'cfg(windows)'.dependencies]
winapi = ... | 2 | 14 | 16 |
1fd31029b46ac34e5b2ce5df28e0ded4d02ddb80 | Guillaume Gomez | 2019-02-28T23:53:46 | Add missing documentation | diff --git a/src/windows/macros.rs b/src/windows/macros.rs
index 8997938..79e5493 100644
--- a/src/windows/macros.rs
+++ b/src/windows/macros.rs
@@ -4,6 +4,7 @@
// Copyright (c) 2017 Guillaume Gomez
//
+/// Allows to cast only when needed.
#[macro_export]
macro_rules! auto_cast {
($t:expr, $cast:ty) => {{ | 1 | 1 | 0 |
4fe25b9f74c482b7ef1524fa76e73c3e03e17bb3 | Guillaume Gomez | 2019-02-28T23:33:47 | Get basic information if not enough rights to access process' stack | diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs
index d8531c2..fba3299 100644
--- a/src/mac/ffi.rs
+++ b/src/mac/ffi.rs
@@ -56,6 +56,9 @@ extern "C" {
//pub fn host_statistics(host_priv: u32, flavor: u32, host_info: *mut c_void,
// host_count: *const u32) -> u32;
pub fn vm_deallocate(t... | 2 | 33 | 5 |
17213d4999b7b4f3d8db33c0c9b4823666b6e44e | Guillaume Gomez | 2019-02-28T23:21:37 | Improve code a bit | diff --git a/src/mac/system.rs b/src/mac/system.rs
index 334927d..17345bd 100644
--- a/src/mac/system.rs
+++ b/src/mac/system.rs
@@ -450,6 +450,38 @@ fn update_process(wrap: &Wrap, pid: Pid,
}
}
+fn get_proc_list() -> Option<Vec<Pid>> {
+ let count = unsafe { ffi::proc_listallpids(::std::ptr::null_mut(), 0) ... | 1 | 56 | 44 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.