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
cb5b311082f74426eb92e8f5d435619ce02ef69b
Guillaume Gomez
2019-02-28T23:14:19
Fix global memory usage on mac
diff --git a/Cargo.toml b/Cargo.toml index ddd947a..c0a1893 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,10 +13,13 @@ categories = ["filesystem", "os::macos-apis", "os::unix-apis", "os::windows-apis build = "build.rs" [dependencies] -libc = "^0.2" cfg-if = "0.1" rayon = "^1.0" +[dependencies.libc] +version =...
3
23
5
fcd81a66681c32efc0773310cb6d287cb0febad5
Sebastian Schmidt
2019-01-22T08:21:19
Added unit information for `get_*_memory()` methods
diff --git a/src/traits.rs b/src/traits.rs index 99034be..864acc5 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -46,7 +46,7 @@ pub trait ProcessExt { /// Sends the given `signal` to the process. fn kill(&self, signal: ::Signal) -> bool; - /// Returns the name of the processus. + /// Returns the na...
1
12
12
70b613e70d8f9081936c7688f1ce27b95c536301
Guillaume Gomez
2019-01-17T19:30:17
Fix clippy warnings on mac
diff --git a/src/mac/ffi.rs b/src/mac/ffi.rs index fc4a501..b01facc 100644 --- a/src/mac/ffi.rs +++ b/src/mac/ffi.rs @@ -4,8 +4,6 @@ // Copyright (c) 2015 Guillaume Gomez // -#![allow(empty_line_after_outer_attr)] - use libc::{c_int, c_char, c_void, c_uchar, c_uint, size_t, uint32_t, uint64_t, c_ushort}; extern...
3
10
12
a7e0201cdf11937d68ca7967b0d9d413f2b23760
Guillaume Gomez
2019-01-17T18:20:38
fix clippy warnings on linux
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index d26349b..3619001 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -37,7 +37,6 @@ impl From<isize> for DiskType { } fn find_type_for_name(name: &OsStr) -> DiskType { - #![allow(or_fun_call)] /* turn "sda1" into "sda": */ let mut trimmed: ...
5
9
13
be0c6ba1a156daed9ea982f833075ff076314420
Guillaume Gomez
2018-12-24T10:36:29
Use correct license in cargo file and update version
diff --git a/Cargo.toml b/Cargo.toml index 74122e8..ddd947a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "sysinfo" -version = "0.7.0" +version = "0.8.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes" repository = "https://gith...
1
2
2
ee8ee4708b7e59b755751901f8aa17ce293a967d
Guillaume Gomez
2018-12-13T23:56:00
Add test to check if Process implements Send and Sync traits
diff --git a/src/system.rs b/src/system.rs index 9de162d..3f2345d 100644 --- a/src/system.rs +++ b/src/system.rs @@ -35,4 +35,26 @@ mod tests { let p = sys.get_process(utils::get_current_pid()).expect("didn't find process"); assert!(p.memory() > 0); } + + #[test] + fn check_if_send_and_sync...
1
22
0
3602338e1d9e43d16b698c1fdc9e2cf8f0b1b918
Guillaume Gomez
2018-12-12T18:56:02
Add another test
diff --git a/src/system.rs b/src/system.rs index e8998af..9de162d 100644 --- a/src/system.rs +++ b/src/system.rs @@ -9,7 +9,7 @@ #[cfg(test)] mod tests { - use ::{System, SystemExt}; + use ::{ProcessExt, System, SystemExt}; use ::utils; #[test] @@ -27,4 +27,12 @@ mod tests { let mut sys =...
1
9
1
3be529420176191b2cc3ab7ddca3016661aaa62c
Guillaume Gomez
2018-12-12T18:37:51
Upgrade version
diff --git a/Cargo.toml b/Cargo.toml index 9c21c40..74122e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.6.2" +version = "0.7.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
87f54637bd66714f348a47ed10952b0e7b309735
Guillaume Gomez
2018-12-12T18:37:42
Use unsafecell instead of pointers
diff --git a/src/windows/process.rs b/src/windows/process.rs index 93432e1..fe9435c 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -6,6 +6,7 @@ use std::fmt::{self, Formatter, Debug}; use std::mem::{size_of, zeroed}; +use std::ops::Deref; use std::path::{Path, PathBuf}; use std::str; @@ -20...
2
31
18
bb8af78e38f1296a7fa68831c73b7a78104a5279
Guillaume Gomez
2018-12-12T18:22:47
Implement Send and Sync trait for HANDLE in windows' Process
diff --git a/src/windows/process.rs b/src/windows/process.rs index d84ee43..93432e1 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -71,6 +71,20 @@ fn get_process_handler(pid: Pid) -> Option<HANDLE> { } } +#[derive(Clone)] +struct HandleWrapper(HANDLE); + +impl Deref for HandleWrapper { + ...
1
22
5
86793dd9845f251013350f3ea97e14bf54acc586
Guillaume Gomez
2018-12-03T20:25:24
Use UnsafeCell instead of unsafe
diff --git a/src/linux/system.rs b/src/linux/system.rs index 1ad8c9a..ce49c2f 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -12,6 +12,9 @@ use sys::disk; use sys::network; use sys::NetworkData; use ::{DiskExt, ProcessExt, SystemExt}; +use Pid; + +use std::cell::UnsafeCell; use std::fs::{File, read_l...
2
28
13
568b3a958664850a9a0a1260bac9c5e88a86c0ac
Guillaume Gomez
2018-10-04T13:36:54
Release new version
diff --git a/Cargo.toml b/Cargo.toml index ea30e84..9c21c40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.6.1" +version = "0.6.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
1d88ad9f04014fce65db41c21df7b88795102cbd
Guillaume Gomez
2018-10-04T13:22:26
Fix invalid CPU values in refresh_process method
diff --git a/src/linux/system.rs b/src/linux/system.rs index 1ad8c9a..ef9f7ac 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -24,6 +24,12 @@ use Pid; use rayon::prelude::*; +macro_rules! to_str { + ($e:expr) => { + unsafe { ::std::str::from_utf8_unchecked($e) } + } +} + /// Structs con...
1
58
46
cc74559cc8f502b21f64a10a5ade69c8818cfb8c
Guillaume Gomez
2018-10-03T21:29:23
Update version
diff --git a/Cargo.toml b/Cargo.toml index b41e263..ea30e84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.6.0" +version = "0.6.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
d6da0bb205d63336ccab7472b8e8daa5fb87e67d
Guillaume Gomez
2018-10-03T14:48:06
add docs
diff --git a/src/mac/system.rs b/src/mac/system.rs index b61ed37..8050e42 100644 --- a/src/mac/system.rs +++ b/src/mac/system.rs @@ -518,6 +518,14 @@ impl SystemExt for System { &count as *const u32) == ffi::KERN_SUCCESS { //self.mem_free = u64::from(stat.free_cou...
1
8
0
4fa6b01cdbdc943497cd279899ef21a334441e8c
Alex Taylor
2018-10-03T12:47:50
Windows: get exe path and correct root
diff --git a/src/windows/process.rs b/src/windows/process.rs index bbd04d1..d84ee43 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -125,21 +125,23 @@ impl ProcessExt for Process { let name = String::from_utf16_lossy(&process_name[..pos]); let environ = get_proc_env...
1
8
6
9422bacb3c367761c4716c665f51c26459aaa9ba
Alex Taylor
2018-10-03T12:20:58
Windows: get root directory of process
diff --git a/src/windows/process.rs b/src/windows/process.rs index 7804897..bbd04d1 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -1,6 +1,6 @@ -// +// // Sysinfo -// +// // Copyright (c) 2018 Guillaume Gomez // @@ -23,7 +23,7 @@ use winapi::um::winnt::{ use winapi::um::processthreadsapi::{...
1
20
4
6d7c5ad6622e4c23e62517a27f684c98c4a89048
Mikolaj Barwicki
2018-10-02T12:22:37
[issue #137] Fix the System::new() panicking on some PCs with Windows 10 (where system performance counter has empty content)
diff --git a/src/windows/tools.rs b/src/windows/tools.rs index 09d5491..f5e2b2d 100644 --- a/src/windows/tools.rs +++ b/src/windows/tools.rs @@ -275,13 +275,18 @@ pub fn get_translation(s: &String, map: &HashMap<String, u32>) -> Option<String> *index, ...
1
12
7
e67cfc1c54ea2a3bea7401af2b4b6fcfd6c41a61
Guillaume Gomez
2018-09-22T23:53:25
update test
diff --git a/tests/process.rs b/tests/process.rs index 3dcfbc4..82c0882 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -13,9 +13,8 @@ fn test_process() { let mut s = sysinfo::System::new(); s.refresh_processes(); assert!(s.get_process_list().len() != 0); - for p in s.get_process_list().values...
1
4
5
ed0757754942ddffbdf3dbdcac10096b3c127ada
Guillaume Gomez
2018-09-22T23:39:17
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index d2e070e..b41e263 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.8" +version = "0.6.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
8d02699d28a9f1b4a05a3ed0b7e22f47f880f7db
Guillaume Gomez
2018-09-18T22:54:00
Release new version
diff --git a/Cargo.toml b/Cargo.toml index ed21d6b..d2e070e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.7" +version = "0.5.8" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
0636d50f50cf7eaeaf137e8c69d41a619fd0b9e1
mitchmindtree
2018-09-18T09:59:05
Add comment explaining the linux nvme disk prefix vs sd
diff --git a/src/linux/system.rs b/src/linux/system.rs index 070c9de..c3df933 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -505,6 +505,10 @@ fn get_all_disks() -> Vec<Disk> { let disks = content.lines() .filter(|line| { let line = line.trim_left(); + // While the `...
1
4
0
cf9f79dd231bda5867fcc9307fdc2acc1e938c48
mitchmindtree
2018-09-18T09:24:08
Allow for discovering NVMe disks on Linux systems This fixes an issue where `sysinfo::get_disks()` would not include any disks with the `/dev/nvme` prefix. Rather than just checking the `/proc/mounts` file for `/dev/sd*` disks, we now also check for `/dev/nvme*` disks. Closes #131.
diff --git a/src/linux/system.rs b/src/linux/system.rs index 167676e..070c9de 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -503,7 +503,10 @@ fn get_all_disks() -> Vec<Disk> { #[allow(or_fun_call)] let content = get_all_data("/proc/mounts").unwrap_or(String::new()); let disks = content.li...
1
4
1
850232db0bfd5a3971c8b9ea54ce93cc8b87b446
Guillaume Gomez
2018-08-10T07:02:57
Update version
diff --git a/Cargo.toml b/Cargo.toml index b4cd30e..ed21d6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.6" +version = "0.5.7" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
8ae959fa217131861791344614532f2b873b835f
Guillaume Gomez
2018-08-10T07:02:40
Improve doc a bit
diff --git a/src/traits.rs b/src/traits.rs index d0a96f9..11cb267 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -50,8 +50,8 @@ pub trait ProcessExt { fn name(&self) -> &str; /// Returns the command line. - /// - /// On Windows, this is always a one element vector. + // /// + // /// On Window...
1
5
2
211630c2a2cdde793cc35d0cff9bd342df0b867d
Ethan Smith
2018-08-09T23:35:17
Add note about needing to refresh
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index 5cc8133..547909c 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -58,6 +58,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool { } } "proc" => { + // Note: you should refresh a few...
1
1
0
b3fec810b418acf98c8c4a2e095b880026bec7ab
GuillaumeGomez
2018-08-04T12:49:34
Add potential new ways of getting information
diff --git a/src/traits.rs b/src/traits.rs index 18a058f..d0a96f9 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -50,6 +50,8 @@ pub trait ProcessExt { fn name(&self) -> &str; /// Returns the command line. + /// + /// On Windows, this is always a one element vector. fn cmd(&self) -> &[String]; ...
2
52
44
c0d544754dd4e3f3ccd64ee7afe3bd5bc47c627d
Guillaume Gomez
2018-05-22T14:33:52
update version
diff --git a/Cargo.toml b/Cargo.toml index d9e0d11..b4cd30e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.5" +version = "0.5.6" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
485135ae2d24964a1cee9d6514922f4bc0f481f6
Guillaume Gomez
2018-05-22T14:32:50
add test to avoid memory regression
diff --git a/src/sysinfo.rs b/src/sysinfo.rs index 43b96bf..b379d5a 100644 --- a/src/sysinfo.rs +++ b/src/sysinfo.rs @@ -177,3 +177,16 @@ pub enum Signal { /// Bad argument to routine (SVr4). Sys = 31, } + +#[cfg(test)] +mod test { + use traits::{ProcessExt, SystemExt}; + + #[test] + fn check_memory...
1
13
0
69858ba9e2b555e737027f32ca7c670a4ba17ff5
Onur Aslan
2018-05-22T12:56:29
Set entry.memory
diff --git a/src/linux/system.rs b/src/linux/system.rs index 3a33412..167676e 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -331,6 +331,7 @@ fn update_time_and_memory(path: &Path, entry: &mut Process, parts: &[&str], page parent_memory: u64, pid: Pid) { // we get the rss ...
1
1
0
dbbb3f9e382ca7336a02d471c26ad6aa3275202f
Guillaume Gomez
2018-04-24T09:27:20
increase version number
diff --git a/Cargo.toml b/Cargo.toml index f32fe7b..d9e0d11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.4" +version = "0.5.5" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
6f19ffaa09f2c3f69bfcaad6bd33cb1b6d7ef02f
Guillaume Gomez
2018-04-24T10:01:21
Fix nightly pointer error
diff --git a/src/mac/network.rs b/src/mac/network.rs index af95256..0c58dfe 100644 --- a/src/mac/network.rs +++ b/src/mac/network.rs @@ -37,6 +37,7 @@ pub fn new() -> NetworkData { } } +#[allow(cast_ptr_alignment)] pub fn update_network(n: &mut NetworkData) { let mib = &mut [CTL_NET, PF_ROUTE, 0, 0, NET_R...
1
1
0
0a5d55bda34af746f73df66564fcf9923482c980
Guillaume Gomez
2018-04-24T09:26:07
improve cast macro
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 4452236..d26349b 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -52,14 +52,8 @@ fn find_type_for_name(name: &OsStr) -> DiskType { DiskType::from(rotational_int.unwrap_or(-1)) } -#[cfg(target_pointer_width = "32")] macro_rules! cast { - ($x:...
1
4
10
03fe4d6bed3a7b3220d920696c64d078a6fc4cf5
Guillaume Gomez
2018-04-09T18:16:49
Update version
diff --git a/Cargo.toml b/Cargo.toml index a398ea1..f32fe7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.3" +version = "0.5.4" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
e89a3dc3f566c6b5c7c77496f56735d5accc11c1
Guillaume Gomez
2018-04-09T16:42:15
Improve performances on windows
diff --git a/Cargo.toml b/Cargo.toml index b407f5d..a398ea1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,6 @@ build = "build.rs" [dependencies] libc = "^0.2" cfg-if = "0.1" - -[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies] rayon = "^1.0" [target.'cfg(windows)'.dependencies] d...
5
38
18
a887677cc2ee01c0a0439139c00afe69ac59ce09
Guillaume Gomez
2018-04-08T20:17:17
linux performance
diff --git a/Cargo.toml b/Cargo.toml index ed5f581..b407f5d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ build = "build.rs" libc = "^0.2" cfg-if = "0.1" -[target.'cfg(target_os = "macos")'.dependencies] +[target.'cfg(any(target_os = "macos", target_os = "linux"))'.dependencies] rayon = "^1.0" [tar...
4
117
50
b9d87c41f96a51dd010c18d1a452e2489881eac3
Guillaume Gomez
2018-04-08T13:00:40
Replace some divisions and multiplications by bytes shifting
diff --git a/src/mac/system.rs b/src/mac/system.rs index 91c98a3..537b0e8 100644 --- a/src/mac/system.rs +++ b/src/mac/system.rs @@ -87,9 +87,9 @@ unsafe fn strtoul(s: *mut c_char, size: c_int, base: c_int) -> u32 { for i in 0..size { total += if base == 16 { - (*s.offset(i as isize) as u32) ...
1
38
31
263b16c72bf04bca5de456ed77ff3a4ea01fb547
Guillaume Gomez
2018-04-07T17:30:35
Add multithreading for process update on mac
diff --git a/Cargo.toml b/Cargo.toml index 2723e92..ed5f581 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,9 @@ build = "build.rs" libc = "^0.2" cfg-if = "0.1" +[target.'cfg(target_os = "macos")'.dependencies] +rayon = "^1.0" + [target.'cfg(windows)'.dependencies] winapi = { version = "0.3", features = ["f...
4
189
156
b79e5269b803247cec400e09296538dfa33a85ee
Guillaume Gomez
2018-04-08T15:20:06
Add bench for refresh_process
diff --git a/benches/basic.rs b/benches/basic.rs index a92867e..c11dc3e 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -39,6 +39,17 @@ fn bench_refresh_processes(b: &mut test::Bencher) { }); } +#[bench] +fn bench_refresh_process(b: &mut test::Bencher) { + let mut s = sysinfo::System::new(); + + s...
1
11
0
7db551fdfdf0358110b382c250c71e28a3b88c25
Guillaume Gomez
2018-03-22T10:21:23
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 2cedeac..2723e92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.2" +version = "0.5.3" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
52b0e7472ff86cd9e434daf16d925aa8d4174e53
Guillaume Gomez
2018-03-22T09:54:25
Fix invalid type error
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index c1ecb01..4452236 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -70,8 +70,8 @@ pub fn new(name: &OsStr, mount_point: &Path, file_system: &[u8]) -> Disk { unsafe { let mut stat: statvfs = mem::zeroed(); if statvfs(mount_point_cpat...
1
3
3
bd1646755e858e159949c0944a1ac58c66b49aa0
Guillaume Gomez
2018-03-21T23:25:12
Update version
diff --git a/Cargo.toml b/Cargo.toml index c273d80..2cedeac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.1" +version = "0.5.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
807f5979daa8afcf4285a430c188e5cc805ba481
Guillaume Gomez
2018-03-21T23:23:54
Fix clippy lints
diff --git a/src/linux/component.rs b/src/linux/component.rs index 07c8a99..bae4bf1 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -104,10 +104,10 @@ impl Component { critical: Option<f32>) -> Component { let mut c = Component { temperature: 0f32, - ...
8
34
34
fba0d8444a87f04ba2c4061c8f4c5fa2a0ce10e2
Guillaume Gomez
2018-02-06T22:22:42
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 4535be5..c273d80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.5.0" +version = "0.5.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
a5d7b9e9ac70465db361d5575634bc645ceed64d
Guillaume Gomez
2018-02-06T22:22:34
Fix clippy lints
diff --git a/src/linux/mod.rs b/src/linux/mod.rs index 7b2a351..560eef5 100644 --- a/src/linux/mod.rs +++ b/src/linux/mod.rs @@ -4,6 +4,8 @@ // Copyright (c) 2015 Guillaume Gomez // +#![allow(decimal_literal_representation)] + pub mod component; pub mod disk; pub mod network; diff --git a/src/mac/ffi.rs b/src/ma...
2
4
0
3f9d1fad8be3e61de64c30b7ec61f49180bb822f
Guillaume Gomez
2018-02-06T22:15:21
Add tests for uptime
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index b464374..ccd5027 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -12,9 +12,9 @@ extern crate sysinfo; use sysinfo::{NetworkExt, Pid, ProcessExt, ProcessorExt, Signal, System, SystemExt}; use sysinfo::Signal::*; -use std::io::{sel...
2
32
2
bcb6364ad36bd89096eb0d467a4f18d147632ac1
Norman Ritchie
2018-02-06T21:58:21
Fix uptime
diff --git a/src/linux/system.rs b/src/linux/system.rs index 6788af9..d1cf1f5 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -451,6 +451,6 @@ fn get_all_disks() -> Vec<Disk> { #[allow(or_fun_call)] fn get_uptime() -> u64 { - let content = get_all_data("/proc/mounts").unwrap_or(String::new()); + ...
1
1
1
c207dd8eb4443fe9b5e80ca74b9d63c63667da10
Guillaume Gomez
2018-01-12T21:00:09
Fix windows translation failures
diff --git a/src/windows/system.rs b/src/windows/system.rs index 2c99640..f772c93 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -84,103 +84,118 @@ impl SystemExt for System { network: network::new(), uptime: get_uptime(), }; + // TODO: in case a translation ...
1
107
92
e8e70d35bc4507e3dee28a90021838b890911dbf
Guillaume Gomez
2018-01-12T15:44:38
update to last libc version
diff --git a/src/mac/system.rs b/src/mac/system.rs index e3427d6..811525f 100644 --- a/src/mac/system.rs +++ b/src/mac/system.rs @@ -268,11 +268,7 @@ fn get_uptime() -> u64 { let bsec = boottime.tv_sec; let csec = unsafe { libc::time(::std::ptr::null_mut()) }; - // TODO: remove this once libc new version...
1
1
5
6eca16413b56e458bc60c48549d4eea81e3b4263
Guillaume Gomez
2018-01-11T23:39:03
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 3e20a26..4535be5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.4.1" +version = "0.5.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
fa505601bbf68973076d85fd3ee57af32b2cb9c4
Guillaume Gomez
2018-01-11T23:38:16
Update windows to last ProcessExt version
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index bb21fe3..b464374 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -74,7 +74,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool { "quit" | "exit" => return true, "all" => { for (pid, proc_) in...
3
21
19
70136b4ceb25c03642a2f24427f8287c253107be
Guillaume Gomez
2018-01-11T23:28:35
Extend ProcessExt to unify platforms
diff --git a/src/linux/process.rs b/src/linux/process.rs index 7bb7781..e003a9d 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -12,7 +12,7 @@ use Pid; use ::ProcessExt; /// Enum describing the different status of a process. -#[derive(Clone, Debug)] +#[derive(Clone, Copy, Debug)] pub enum ProcessSt...
7
292
123
57dbc52bc772fe82b0c227f84e7583d953006c2d
Guillaume Gomez
2018-01-11T21:35:19
Fix time computation
diff --git a/src/windows/process.rs b/src/windows/process.rs index db7ee88..f086e1d 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -212,8 +212,7 @@ impl Debug for Process { } unsafe fn get_start_time(handle: HANDLE) -> u64 { - let mut start = 0u64; - let mut fstart = zeroed(); + let mu...
3
16
7
a80d323f10c6748c75b096c6acfe2ecdf2508045
Guillaume Gomez
2018-01-06T18:12:00
Uniformize Component structs
diff --git a/Cargo.toml b/Cargo.toml index 7c6c902..3e20a26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.4.0" +version = "0.4.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes" diff --git a/src/windows/comp...
2
5
9
2ce54d6900e9b581687498ca3b9a644ea992fb49
Guillaume Gomez
2018-01-06T16:59:58
Fix issue on mac/unix
diff --git a/src/component.rs b/src/component.rs index 831d130..1e1293c 100644 --- a/src/component.rs +++ b/src/component.rs @@ -6,15 +6,16 @@ use std::fmt::{Debug, Error, Formatter}; use sys::Component; +use traits::ComponentExt; impl Debug for Component { fn fmt(&self, f: &mut Formatter) -> Result<(), Err...
2
6
5
a61701973f7677529930e89e17b3aa19a5aa9566
Guillaume Gomez
2018-01-06T16:47:52
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 982a28d..7c6c902 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.19" +version = "0.4.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes" @@ -8,7 +8,7 @@ repository =...
1
2
2
f1bcf9136e4e624df51922b29a9693288a465ac3
Guillaume Gomez
2018-01-06T16:38:01
Fix missing pieces
diff --git a/src/windows/process.rs b/src/windows/process.rs index 35f0345..db7ee88 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -6,11 +6,9 @@ use std::mem::{size_of, zeroed}; use std::fmt::{self, Formatter, Debug}; -//use std::os::raw; use std::str; -//use std::env; -use libc::{c_char, c_...
3
346
318
414a0fcbd32ec1988be17adf7a2f4e99c9ee1eb0
Guillaume Gomez
2018-01-06T14:03:59
Add new common trait for Components
diff --git a/src/linux/component.rs b/src/linux/component.rs index 321e1da..07c8a99 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -1,9 +1,11 @@ // // Sysinfo // -// Copyright (c) 2015 Guillaume Gomez +// Copyright (c) 2018 Guillaume Gomez // +use ComponentExt; + use std::collections::Hash...
5
89
124
72fa417e078ec6def4822b7d2a00d892e8faa3cf
Guillaume Gomez
2018-01-06T01:03:35
Port disk as well
diff --git a/src/windows/disk.rs b/src/windows/disk.rs index 8b79398..b267ebf 100644 --- a/src/windows/disk.rs +++ b/src/windows/disk.rs @@ -1,15 +1,17 @@ // // Sysinfo // -// Copyright (c) 2017 Guillaume Gomez +// Copyright (c) 2018 Guillaume Gomez // +use std::ffi::{OsStr, OsString}; use std::fmt::{Debug, Er...
3
53
48
450d1e3b99649a99a7c745f41a6ee2fe951edd10
Guillaume Gomez
2017-12-19T23:01:28
Continue windows support
diff --git a/src/common.rs b/src/common.rs new file mode 100644 index 0000000..78ac2cb --- /dev/null +++ b/src/common.rs @@ -0,0 +1,17 @@ +// +// Sysinfo +// +// Copyright (c) 2015 Guillaume Gomez +// + +cfg_if!{ + if #[cfg(windows)] { + /// Process id. + pub type Pid = usize; + } else { + us...
11
112
75
c5deb51336ff01c3f6b1f036dd20e2a6461e0bd3
Guillaume Gomez
2017-12-16T17:34:43
Fix clippy warnings
diff --git a/Cargo.toml b/Cargo.toml index 304291c..350122e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.18" +version = "0.3.19" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes" diff --git a/src/mac/disk.r...
2
4
4
036998b0c000adb8ed148ffb198bb6f39f70a925
Guillaume Gomez
2017-12-15T23:54:46
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 9525f77..304291c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.17" +version = "0.3.18" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
32fec8a76857cc4a158dc1f99046224af9a084e6
Guillaume Gomez
2017-12-15T22:29:37
Fix clippy lint
diff --git a/src/linux/component.rs b/src/linux/component.rs index fd4ae74..321e1da 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -11,7 +11,7 @@ use std::io::Read; use std::path::{Path, PathBuf}; /// More information can be found at -/// http://lxr.free-electrons.com/source/Documentation/hwmon...
1
1
1
8557e49347a491f2c445509089dc49cfc998edcc
Guillaume Gomez
2017-12-15T14:52:03
Support raspberry
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index ab9e0f3..306dd5a 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -36,8 +36,7 @@ impl From<isize> for DiskType { } } -fn find_type_for_name(name: &OsStr) -> DiskType -{ +fn find_type_for_name(name: &OsStr) -> DiskType { #![allow(or_fun_call)...
1
17
7
83ac314845acc0b0a350cd5506f7f711df5fc566
king6cong
2017-10-29T09:35:04
Use cdylib instead of dylib
diff --git a/Cargo.toml b/Cargo.toml index 3790cab..9525f77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ libc = "^0.2" [lib] name = "sysinfo" -crate_type = ["rlib", "dylib"] +crate_type = ["rlib", "cdylib"] path = "src/sysinfo.rs" [features]
1
1
1
5c42a68f0985966d735688466009056840863d5c
Guillaume Gomez
2017-09-21T08:01:15
Fix clippy warnings
diff --git a/src/mac/disk.rs b/src/mac/disk.rs index 69f27ad..cf528a3 100644 --- a/src/mac/disk.rs +++ b/src/mac/disk.rs @@ -42,8 +42,8 @@ pub fn new(name: OsString, mount_point: &Path, type_: DiskType) -> Disk { unsafe { let mut stat: statfs = mem::zeroed(); if statfs(mount_point_cpath.as_ptr() ...
3
9
9
9ad6a4b7eac96ddb7ecfcd77af066b29d745676e
Guillaume Gomez
2017-09-20T21:23:27
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index e117d20..3790cab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.16" +version = "0.3.17" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
14091664f8af82dbf52e58aaf6ffe4d50f99ee67
Guillaume Gomez
2017-09-20T21:22:51
Fix mac build error
diff --git a/src/mac/disk.rs b/src/mac/disk.rs index e0c2784..69f27ad 100644 --- a/src/mac/disk.rs +++ b/src/mac/disk.rs @@ -8,7 +8,7 @@ use ::DiskExt; use ::utils; use libc::statfs; -use std::{mem, str}; +use std::mem; use std::fmt::{Debug, Error, Formatter}; use std::path::{Path, PathBuf}; use std::ffi::{OsStr...
1
1
1
b617b35943dbf0c1145cb57f9f5291d72c8b8b88
Vojtech Cima
2017-09-20T08:13:22
[FIX] More robust parsing of /proc/stat
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 5d33952..ab9e0f3 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -9,7 +9,7 @@ use ::utils; use super::system::get_all_data; use libc::statvfs; -use std::{mem, str}; +use std::mem; use std::fmt::{Debug, Error, Formatter}; use std::path::{Path, Path...
2
22
22
de9ea2132b79e55fb01f7a8dc9a7f7f8e0520052
Guillaume Gomez
2017-08-23T19:20:56
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 1ee73ec..e117d20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.15" +version = "0.3.16" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
d235ebde926f523571c1379558ee160e894f09af
Jos van den Oever
2017-08-23T08:36:38
Compile fix for Rust 1.15. PathBuf does not implement std::default::Default in older Rust versions.
diff --git a/src/linux/system.rs b/src/linux/system.rs index 75acc1e..ae3e0af 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -395,7 +395,11 @@ fn _get_process_data(path: &Path, proc_list: &mut Process, page_size_kb: u64, pi let s = read_link(tmp.to_str().unwrap_or("")); ...
1
5
1
3c4b40ac596e2f199b52f562c7bb07afd7ccd35b
Guillaume Gomez
2017-08-19T15:32:41
Add README file for crates.io
diff --git a/Cargo.toml b/Cargo.toml index e17a5b1..1ee73ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "sysinfo" -version = "0.3.14" +version = "0.3.15" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes" repository = "https://gi...
1
2
1
8b51ea0c3e3016c06a4e322f6348a2dde3113b0e
Guillaume Gomez
2017-08-16T22:39:32
Fix clippy warning
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index dda08f7..d367343 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -150,7 +150,7 @@ fn interpret_input(input: &str, sys: &mut System) -> bool { writeln!(&mut io::stdout(), "Done."); } else if x.starts_with...
1
1
1
13eec5a49f795e1b3262647382a4e0fe0b9187f9
Guillaume Gomez
2017-08-16T22:11:22
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 736fb80..e17a5b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.13" +version = "0.3.14" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
6d2d5a6866dabed3e5d4dbc54072226f21a52954
Guillaume Gomez
2017-08-16T22:11:02
Add update_process methods for all platform and make more useful
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index 65d4cd6..dda08f7 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -27,7 +27,8 @@ fn print_help() { writeln!(&mut io::stdout(), "== Help menu =="); writeln!(&mut io::stdout(), "help : show this menu"); writ...
6
224
173
b73c42ee25366a562bbb442dffa32715f07613a3
Guillaume Gomez
2017-08-03T21:58:51
Add benches and fix clippy warning
diff --git a/benches/basic.rs b/benches/basic.rs index a3da3bb..a92867e 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -13,10 +13,55 @@ fn bench_new(b: &mut test::Bencher) { } #[bench] -fn bench_refresh(b: &mut test::Bencher) { +fn bench_refresh_all(b: &mut test::Bencher) { let mut s = sysinfo::System...
2
52
7
02be5281d04dae3148811665004b5945e219e807
Guillaume Gomez
2017-07-31T21:58:51
remove clippy warnings
diff --git a/examples/Cargo.toml b/examples/Cargo.toml index dccbba7..57ceff0 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -11,3 +11,4 @@ libc = "^0.2" [[bin]] name = "simple" +path = "src/simple.rs" \ No newline at end of file diff --git a/src/linux/component.rs b/src/linux/component.rs index 2538...
4
5
4
b03a9054016c2cfda14239abe425686e31da5797
Guillaume Gomez
2017-07-31T21:29:10
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index b491ebf..736fb80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.12" +version = "0.3.13" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
6bfdf88ceab0568ecb5efe2d2fcad6f5ce33d7db
Guillaume Gomez
2017-07-31T21:28:55
Remove remaining unwrap
diff --git a/src/mac/system.rs b/src/mac/system.rs index 1986958..a7d6f48 100644 --- a/src/mac/system.rs +++ b/src/mac/system.rs @@ -12,8 +12,8 @@ use sys::process::*; use sys::disk::{self, Disk, DiskType}; use ::{DiskExt, ProcessExt, ProcessorExt, SystemExt}; use std::collections::HashMap; +use std::ffi::{OsStr, Os...
1
2
2
e0a325f9633a7a5f11c5a6763ffb0d4cd1205cac
Guillaume Gomez
2017-07-31T10:26:34
Improve macro
diff --git a/src/linux/system.rs b/src/linux/system.rs index 680479a..fc012fa 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -298,11 +298,10 @@ fn update_time_and_memory(path: &Path, entry: &mut Process, parts: &[&str], page macro_rules! unwrap_or_return { ($data:expr) => {{ - let x = $dat...
1
3
4
3faf09f1a91ec63c2049fe1fd0a6b66c214e6950
Guillaume Gomez
2017-07-31T10:24:08
Remove unwraps
diff --git a/src/linux/component.rs b/src/linux/component.rs index 3bcd71c..25380fd 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -5,6 +5,7 @@ // use std::collections::HashMap; +use std::ffi::OsStr; use std::fs::{File, read_dir}; use std::io::Read; use std::path::{Path, PathBuf}; @@ -26,8 +...
3
234
203
438bf3cfd130b86b91abf2a2b9453c342af87e8f
Guillaume Gomez
2017-07-22T19:43:07
Fix clippy lint
diff --git a/src/linux/network.rs b/src/linux/network.rs index 026ca2f..c231a6a 100644 --- a/src/linux/network.rs +++ b/src/linux/network.rs @@ -55,7 +55,7 @@ fn read_things() -> Result<(u64, u64), Error> { .filter(|l| l.split_whitespace().nth(2).map(|l| l != "00000000").unwrap_or(false)) ...
1
1
1
11dcfde1501fec3e8068c1822eb99511cdb82072
Guillaume Gomez
2017-07-22T19:12:26
Rely more on libc
diff --git a/Cargo.toml b/Cargo.toml index 2b3f364..b491ebf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,7 @@ categories = ["filesystem", "os", "os::macos-apis", "os::unix-apis"] build = "build.rs" [dependencies] -#libc = "^0.2" -libc = { git = "https://github.com/rust-lang/libc" } +libc = "^0.2" [lib] ...
3
17
103
41f99815a3b7c5a55ec93b518e2a5b8065027805
Guillaume Gomez
2017-07-20T17:40:58
Update examples
diff --git a/examples/src/simple.rs b/examples/src/simple.rs index f83fb49..65d4cd6 100644 --- a/examples/src/simple.rs +++ b/examples/src/simple.rs @@ -11,7 +11,7 @@ extern crate sysinfo; extern crate libc; -use sysinfo::{ProcessExt, ProcessorExt, Signal, System, SystemExt}; +use sysinfo::{NetworkExt, ProcessExt, ...
1
6
1
4f1cbcef406547e46390c237429bb9b1dc9f9b26
Guillaume Gomez
2017-07-20T17:37:49
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 3adee51..2b3f364 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.11" +version = "0.3.12" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
f75ff1a1ff0ca5f9fa918d8201693c103cd5eef8
Guillaume Gomez
2017-07-19T23:05:44
Add network usage
diff --git a/Cargo.toml b/Cargo.toml index cd3449e..3adee51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,8 @@ categories = ["filesystem", "os", "os::macos-apis", "os::unix-apis"] build = "build.rs" [dependencies] -libc = "^0.2" +#libc = "^0.2" +libc = { git = "https://github.com/rust-lang/libc" } [lib] ...
10
301
25
4d6086193b5377fb1e579d7f48bd384f01c3e801
Guillaume Gomez
2017-07-09T20:27:39
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index 09ab27e..cd3449e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.10" +version = "0.3.11" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
32c27957683d931f8163d2812d5a7e14f056e30f
sp3d
2017-07-09T15:35:37
try to fix macOS compilation errors
diff --git a/src/mac/disk.rs b/src/mac/disk.rs index 1d2f9f2..e0c2784 100644 --- a/src/mac/disk.rs +++ b/src/mac/disk.rs @@ -5,10 +5,13 @@ // use ::DiskExt; +use ::utils; use libc::statfs; use std::{mem, str}; use std::fmt::{Debug, Error, Formatter}; +use std::path::{Path, PathBuf}; +use std::ffi::{OsStr, OsSt...
2
33
31
54c6288db9ba61bf459213e1eb7c9d6fca9e4a30
sp3d
2017-07-09T15:34:31
move to_cpath to utils
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 888313c..5d33952 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -5,6 +5,7 @@ // use ::DiskExt; +use ::utils; use super::system::get_all_data; use libc::statvfs; @@ -52,17 +53,8 @@ fn find_type_for_name(name: &OsStr) -> DiskType DiskType::f...
2
17
11
2950a6edcd02f9efe27c150e8950eefbcb7ac12d
sp3d
2017-07-09T15:22:47
appease clippy in find_type_for_name
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index a812069..888313c 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -37,10 +37,11 @@ impl From<isize> for DiskType { fn find_type_for_name(name: &OsStr) -> DiskType { + #![allow(or_fun_call)] /* turn "sda1" into "sda": */ let mut trimmed: ...
1
2
2
3e3f704154b5cf0bb2d2636b8fe6511d568c9880
sp3d
2017-07-09T01:52:57
rename disks_info -> disk_types for accuracy
diff --git a/src/mac/system.rs b/src/mac/system.rs index 8d3023c..e7db450 100644 --- a/src/mac/system.rs +++ b/src/mac/system.rs @@ -182,7 +182,7 @@ fn make_name(v: &[u8]) -> Option<String> { String::from_utf8(v.to_vec()).ok() } -fn get_disks_info() -> HashMap<String, DiskType> { +fn get_disk_types() -> HashMap...
1
4
8
46192cac66172bc2a8938796eb8829fb8c8b993b
sp3d
2017-07-09T01:52:25
minor cleanups
diff --git a/src/linux/system.rs b/src/linux/system.rs index 5fbd44d..7bc519b 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -20,6 +20,7 @@ use libc::{pid_t, uid_t, sysconf, _SC_CLK_TCK, _SC_PAGESIZE}; use utils::realpath; /// Structs containing system's information. +#[derive(Debug)] pub struct Sys...
1
23
15
a34f470202a12545f02721164b31e6286a75b305
sp3d
2017-07-09T01:51:15
optimize file reading
diff --git a/src/linux/system.rs b/src/linux/system.rs index 9280f4f..5fbd44d 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -392,13 +392,14 @@ fn _get_process_data(path: &Path, proc_list: &mut Process, page_size_kb: u64, pi } } -#[allow(unused_must_use)] fn copy_from_file(entry: &Path) -> Vec<...
1
4
3
1bd1d09fe599b3b127cdbcbda98c18c8b5e4737a
sp3d
2017-07-09T01:47:42
convert disk API to OsStr/Path, correct SSD/HDD confusion, simplify mounts parsing
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 2664b88..a812069 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -10,7 +10,9 @@ use super::system::get_all_data; use libc::statvfs; use std::{mem, str}; use std::fmt::{Debug, Error, Formatter}; -use std::str::FromStr; +use std::path::{Path, PathBuf};...
3
70
52
d883063abccd6fe8d54fc7c28f10611d9f945592
sp3d
2017-07-09T01:39:52
simplify and speed up some parsing
diff --git a/src/linux/system.rs b/src/linux/system.rs index 5ef189e..4efdbe8 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -85,41 +85,26 @@ impl SystemExt for System { fn refresh_system(&mut self) { let data = get_all_data("/proc/meminfo").unwrap(); - let lines: Vec<&str> = data....
1
10
25
efb56c153dd9ad68c0781458e4a28f6ae56d44b6
Guillaume Gomez
2017-07-08T20:28:50
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index d0df435..09ab27e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.9" +version = "0.3.10" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
53b6bbd4ea3ab07a2b85aef3b85f4dbb9d2cc8fe
Guillaume Gomez
2017-07-08T20:28:43
Add get_current_pid function
diff --git a/src/sysinfo.rs b/src/sysinfo.rs index 1d60ea6..be2f4ec 100644 --- a/src/sysinfo.rs +++ b/src/sysinfo.rs @@ -76,6 +76,8 @@ pub use traits::{ ProcessorExt, SystemExt, }; +#[cfg(not(target_os = "windows"))] +pub use utils::get_current_pid; #[cfg(feature = "c-interface")] pub use c_interface::*; ...
2
13
1
a570bb739a92e7c6d5577acb2371e06f71436dc6
Guillaume Gomez
2017-07-02T11:28:31
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index b2d6569..d0df435 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.8" +version = "0.3.9" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1
7420ad163503f59e26e6216fb50afbea1cdc2a39
Ferry Jérémie
2017-07-02T10:59:21
fix a run-time panic : attempt to multiply with overflow on a 32bits arch with a disk > 1To
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 568f952..2664b88 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -47,8 +47,8 @@ pub fn new_disk(name: &str, mount_point: &str, file_system: &str) -> Disk { unsafe { let mut stat: statvfs = mem::zeroed(); if statvfs(mount_point.as_...
1
3
3
6b1a6ed5202f4e10481355a90d5f5ff375c34611
Guillaume Gomez
2017-06-07T22:29:59
Update crate version
diff --git a/Cargo.toml b/Cargo.toml index aed097c..b2d6569 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.3.7" +version = "0.3.8" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to handle processes"
1
1
1