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
0b7e998870f7a574f0232e2fb68e7fdb15fd2abb
Guillaume Gomez
2024-04-08T20:36:49
Improve `Cargo.toml`
diff --git a/Cargo.toml b/Cargo.toml index d3a383e..e3cd9be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" readme = "README.md" rust-version = "1.74" exclude = ["/test-unknown"] -categories = ["filesystem", "os", "api-bindings"] +keywords = ["system-information", "disk", "process", "network...
1
2
2
258e1cf5dae816f81a4fc558c737a7a87a19728f
Guillaume Gomez
2024-04-08T17:40:44
Update crate version to 0.30.9
diff --git a/Cargo.lock b/Cargo.lock index e5633f8..3c5eb8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.8" +version = "0.30.9" dependencies = [ "bstr", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 09e65e5..d3a383e 100644 --...
2
2
2
3fd2df9b8b9ee41fc4917fda904992f9a253969d
Guillaume Gomez
2024-04-06T23:44:51
Improve Windows code
diff --git a/src/common.rs b/src/common.rs index 630885a..d4fb53e 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1627,7 +1627,7 @@ impl UpdateKind { /// /// When all refresh are ruled out, a [`Process`] will still retrieve the following information: /// * Process ID ([`Pid`]) -/// * Parent process ID +/// * P...
6
134
186
8438999fd505e4db91bf405381289c8dd1aa3133
Rafał Mikrut
2024-04-07T12:58:47
is_dir/is_file small improvements
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 0b9c897..60f62af 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -240,9 +240,16 @@ impl ComponentInner { let dir = read_dir(folder).ok()?; let mut matchings: HashMap<u32, Component> = HashMap::wi...
3
29
14
38bceab57714f0bcbf76bc56dbbbaf2a3597d411
Guillaume Gomez
2024-04-06T20:43:50
Prevent dual compilation of `test_binary`
diff --git a/tests/process.rs b/tests/process.rs index b48a4ad..a97f98c 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -81,11 +81,11 @@ fn test_cmd() { } } -fn build_test_binary() { +fn build_test_binary(file_name: &str) { std::process::Command::new("rustc") .arg("test_bin/main.rs") ...
1
8
6
edfbe928e7c68267e6e73aab7fba478c18b2ece7
Guillaume Gomez
2024-04-06T20:17:52
Fix linux `Process::parent` retrieval
diff --git a/src/unix/linux/network.rs b/src/unix/linux/network.rs index a428cc2..ca90cfa 100644 --- a/src/unix/linux/network.rs +++ b/src/unix/linux/network.rs @@ -1,9 +1,9 @@ // Take a look at the license at the top of the repository in the LICENSE file. use std::collections::{hash_map, HashMap}; +use std::fs::Fi...
2
16
14
e342557f0919df779b80f0cccd7190ddb9ff5a9e
Guillaume Gomez
2024-04-06T19:20:22
Add regression test for `Process::parent` update
diff --git a/test_bin/main.rs b/test_bin/main.rs index d154250..8957b00 100644 --- a/test_bin/main.rs +++ b/test_bin/main.rs @@ -1,5 +1,25 @@ // Does nothing and just exits after waiting for 30 seconds. +use std::process::{Child, Command}; + +fn maybe_start_child(last: String, args: &[String]) -> Option<Child> { + ...
2
68
1
bc8f7f732380c9945a6ced7345b38624bf1d8218
Guillaume Gomez
2024-04-06T19:20:07
Update `Process::parent` at every refresh
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 7712166..9b06b33 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -335,6 +335,13 @@ unsafe fn get_bsd_info(pid: Pid) -> Option<libc::proc_bsdinfo> { } } +fn get_parent(info: &libc::proc_bsdi...
4
28
10
772c18956e60fc768c71926620295e782d2e0ea2
Guillaume Gomez
2024-04-02T14:55:39
Update crate version to 0.30.8
diff --git a/Cargo.lock b/Cargo.lock index 086bdab..e5633f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.7" +version = "0.30.8" dependencies = [ "bstr", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 439feaf..09e65e5 100644 --...
2
2
2
d3708f2c488b0ddeae6f8feaa34c541303c45a18
Ana Hobden
2024-03-28T13:49:44
Fully prevent NaNs from cpu_usage() on Mac
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 57eb7dc..11ff26c 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -239,19 +239,30 @@ fn get_idle(cpu_info: *mut i32, offset: isize) -> i32 { pub(crate) fn compute_usage_of_cpu(proc_: &Cpu, cpu_info: *mut i32, offset: isize) -> f32 { ...
1
18
7
adcf3c6265b41e74959fc5d07c0bb6bffc6e36e1
Ana Hobden
2024-03-28T04:17:08
Fixup clippy & review nit
diff --git a/src/lib.rs b/src/lib.rs index 85de32c..e24d707 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -454,6 +454,7 @@ mod test { } #[test] + #[allow(clippy::const_is_empty)] fn check_nb_supported_signals() { if IS_SUPPORTED_SYSTEM { assert!( diff --git a/src/unix/apple/cpu.r...
2
2
2
3c6dcc76b3d6dfd9dccff0aa6c8badb7364c618a
Ana Hobden
2024-03-27T19:41:39
Prevent Mac cpu_usage() from returning NaN
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 18c0e99..21a31d9 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -7,11 +7,14 @@ use libc::{c_char, c_void, host_processor_info, mach_port_t, mach_task_self}; use std::mem; use std::ops::Deref; use std::sync::Arc; +use std::time::Insta...
2
27
1
b7d7f317bad003cd6053a967c668d524ab84b0b0
Sheldon Young
2024-03-20T19:13:21
Multithreaded component refresh (#1232) * Multithreaded component refresh * Create utils::into_iter_mut to complement utils::into_iter. * Fix invalid parallelization `cfg`, preventing multi-threading on linux
diff --git a/src/common.rs b/src/common.rs index b88a8bf..630885a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,8 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::{ - ComponentInner, ComponentsInner, CpuInner, NetworkDataInner, NetworksInner, ProcessInner,...
3
53
19
48718689fcb14ce9a52af2346fff01ca2615762e
Sheldon Young
2024-03-19T18:27:59
Rename TermalSensor to ThermalSensorType
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 1cbed67..0b9c897 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -57,7 +57,7 @@ pub(crate) struct ComponentInner { /// - 5: AMD AMDSI /// - 6: Intel PECI /// Not all types are supported by all chips...
1
4
4
5f7a3972114b00919ecd730f1295218daae01289
Christopher Serr
2024-03-18T20:02:00
Use `OsString` for Process Args and Env Vars This continues the "os stringification" on the `Process` type where now not only the process name, but also the arguments and environment variables are also done as `OsString`, mirroring `std`.
diff --git a/Cargo.toml b/Cargo.toml index dea4cbc..439feaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,7 @@ cargo-args = ["-Zbuild-std"] rustdoc-args = ["--generate-link-to-definition"] [dependencies] +bstr = "1.9.0" cfg-if = "1.0" memchr = "2.7.1" rayon = { version = "^1.8", optional = true } @@ -95,...
10
77
82
5a4c4ed01b09b4549a4ae324d25d69795b03a4de
gongzhengyang
2024-03-11T02:41:07
fix: fix misaligned pointer dereference
diff --git a/src/unix/network_helper.rs b/src/unix/network_helper.rs index 0e4c3d3..42798ad 100644 --- a/src/unix/network_helper.rs +++ b/src/unix/network_helper.rs @@ -180,7 +180,7 @@ fn sockaddr_to_network_addr(sa: *const libc::sockaddr) -> Option<IpAddr> { None } else { let addr = ...
1
2
2
112d4f94fc8c83acd5564943cf56fd073e9c42ab
Robin Rolf
2024-03-06T21:33:32
Add feature flag `linux-tmpfs` to list tmpfs mounts
diff --git a/Cargo.toml b/Cargo.toml index 4257739..cc5b0e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ apple-app-store = ["apple-sandbox"] c-interface = [] multithread = ["rayon"] linux-netdevs = [] +linux-tmpfs = [] debug = ["libc/extra_traits"] # This feature is used on CI to emulate unknown/unsu...
3
5
1
a1d27e3259b2f82c3dbbae16050a1db7f23fab63
Guillaume Gomez
2024-03-06T19:24:57
Update crate version to 0.30.7
diff --git a/Cargo.lock b/Cargo.lock index cbf6900..9209bbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.6" +version = "0.30.7" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index c4cbe42..42...
2
2
2
180018bc81b8cb3d926de60b44431b3aea8787f1
Guillaume Gomez
2024-03-06T19:25:13
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 2b5f765..cbf6900 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1...
1
35
51
2fe60934273f56f6d8995486dd162309784dde4b
David Herberth
2024-03-05T15:27:29
remove memory stat code from cgroup mem calculation
diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs index 734e645..61ed815 100644 --- a/src/unix/linux/system.rs +++ b/src/unix/linux/system.rs @@ -557,10 +557,6 @@ impl crate::CGroupLimits { limits.free_swap = sys.swap_total.saturating_sub(swap_cur); } - read_tab...
1
0
4
770f6ceea993049c8f572035cac55795c66e2e75
Jan van der Lugt
2024-03-01T19:46:05
Clarify comment about disk_usage() in FreeBSD
diff --git a/src/common.rs b/src/common.rs index 2d8255c..40bbfa1 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1140,8 +1140,8 @@ impl Process { /// Returns number of bytes read and written to disk. /// - /// ⚠️ On Windows and FreeBSD, this method actually returns **ALL** I/O - /// read and writt...
1
2
2
ec95f1dcb9019190cc8591009f0b29e66be89ea8
Guillaume Gomez
2024-03-01T17:40:22
Fix `test_process_run_time`
diff --git a/tests/process.rs b/tests/process.rs index f894fb8..8f04a17 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -784,7 +784,7 @@ fn test_process_run_time() { let current_pid = sysinfo::get_current_pid().expect("failed to get current pid"); s.refresh_process(current_pid); let run_time = s....
1
1
1
3d990b9cef49925a0c8e9889888b10f65d51a276
Guillaume Gomez
2024-03-01T16:00:57
Update crate version to 0.30.6
diff --git a/Cargo.lock b/Cargo.lock index b14bad2..2b5f765 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.5" +version = "0.30.6" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 3312ef7..c4...
2
2
2
0e4a8793122a3b39cfb7e6dcaccfe9483d32928e
Guillaume Gomez
2024-03-01T15:38:55
Add test for process::run_time
diff --git a/tests/process.rs b/tests/process.rs index 0232472..f894fb8 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -774,3 +774,23 @@ fn test_refresh_pids() { assert!(pids.contains(pid)); } } + +#[test] +fn test_process_run_time() { + if !sysinfo::IS_SUPPORTED_SYSTEM || cfg!(feature = "app...
1
20
0
3a95615a29c94c6694667820c154f69f1a5ff6f2
Jan van der Lugt
2024-02-29T19:39:28
Update run_time for MacOS processes
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 8935558..38d93c1 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -686,6 +686,7 @@ pub(crate) fn update_process( } }; p.status = thread_status; + ...
1
1
0
26402d2899d75d28f4a1e40bf32a862f40ee64c1
sisungo
2024-02-25T15:26:04
Add `sysinfo::Groups` implementation (#1210) Add `sysinfo::Groups` implementation
diff --git a/src/common.rs b/src/common.rs index 753b6b0..2d8255c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -7,7 +7,7 @@ use crate::{ use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; -use std::convert::{From, TryFrom}; +use std::convert::TryFrom; use std::ffi::OsStr; use std::fmt; use st...
15
411
14
790273af2512d9052e5d16aa4074deadd542393f
Guillaume Gomez
2024-01-11T15:09:18
Fix new clippy lints
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index c9bf4ff..c58f86a 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -7,6 +7,7 @@ use crate::sys::utils::{get_sys_value, get_sys_value_by_name}; use crate::{Cpu, CpuRefreshKind, LoadAvg, MemoryRefreshKind, Pid, Process, Proces...
2
5
0
31b7bd68abf0e422fd5e97bfd0b875d18188dd2b
Guillaume Gomez
2024-01-11T15:06:22
Use `PF_KTHREAD` from libc
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 9c1d558..4089165 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -88,9 +88,6 @@ enum ProcIndex { // More exist but we only use the listed ones. For more, take a look at `man proc`. } -/* Not exposed yet. Defined a...
1
1
4
2d6e1a5e6ef977404a2e9988dc4025fa2be50d04
Guillaume Gomez
2024-01-11T15:04:59
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 4ba3f89..b14bad2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0...
2
32
54
a261a9385b8d5c2845f8faec736bbc9c579561fa
Guillaume Gomez
2024-01-05T11:21:01
Update crate version to 0.30.5
diff --git a/Cargo.lock b/Cargo.lock index 88b0bd7..4ba3f89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.4" +version = "0.30.5" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 8d7466a..04...
2
2
2
296e13c73d0a2b8a37c8f1d6bce203cbc97fa2b4
Guillaume Gomez
2024-01-05T10:59:11
Clean up windows platform source code a bit
diff --git a/src/windows/process.rs b/src/windows/process.rs index 57971f1..3178b9b 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -271,8 +271,9 @@ unsafe fn get_process_name(pid: Pid) -> Option<String> { ProcessId: pid.0 as _, ImageName: MaybeUninit::zeroed().assume_init(), ...
2
8
12
953d28ac04ee5a695138e840a27024f56961f32d
Guillaume Gomez
2024-01-03T19:58:13
Update crate version to 0.30.4
diff --git a/Cargo.lock b/Cargo.lock index e333037..88b0bd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.3" +version = "0.30.4" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 6349915..8d...
2
2
2
e5e3e757607a53fa85977d441c38a1a0c79930c2
Luna Nova
2024-01-03T19:28:54
src/windows/system.rs: fix misaligned read Fixes #1191
diff --git a/src/windows/system.rs b/src/windows/system.rs index b09638e..b621e71 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -280,15 +280,15 @@ impl SystemInner { .offset(process_information_offset) as *const SYSTEM_PROCESS_INFORMATION; - ...
1
4
4
cfa40b663fde1734c59beb4f0a9feaf104f21e42
Pascal Craponne
2024-01-02T09:53:19
Removed premature exit from `get_process_params` for 32-bits platforms Because it works with 32 -> 32 bits (of course not for 32 -> 64 bits because of address space)
diff --git a/src/windows/process.rs b/src/windows/process.rs index 06884a1..57971f1 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -857,10 +857,6 @@ impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS32); impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS); unsafe fn get_process_...
1
0
4
b0574b57043bdb29b70e93771597d0535fcb26a7
pascal
2023-12-30T17:44:23
`cargo fmt`
diff --git a/src/windows/system.rs b/src/windows/system.rs index ef35c46..4601893 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -157,8 +157,10 @@ impl SystemInner { let physical_total = perf_info.PhysicalTotal as u64; let commit_limit = perf_info.CommitLimit...
1
4
2
8fbdc5c16fda0b8ba429945066f2118e467af43c
pascal
2023-12-30T17:30:04
Dead end getting 64bit process information from 32bit because of address space
diff --git a/src/windows/process.rs b/src/windows/process.rs index 57971f1..06884a1 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -857,6 +857,10 @@ impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS32); impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS); unsafe fn get_process_...
1
4
0
c5193c1dcd16110ac1f618dd3064563118ab5584
pascal
2023-12-30T16:56:41
Memory computation was using usize on 32 bits platform, which led to overflow, now using u64
diff --git a/src/windows/system.rs b/src/windows/system.rs index b09638e..ef35c46 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -153,16 +153,12 @@ impl SystemInner { ) .as_bool() { - let swap_total = perf_info.PageSize.saturating_...
1
6
10
cec1a2f000055f3f971015a68b7c11e230aa87ea
pascal
2023-12-30T16:51:45
Removed commented out code (old reflex for an old developer 😅)
diff --git a/src/windows/process.rs b/src/windows/process.rs index f5e8bb8..57971f1 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -857,10 +857,6 @@ impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS32); impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS); unsafe fn get_process_...
1
0
4
b1dbbec2d8016084d03aebabd21b4361ccf6cf3b
pascal
2023-12-30T16:40:04
Increased buffer size to get process name The name may be a full UNC path, up to 32768 characters
diff --git a/src/windows/process.rs b/src/windows/process.rs index 0631895..f5e8bb8 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -272,7 +272,7 @@ unsafe fn get_process_name(pid: Pid) -> Option<String> { ImageName: MaybeUninit::zeroed().assume_init(), }; // `MaximumLength` MUST ...
1
5
5
d89316b95d05b467dbd956fc3bf57f5bd30a355a
Guillaume Gomez
2023-12-29T20:23:27
Update crate version to 0.30.3
diff --git a/Cargo.lock b/Cargo.lock index 7a9d3a6..e333037 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.2" +version = "0.30.3" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 1704cf9..63...
2
2
2
d0fab9a6fabc50529c460e920d149fdac0f15226
Guillaume Gomez
2023-12-29T20:07:39
Fix windows build
diff --git a/src/windows/process.rs b/src/windows/process.rs index af63f87..0631895 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -291,15 +291,17 @@ unsafe fn get_process_name(pid: Pid) -> Option<String> { &mut info as *mut _ as *mut _, size_of::<SYSTEM_PROCESS_ID_INFORMA...
2
17
14
ff4a0616b22150f4b53cad21ef48a22dc0cbc023
onur-ozkan
2023-12-29T19:06:08
optimize dependency stack by removing duplications Signed-off-by: onur-ozkan <work@onurozkan.dev>
diff --git a/Cargo.lock b/Cargo.lock index 96e6531..7a9d3a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.52.0", + "wi...
2
21
87
9645f8fb14f2a084c088de3f33eaf994305f022f
Guillaume Gomez
2023-12-28T23:05:37
Update crate version to 0.30.2
diff --git a/Cargo.lock b/Cargo.lock index 2f78e76..96e6531 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.1" +version = "0.30.2" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 3fed1ed..25...
2
2
2
e429e05944ced5c21183f1265a1e4b48be672c8a
Guillaume Gomez
2023-12-28T22:34:56
Add Process::thread_kind API
diff --git a/src/common.rs b/src/common.rs index bc82704..798ab1a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1278,7 +1278,7 @@ impl Process { /// Tasks run by this process. If there are none, returns `None`. /// - /// ⚠️ This method always returns `None` on other plantforms than Linux. + /// ⚠...
4
87
11
fecaa4ad0c814c6128cd580531f9e76e9c78e80e
Guillaume Gomez
2023-12-25T19:29:20
Update crate version to 0.30.1
diff --git a/Cargo.lock b/Cargo.lock index 5db29b6..2f78e76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.0" +version = "0.30.1" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 767b854..3f...
2
2
2
07432e3f50f2e48f77de16d3bda92b6647d93681
Daniel Boline
2023-12-25T15:38:59
first column in statm is total size, second column is resident set size
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index cccce9a..d67b928 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -566,12 +566,12 @@ fn get_memory(path: &Path, entry: &mut ProcessInner, info: &SystemInfo) -> bool return false; } let mut parts = buf.sp...
1
2
2
64245b0c562fbc338a7d42b60b964ca9e855da99
Guillaume Gomez
2023-12-20T21:05:42
Update crate version to 0.30.0
diff --git a/Cargo.lock b/Cargo.lock index 3a5cfd1..5db29b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.11" +version = "0.30.0" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 83d27c7..7...
2
2
2
476c72b39d0be4f9ba19dd7d7ca5e6dfe72ff127
Guillaume Gomez
2023-12-20T16:20:29
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index c5248e2..3a5cfd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,15 +28,15 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com...
1
109
50
754f40fa68058d8b33f04f8be579881d0650245c
Guillaume Gomez
2023-12-19T17:59:39
Disable part of `test_refresh_memory` test on mac CI
diff --git a/tests/system.rs b/tests/system.rs index d5f9626..1893926 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -207,6 +207,11 @@ fn test_refresh_memory() { assert_eq!(s.total_swap(), 0); assert_eq!(s.free_swap(), 0); + if std::env::var("APPLE_CI").is_ok() { + // Apparently there is no...
1
5
0
f1a76954e4d3056d440eeb724d34cc4018d52f4d
Guillaume Gomez
2023-12-19T17:34:48
Add tests for `System::refresh_memory_specifics`
diff --git a/tests/system.rs b/tests/system.rs index 3ad2d98..d5f9626 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -122,10 +122,10 @@ fn check_boot_time() { #[test] #[ignore] // This test MUST be run on its own to prevent wrong CPU usage measurements. fn test_consecutive_cpu_usage_update() { - use sysinf...
1
48
1
d491c39234e71af618758ed7258fc178294277a8
Guillaume Gomez
2023-12-19T17:19:08
Move some tests around to centralize them
diff --git a/src/common.rs b/src/common.rs index 28df773..353e192 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1786,7 +1786,7 @@ impl CpuRefreshKind { /// let mut system = System::new(); /// /// // We don't want to update all memories information. -/// system.refresh_memory_specifics(CpuRefreshKind::new().with...
4
238
248
39e58a62ed60bf6846d09bd91806c84907c48dc9
Guillaume Gomez
2023-12-19T17:14:30
Create new `MemoryRefreshKind` type and new `System::refresh_memory_specifics` method
diff --git a/src/common.rs b/src/common.rs index 9a0a555..28df773 100644 --- a/src/common.rs +++ b/src/common.rs @@ -105,8 +105,8 @@ impl System { /// ); /// ``` pub fn refresh_specifics(&mut self, refreshes: RefreshKind) { - if refreshes.memory() { - self.refresh_memory(); + if ...
7
202
96
dd4d12d446aad70b997b54dabe6b3da12d8f9803
Guillaume Gomez
2023-12-18T15:09:29
Force value type to be `c_int`
diff --git a/src/unix/freebsd/cpu.rs b/src/unix/freebsd/cpu.rs index f2c7847..16e3fb7 100644 --- a/src/unix/freebsd/cpu.rs +++ b/src/unix/freebsd/cpu.rs @@ -187,7 +187,7 @@ pub(crate) fn physical_core_count() -> Option<usize> { } unsafe fn get_frequency_for_cpu(cpu_nb: usize) -> u64 { - let mut frequency = 0; + ...
1
1
1
5d729b457d139dc113ffcbef6ed69f5dce40da38
Guillaume Gomez
2023-12-17T23:14:29
Read file in one go instead of iterating over lines in `get_system_info_linux`
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index ca5334c..c04dc07 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -381,7 +381,7 @@ impl SystemInner { #[cfg(target_os = "macos")] let long_name = Some(format!( "MacOS {} {}", - self.os...
2
16
8
194a47b23d914d3bfa243b558d83cca3dcfc0a2f
Guillaume Gomez
2023-12-17T22:57:20
Make `System::host_name` return `None` instead of an empty string on FreeBSD if cannot retrieve information
diff --git a/src/unix/freebsd/system.rs b/src/unix/freebsd/system.rs index 8bb8f7c..d8fc233 100644 --- a/src/unix/freebsd/system.rs +++ b/src/unix/freebsd/system.rs @@ -238,7 +238,7 @@ impl SystemInner { let mut hostname: [c_int; 2] = [0; 2]; unsafe { init_mib(b"kern.hostname\0", &mut hos...
1
1
1
f0a79e318de5f63dc4f404b206cdc288896ce795
Guillaume Gomez
2023-12-17T17:28:01
Add test for `System::refresh_pids`
diff --git a/tests/process.rs b/tests/process.rs index 9f1502b..9c67fa1 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -474,7 +474,7 @@ fn test_wait_child() { std::process::Command::new("waitfor") .arg("/t") .arg("300") - .arg("RefreshProcess") + .arg("W...
1
37
1
fcf73c8f1e11538ad4567827e72fa00972fa423e
Guillaume Gomez
2023-12-17T17:21:21
Add `System::refresh_pids` and `System::refresh_pids_specifics` methods
diff --git a/src/common.rs b/src/common.rs index a233c5f..73b8caf 100644 --- a/src/common.rs +++ b/src/common.rs @@ -265,7 +265,65 @@ impl System { /// s.refresh_processes_specifics(ProcessRefreshKind::new()); /// ``` pub fn refresh_processes_specifics(&mut self, refresh_kind: ProcessRefreshKind) { - ...
7
185
10
89cfe8a6dc374c03140bf0e915b69ef4db8e70f2
Guillaume Gomez
2023-12-17T14:45:54
Fix clippy lint
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index b036e7e..9dfce95 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -225,10 +225,8 @@ impl SystemInner { let port = self.port; time_interval = self.clock_info.as_mut().map(|c| c.get_time_interval(port))...
1
2
4
4c2caa1689b5490495b5af669f48cc90f2f46941
Guillaume Gomez
2023-12-15T15:53:47
Fix clippy lints
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 6c53376..1fa072a 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -556,7 +556,7 @@ fn slice_to_nb(s: &[u8]) -> u64 { for c in s { nb = nb * 10 + (c - b'0') as u64; } - return nb; + nb } fn get_...
2
7
5
afb74418401351ddc3e8e6f31593a1a3ee11766a
Guillaume Gomez
2023-12-15T15:24:02
Linux: Improve memory information retrieval
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index f1da6bc..6c53376 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -400,8 +400,6 @@ fn update_proc_info( refresh_kind: ProcessRefreshKind, proc_path: &mut PathHandler, parts: &[&str], - memory: u64, - v...
1
57
47
8d5449d8d42e1832f03aa454cff08805c0cb812a
Guillaume Gomez
2023-11-30T00:01:52
Linux: Improve code readability
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 946b5a4..f1da6bc 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -56,6 +56,36 @@ impl fmt::Display for ProcessStatus { } } +#[allow(dead_code)] +#[repr(usize)] +enum ProcIndex { + Pid = 0, + ShortExe, + S...
1
55
18
8be2c4f1711171f4a1e1077150e9c3f3fc36ca77
Guillaume Gomez
2023-11-29T16:30:25
Make `Process::exe`, `Process::cwd` and `Process::root` return an `Option<&Path>`
diff --git a/src/c_interface.rs b/src/c_interface.rs index f48cff9..1cf9ba9 100644 --- a/src/c_interface.rs +++ b/src/c_interface.rs @@ -462,7 +462,7 @@ pub extern "C" fn sysinfo_process_executable_path(process: CProcess) -> RString assert!(!process.is_null()); let process = process as *const Process; un...
11
142
191
96ffca3e024b4acdac83b5287300e1a78edb2b86
Guillaume Gomez
2023-11-29T17:00:35
Remove `test_process` test
diff --git a/tests/process.rs b/tests/process.rs index 8efeeac..9fd414e 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -2,28 +2,6 @@ use sysinfo::{Pid, ProcessRefreshKind, System, UpdateKind}; -#[test] -fn test_process() { - let mut s = System::new(); - assert_eq!(s.processes().len(), 0); - s.ref...
1
0
22
26fb8575304e2e4d2b788833127abc46fe27c04e
Guillaume Gomez
2023-11-29T15:54:03
Get process::exe information by default
diff --git a/src/common.rs b/src/common.rs index 003dc97..d7e6ffd 100644 --- a/src/common.rs +++ b/src/common.rs @@ -221,13 +221,14 @@ impl System { /// It does the same as: /// /// ```no_run - /// # use sysinfo::{ProcessRefreshKind, System}; + /// # use sysinfo::{ProcessRefreshKind, System, Update...
2
17
17
a5a6f3bee72dc7859625f87aa6cf1964ace3cef5
Guillaume Gomez
2023-11-29T14:50:24
Improve documentation
diff --git a/src/common.rs b/src/common.rs index f86de6f..003dc97 100644 --- a/src/common.rs +++ b/src/common.rs @@ -37,8 +37,7 @@ impl Default for System { impl System { /// Creates a new [`System`] instance with nothing loaded. /// - /// Use the [`refresh_all`] method to update its internal information ...
1
9
7
f0ea785a7e7e493f916a7cd6897bc8bd8035c83c
Guillaume Gomez
2023-11-29T00:12:50
Update tests
diff --git a/tests/process.rs b/tests/process.rs index c7baf24..6cb5ac2 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use sysinfo::{Pid, ProcessRefreshKind, System}; +use sysinfo::{Pid, ProcessRefreshKind, System,...
1
7
7
366c17fed4672c5ee0de9b356c620ca36a285562
Guillaume Gomez
2023-11-28T16:38:19
Implement `UpdateKind` for freebsd
diff --git a/src/unix/freebsd/process.rs b/src/unix/freebsd/process.rs index 42289dc..6617f7e 100644 --- a/src/unix/freebsd/process.rs +++ b/src/unix/freebsd/process.rs @@ -298,7 +298,10 @@ pub(crate) unsafe fn get_process_data( } pub(crate) unsafe fn get_exe(exe: &mut PathBuf, pid: crate::Pid, refresh_kind: Proces...
2
25
10
ad7b29a867347e9822a1d7cc59b7b2e20be30253
Guillaume Gomez
2023-11-28T16:29:27
Implement `UpdateKind` for windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index 9ea4f8e..ea962f6 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -88,10 +88,7 @@ fn get_process_handler(pid: Pid) -> Option<HandleWrapper> { }) } -unsafe fn get_process_user_id( - handle: &HandleWrapper, - refresh_k...
1
64
27
1b642168ec0d3df905fb103a444fe14aa905e56d
Guillaume Gomez
2023-11-28T16:01:10
Implement `UpdateKind` for mac
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index f7fe1df..b1135af 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -388,7 +388,10 @@ unsafe fn get_exe_and_name_backup( process: &mut ProcessInner, refresh_kind: ProcessRefreshKind, ) -> b...
1
25
9
fd696f151bc7829a6637cbfd6893f96f3fd6ec45
Guillaume Gomez
2023-11-28T15:51:06
Add `UpdateKind` enum and update linux targets
diff --git a/src/common.rs b/src/common.rs index be3359d..f86de6f 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1342,6 +1342,65 @@ assert_eq!(r.", stringify!($name), "(), false); } }; + // To handle `UpdateKind`. + ($ty_name:ident, $name:ident, $with:ident, $without:ident, UpdateKind $(, $ext...
3
163
40
24b7cc7e91aecf12af708fb33709d6869c3c430c
Guillaume Gomez
2023-11-26T21:27:51
Update crate version to 0.29.11
diff --git a/Cargo.lock b/Cargo.lock index df48e44..c5248e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.10" +version = "0.29.11" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/Cargo.toml b/Cargo.toml index 62ee950.....
2
2
2
ea08e7f864a616488627490796b8a6e3cc724cde
Guillaume Gomez
2023-11-21T22:00:32
Correctly handle `Vec::reserve`
diff --git a/src/unix/users.rs b/src/unix/users.rs index db5f6bb..41f83c1 100644 --- a/src/unix/users.rs +++ b/src/unix/users.rs @@ -64,6 +64,9 @@ pub(crate) unsafe fn get_group_name( { // If there was not enough memory, we give it more. if last_errno == libc::ERANGE as _ { + ...
4
114
96
84c3b36a730a91229dd5a738c725aac81a08c7c8
jb-alvarado
2023-11-19T22:48:34
add the netdevs feature for the optional bring back of NFS (#1147) Add feature netdevs for optional bring back nfs
diff --git a/Cargo.toml b/Cargo.toml index 32acd4c..62ee950 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ apple-sandbox = [] apple-app-store = ["apple-sandbox"] c-interface = [] multithread = ["rayon"] +linux-netdevs = [] debug = ["libc/extra_traits"] # This feature is used on CI to emulate unknown/un...
3
14
6
38fdd32d150b258b36f18e1be9cd19a6dc119b7d
Gnome!
2023-11-18T15:58:26
Replace REMAINING_FILES static mut with Atomic (#1148) Replace static mut with Atomic --------- Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
diff --git a/src/lib.rs b/src/lib.rs index ca9e0ce..cdf6aa7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -101,6 +101,9 @@ pub fn set_open_files_limit(mut _new_limit: isize) -> bool { cfg_if::cfg_if! { if #[cfg(all(not(feature = "unknown-ci"), any(target_os = "linux", target_os = "android")))] { + ...
3
34
37
18bad27b99cec79cf40023a1fe0da398d15670d9
Guillaume Gomez
2023-11-16T19:24:11
Fix endless loop in `get_user_groups` Co-authored-by: aw-cf <>
diff --git a/src/unix/users.rs b/src/unix/users.rs index e8ef32d..db5f6bb 100644 --- a/src/unix/users.rs +++ b/src/unix/users.rs @@ -91,6 +91,9 @@ pub(crate) unsafe fn get_user_groups( &mut nb_groups as *mut _ as *mut _, ) == -1 { + // Ensure the length matches the number of re...
1
3
0
d03670bff716989816ab0cff8f1ef0c7582170d2
Guillaume Gomez
2023-11-16T12:51:04
Improve `load_average` documentation
diff --git a/src/common.rs b/src/common.rs index f557f53..7b0e115 100644 --- a/src/common.rs +++ b/src/common.rs @@ -633,6 +633,8 @@ impl System { /// Returns the system load average value. /// + /// **Important**: this information is computed every time this function is called. + /// /// ⚠️ This...
1
2
0
9fa21957cddb14a42058029043b821441b89f50d
Guillaume Gomez
2023-11-14T22:18:02
Update process refresh tests
diff --git a/tests/process.rs b/tests/process.rs index 32c12f8..c7baf24 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use sysinfo::{Pid, System}; +use sysinfo::{Pid, ProcessRefreshKind, System}; #[test] fn tes...
1
25
6
cdff8d4d9d15dc736a9ebd3df59b081192053da4
Guillaume Gomez
2023-11-14T22:17:45
Use `as_os_str` instead of `Path::new("")` comparison
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index f7977d0..0ae4de8 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -373,7 +373,7 @@ fn update_proc_info( refresh_user_group_ids(p, proc_path); } - if refresh_kind.exe() && p.exe == Path::new("") { + if...
1
1
1
347785d17a9e3019986f1e051dc764a0553ff162
Guillaume Gomez
2023-11-14T22:17:10
Use new "return impl" syntax
diff --git a/src/common.rs b/src/common.rs index 62a7460..f557f53 100644 --- a/src/common.rs +++ b/src/common.rs @@ -390,16 +390,13 @@ impl System { /// println!("{} {}", process.pid(), process.name()); /// } /// ``` - // FIXME: replace the returned type with `impl Iterator<Item = &Process>` when ...
1
8
14
f447b0e8d186c386ab4938e2f85bf2b34b3126ec
Guillaume Gomez
2023-11-14T21:42:16
Improve documentation for `ProcessRefreshKind`
diff --git a/src/common.rs b/src/common.rs index f059957..62a7460 100644 --- a/src/common.rs +++ b/src/common.rs @@ -289,8 +289,9 @@ impl System { /// It is the same as calling: /// /// ```no_run - /// # use sysinfo::{ProcessRefreshKind, System}; + /// # use sysinfo::{Pid, ProcessRefreshKind, Syste...
1
21
2
7ccbb7cafe529a1505856958b68d43111018f8bc
Guillaume Gomez
2023-11-14T21:35:23
Update `Process::refresh_process` and `Process::refresh_processes` default `ProcessRefreshKind` used
diff --git a/src/common.rs b/src/common.rs index 23b1a98..f059957 100644 --- a/src/common.rs +++ b/src/common.rs @@ -234,11 +234,24 @@ impl System { /// Gets all processes and updates their information. /// - /// It does the same as `system.refresh_processes_specifics(ProcessRefreshKind::everything())`. ...
1
48
5
3fc0b9ee7b727b1cfa590e948ca53cbbb78a3ffc
Guillaume Gomez
2023-11-13T20:51:01
Improve Process root information retrieval
diff --git a/src/windows/process.rs b/src/windows/process.rs index 173b939..9ea4f8e 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -394,8 +394,6 @@ impl ProcessInner { written_bytes: 0, }; get_process_params(&mut p, refresh_kind); - // Should al...
2
44
34
b70562dccaf404b7acebfb024f7ce7ab042452a8
Guillaume Gomez
2023-11-13T20:28:26
Finish extension of `ProcessRefreshKind` for FreeBSD
diff --git a/src/unix/freebsd/process.rs b/src/unix/freebsd/process.rs index 567b409..42289dc 100644 --- a/src/unix/freebsd/process.rs +++ b/src/unix/freebsd/process.rs @@ -248,26 +248,7 @@ pub(crate) unsafe fn get_process_data( } // This is a new process, we need to get more information! - let mut buffe...
2
91
73
ac3a04205cf899574a551957fdda42e9934f5d3e
Guillaume Gomez
2023-11-12T22:16:19
Correctly handle root path on windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index e3c245d..173b939 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -394,6 +394,7 @@ impl ProcessInner { written_bytes: 0, }; get_process_params(&mut p, refresh_kind); + // Should al...
2
18
6
a1c283d60cc0f6910c27537e3a2207835692665a
Guillaume Gomez
2023-11-12T20:12:45
Finish extension of `ProcessRefreshKind` for mac
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 90769b0..f7fe1df 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -1,11 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use std::mem::{self, MaybeUninit};...
2
153
170
4ee2081f5a867f97ea25eac00943f5f2f9839b66
Guillaume Gomez
2023-11-12T16:43:03
Finish extension of `ProcessRefreshKind` for Windows
diff --git a/src/lib.rs b/src/lib.rs index 540980a..ca9e0ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -506,21 +506,6 @@ mod test { ); } - // We ensure that the `Process` cmd information is retrieved as expected. - #[test] - fn check_cmd_line() { - if !IS_SUPPORTED { - return...
4
138
151
57be175c153d7f9fb2d287bd5da0969d182d4a82
Guillaume Gomez
2023-11-09T22:46:05
Finish extension of `ProcessRefreshKind` for Linux
diff --git a/src/common.rs b/src/common.rs index 18bb821..23b1a98 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1455,14 +1455,7 @@ impl ProcessRefreshKind { with_disk_usage, without_disk_usage ); - impl_get_set!( - ProcessRefreshKind, - user, - with_user, - wit...
2
85
79
02dfb892f265c7347588361aed85821129aa0caf
Guillaume Gomez
2023-11-08T21:56:24
Extend `ProcessRefreshKind` to allow more specific updates
diff --git a/src/common.rs b/src/common.rs index a676faa..18bb821 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1401,6 +1401,12 @@ pub struct ProcessRefreshKind { cpu: bool, disk_usage: bool, user: bool, + memory: bool, + cwd: bool, + root: bool, + environ: bool, + cmd: bool, + exe...
8
413
161
a587e2ca95f47ef52382d7eba8ba2b330ac3ac4e
Guillaume Gomez
2023-11-05T16:47:30
Implement `From<Vec>` and `From<X> for Vec<X>` for `Components`, `Disks` and `Users` types
diff --git a/src/common.rs b/src/common.rs index aeb5c86..b7f708f 100644 --- a/src/common.rs +++ b/src/common.rs @@ -2039,6 +2039,20 @@ impl Default for Disks { } } +impl From<Disks> for Vec<Disk> { + fn from(disks: Disks) -> Vec<Disk> { + disks.inner.into_vec() + } +} + +impl From<Vec<Disk>> for D...
11
137
4
a5125e2357b96ac64f96bb4e903b7d4cb24f2bbb
Guillaume Gomez
2023-11-05T14:49:53
Update dependencies
diff --git a/Cargo.lock b/Cargo.lock index 4f39b4b..df48e44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,15 +16,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/c...
2
79
75
1f4bd9f3512ada85ca8d7b1917d3cc919ee4cffb
Guillaume Gomez
2023-11-05T13:40:33
Fix clippy lint
diff --git a/src/common.rs b/src/common.rs index 589f2c1..aeb5c86 100644 --- a/src/common.rs +++ b/src/common.rs @@ -3427,6 +3427,7 @@ mod tests { // This test exists to ensure that the `TryFrom<usize>` and `FromStr` traits are implemented // on `Uid`, `Gid` and `Pid`. + #[allow(clippy::unnecessary_falli...
4
1
3
9d313ae265683c49cc9a03d784a8aa8d461a24bb
Guillaume Gomez
2023-11-04T21:54:36
Fix test issue when checking environment on mac: if you run a "system" binary, you cannot access its environment, so better run a non-system one
diff --git a/test_bin/main.rs b/test_bin/main.rs new file mode 100644 index 0000000..d154250 --- /dev/null +++ b/test_bin/main.rs @@ -0,0 +1,5 @@ +// Does nothing and just exits after waiting for 30 seconds. + +fn main() { + std::thread::sleep(std::time::Duration::from_secs(30)); +} diff --git a/tests/process.rs b/t...
2
45
64
c227dae1b152ecda92a089dd340577386b8cee93
Guillaume Gomez
2023-11-04T23:02:33
Improve `get_sys_value` API in mac
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index ae8bfe1..5ccb0bf 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -279,7 +279,7 @@ pub(crate) fn init_cpus( refresh_kind: CpuRefreshKind, ) { let mut num_cpu = 0; - let mut mib = [0, 0]; + let mut mib = [libc::CTL_HW as _...
3
8
20
fcdc42707d1b901cdaf129c6144755a35666154a
Guillaume Gomez
2023-11-04T21:53:48
Greatly reduce needed memory when retrieving process arguments and environment
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index d549d4e..4112586 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -6,7 +6,7 @@ use std::path::{Path, PathBuf}; use std::borrow::Borrow; -use libc::{c_int, c_void, kill, size_t}; +use libc::{c_i...
2
26
53
3d2b8941e9a43f2bbbbb443d52eb88aa5ec17544
Guillaume Gomez
2023-11-04T21:12:27
Greatly improve code to retrieve process information on macos
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 1b795fa..d549d4e 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -461,33 +461,34 @@ unsafe fn create_new_process( sysinfo_debug!("couldn't get arguments and environment for PID {}", pid.0)...
1
61
63
3eadc6079c0b189b034b7d1cafd04039618e5a59
Guillaume Gomez
2023-11-04T20:39:31
Improve code readability in mac `create_new_process`
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index b690049..1b795fa 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -363,7 +363,7 @@ unsafe fn convert_node_path_info(node: &libc::vnode_info_path) -> PathBuf { unsafe fn create_new_process( p...
1
71
48
f5b7059dadddab27d4798039c2afb00beead3405
Guillaume Gomez
2023-11-02T15:51:32
Improve doc comment formatting
diff --git a/src/common.rs b/src/common.rs index b0237bf..589f2c1 100644 --- a/src/common.rs +++ b/src/common.rs @@ -892,14 +892,14 @@ impl Process { /// Returns the memory usage (in bytes). /// - /// This method returns the [size of the resident set](https://en.wikipedia.org/wiki/Resident_set_size), - ...
1
21
17
4589591b2d5bfe37cd59b007bd66afdfde41818b
Sebastiano Vigna
2023-11-02T12:29:20
Improved docs for process memory methods
diff --git a/src/common.rs b/src/common.rs index 9c7e323..b0237bf 100644 --- a/src/common.rs +++ b/src/common.rs @@ -892,6 +892,15 @@ impl Process { /// Returns the memory usage (in bytes). /// + /// This method returns the [size of the resident set](https://en.wikipedia.org/wiki/Resident_set_size), + ...
1
21
0
6b7f14a70d31d51b5353292e75f039c4269a42ea
Guillaume Gomez
2023-11-01T19:44:51
Replace `Networks::iter` with `Networks::list` and remove `NetworksIter` type
diff --git a/src/common.rs b/src/common.rs index bddadb4..9c7e323 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1562,7 +1562,7 @@ pub struct Networks { impl<'a> IntoIterator for &'a Networks { type Item = (&'a String, &'a NetworkData); - type IntoIter = NetworksIter<'a>; + type IntoIter = std::collec...
7
28
54
5e389005fdaa43bac71a5baabab6655af31b4575
Guillaume Gomez
2023-11-01T16:59:22
Add reference to `new_with_refreshed_list` in `new` documentation
diff --git a/src/common.rs b/src/common.rs index 74a5a9e..bddadb4 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1576,7 +1576,9 @@ impl Default for Networks { } impl Networks { - /// Creates a new [`Networks`][crate::Networks] type. + /// Creates a new empty [`Networks`][crate::Networks] type. + /// + ...
1
10
1