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
7fb72444ab6cfde3e70374167020d5e6afe4b918
eatradish
2025-05-09T13:34:19
feat(cpu): improve reading of cpu brand in multiple architectures In some architectures (like loongarch64), the key in `/proc/cpuinfo` is recorded in uppercase. (like: "model name" -> "Model Name" in loongarch64
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index 4fad756..eb8a4e3 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -828,7 +828,7 @@ pub(crate) fn get_vendor_id_and_brand() -> HashMap<usize, (String, String)> { while let Some(line) = lines.next() { if line.s...
1
1
1
a820993d5f28112482990c81d89590f7f7882fcc
Guillaume Gomez
2025-05-01T19:59:59
Update crate version to `0.35.0`
diff --git a/Cargo.toml b/Cargo.toml index f9a68f2..6f66d02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.34.2" +version = "0.35.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
24de2602179f07d5f0cb8eb53f6cbbf7ec3edd22
Guillaume Gomez
2025-05-01T16:16:10
Add test for `Groups`
diff --git a/tests/users.rs b/tests/users.rs index 78f09b0..0627b75 100644 --- a/tests/users.rs +++ b/tests/users.rs @@ -14,14 +14,29 @@ fn test_users() { use sysinfo::Users; - if sysinfo::IS_SUPPORTED_SYSTEM { - let mut users = Users::new(); - assert_eq!(users.iter().count(), 0); - user...
1
24
9
b1cf4e74fa3a6b5319a7542feb5a6eb422ddbc21
Chris Denton
2025-05-01T10:21:12
Windows: Get local groups
diff --git a/src/windows/groups.rs b/src/windows/groups.rs index 2265b23..186a112 100644 --- a/src/windows/groups.rs +++ b/src/windows/groups.rs @@ -6,7 +6,7 @@ use crate::{Gid, Group, GroupInner}; use std::ptr::null_mut; use windows::Win32::Foundation::{ERROR_MORE_DATA, ERROR_SUCCESS}; use windows::Win32::NetworkMa...
1
15
19
3ccc45bc7a9ff04b95a91c558614e4b2b83304ec
Guillaume Gomez
2025-04-30T20:30:55
Improve group retrieval code in Windows
diff --git a/src/windows/groups.rs b/src/windows/groups.rs index d82efe1..2265b23 100644 --- a/src/windows/groups.rs +++ b/src/windows/groups.rs @@ -1,15 +1,12 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::sys::utils::to_utf8_str; -use crate::windows::sid::Sid; use c...
1
34
67
bc3bd6d6ee312581d44affd271a30c27eba961ba
Guillaume Gomez
2025-04-30T19:31:58
Improve source code for `signals` command
diff --git a/examples/simple.rs b/examples/simple.rs index 5fb7d13..10426be 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -6,7 +6,7 @@ use std::io::{self, BufRead, Write}; use std::str::FromStr; -use sysinfo::{Components, Disks, Groups, Networks, Pid, Signal, System, Users}; +use sysinfo::{Components,...
1
42
63
f5c8c69e30100692244513fe5bf4a3ff0534789b
Guillaume Gomez
2025-04-30T19:25:58
Replace `writeln!` with `println!`
diff --git a/examples/simple.rs b/examples/simple.rs index 1468d61..5fb7d13 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -8,41 +8,9 @@ use std::io::{self, BufRead, Write}; use std::str::FromStr; use sysinfo::{Components, Disks, Groups, Networks, Pid, Signal, System, Users}; -const signals: &[Signal] ...
1
69
134
74f367adb0ed5e5170c15e0b52eb66ac17603270
Guillaume Gomez
2025-04-30T19:16:52
Add new `groups` command in example
diff --git a/examples/simple.rs b/examples/simple.rs index 951428f..1468d61 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -6,7 +6,7 @@ use std::io::{self, BufRead, Write}; use std::str::FromStr; -use sysinfo::{Components, Disks, Networks, Pid, Signal, System, Users}; +use sysinfo::{Components, Disks, ...
1
6
1
2114f8f9edbbb8fdbb124b44e4085ebc2ea9157f
Guillaume Gomez
2025-04-30T19:15:10
Improve help menu for example
diff --git a/examples/simple.rs b/examples/simple.rs index 1195d58..951428f 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -42,109 +42,55 @@ const signals: &[Signal] = &[ ]; fn print_help() { - writeln!(&mut io::stdout(), "== Help menu =="); - writeln!(&mut io::stdout(), "help : sho...
1
48
102
9ddaa42e088f3b1754bf1a4f14806edb8910ea52
Guillaume Gomez
2025-04-29T12:37:08
Improve `Process::wait` code on Windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index 5f737c6..12fa259 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -31,6 +31,7 @@ use windows::Wdk::System::Threading::{ use windows::Win32::Foundation::{ LocalFree, ERROR_INSUFFICIENT_BUFFER, FILETIME, HANDLE, HLOCAL, HMODULE, M...
1
9
18
8440aaade3a95554b8d46786f83277ab388debb4
Guillaume Gomez
2025-04-28T14:09:44
Add new `Process::kill_and_wait` and `Process::kill_with_and_wait` methods
diff --git a/src/common/system.rs b/src/common/system.rs index 1a54ec5..ce5240b 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1201,6 +1201,16 @@ pub enum ThreadKind { Userland, } +/// Enum describing possible [`Process::kill_and_wait`] errors. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[...
2
72
5
553c7adc1d4f904907a211a4fe7268da1408d210
Guillaume Gomez
2025-04-28T13:49:33
Mention that CPU information might not be available on Android
diff --git a/src/common/system.rs b/src/common/system.rs index 886018b..1a54ec5 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -13,6 +13,9 @@ use crate::{CpuInner, Gid, ProcessInner, SystemInner, Uid}; /// Structs containing system's information such as processes, memory and CPU. /// +/// ⚠️ On new...
1
3
0
32f732ddacea852ff7f887b799b9a1f90475fb24
Guillaume Gomez
2025-04-27T23:39:02
Strenghten `test_tasks` test
diff --git a/tests/process.rs b/tests/process.rs index 4769934..a5074c8 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1106,6 +1106,7 @@ fn test_tasks() { let mut system = System::new_with_specifics(RefreshKind::nothing()); system.refresh_processes_specifics(ProcessesToUpdate::All, true, ProcessRefr...
1
4
1
f0569bd6f16547e295d3e07b7941782055147fd1
Guillaume Gomez
2025-04-27T23:22:47
Fix flakyness for `test_tasks`
diff --git a/tests/process.rs b/tests/process.rs index 83255eb..4769934 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1089,10 +1089,13 @@ fn test_exists() { fn test_tasks() { use std::collections::HashSet; - fn get_tasks(system: &System) -> HashSet<Pid> { - let pid_to_process = system.proce...
1
8
4
7327fd5f64d0100fcf8a197c506320a0a5521efa
Guillaume Gomez
2025-04-27T23:02:40
Unignore `test_consecutive_cpu_usage_update` test
diff --git a/tests/system.rs b/tests/system.rs index d8c7b38..59716de 100644 --- a/tests/system.rs +++ b/tests/system.rs @@ -127,7 +127,6 @@ fn check_boot_time() { // This test is used to ensure that the CPU usage computation isn't completely going off // when refreshing it too frequently (ie, multiple times in a row...
1
0
1
1fd6c4b6cfd36e3812ae14aeb9a6538d2eedfab5
Guillaume Gomez
2025-04-27T22:57:32
Fix new clippy lint
diff --git a/src/lib.rs b/src/lib.rs index c3fd5e8..b2cc3a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -334,11 +334,7 @@ mod test { // to find that user ID in the global user list for process in s.processes().values() { if let Some(uid) = process.user_id() { - ...
4
7
22
a818c36a1476d25c05c5b52274fb666bb0577147
Guillaume Gomez
2025-04-27T22:38:53
Check more thermal zones on linux (raspberry pi)
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index 22560fb..7af34c3 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -379,6 +379,25 @@ impl ComponentInner { } } +fn read_temp_dir<F: FnMut(PathBuf)>(path: &str, starts_with: &str, mut f: F) { + if let Ok(d...
1
37
26
f81020491797a2eea0294067992f669b90eb260a
Mads Marquart
2025-04-19T23:44:59
Move Val_t to macos::ffi
diff --git a/src/unix/apple/ffi.rs b/src/unix/apple/ffi.rs index 3993ebf..918d8d0 100644 --- a/src/unix/apple/ffi.rs +++ b/src/unix/apple/ffi.rs @@ -1,33 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. -// Reexport items defined in either macos or ios ffi module. -#[cfg(all( -...
4
12
28
7e3a640fbde8350bad9fe888c532d55028512ceb
Mads Marquart
2025-04-19T23:46:06
Use objc2-io-kit
diff --git a/Cargo.toml b/Cargo.toml index 17649c7..f9a68f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,8 @@ component = [ "objc2-core-foundation/CFDictionary", "objc2-core-foundation/CFNumber", "objc2-core-foundation/CFString", + "objc2-io-kit", + "objc2-io-kit/hidsystem", ] disk = [ ...
7
132
322
81e707b9fe0b3bd648653e6e2038dcc8fd1c27c4
Mads Marquart
2025-04-19T23:07:19
Use objc2-core-foundation methods instead of functions The functions are deprecated.
diff --git a/Cargo.toml b/Cargo.toml index f1edf57..17649c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,7 +124,7 @@ windows = { version = ">=0.59, <=0.61", optional = true } libc = "^0.2.171" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] -objc2-core-foundation = { version = "0.3.0", ...
5
14
22
5000c29c3cfb42c44ae84002c26ec38462eb4222
Oscar Gustafsson
2025-04-17T08:38:42
Bump windows to 0.59
diff --git a/Cargo.toml b/Cargo.toml index 764689b..f1edf57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ component = [ "windows/Win32_Foundation", "windows/Win32_Security", "windows/Win32_System_Com", + "windows/Win32_System_Ole", "windows/Win32_System_Rpc", "windows/Win32_Syst...
8
54
55
36ff8f5d05df886ce7e0f0feb1a3e5e410c9125f
Guillaume Gomez
2025-04-14T23:06:30
Correctly handle when new CPUs are added on linux
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index 387da08..4fad756 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -73,7 +73,7 @@ impl CpusWrapper { if first || refresh_kind.cpu_usage() { if let Some(Ok(line)) = it.next() { - if &line[....
1
23
14
c5673b8a98aad4ebc2c1fa0920620b565ed25d9d
Yuanhai He
2025-04-11T09:28:16
Linux: ignore autofs disks
diff --git a/src/unix/linux/disk.rs b/src/unix/linux/disk.rs index f7379ef..dc0aa1f 100644 --- a/src/unix/linux/disk.rs +++ b/src/unix/linux/disk.rs @@ -393,8 +393,8 @@ fn get_all_list(container: &mut Vec<Disk>, content: &str, refresh_kind: DiskRefr "mqueue" // https://man7.org/linux/man-pages/man7/mq_...
1
2
2
8e3f6f3e7bf556ee357e0503b66d56989eb604ef
Guillaume Gomez
2025-04-09T21:09:07
Improve `Process::open_files` on FreeBSD
diff --git a/src/common/system.rs b/src/common/system.rs index b7b7737..886018b 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1803,8 +1803,7 @@ impl Process { /// Returns `None` if it failed retrieving the information or if the current system is not /// supported. /// - /// **Import...
5
86
119
457aa02e71828130efcdb1b324a175f86493b891
Guillaume Gomez
2025-04-04T15:17:53
Enforce `Disks` implement `Send`
diff --git a/src/common/disk.rs b/src/common/disk.rs index 833c25d..729fe6c 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -453,3 +453,26 @@ impl DiskRefreshKind { impl_get_set!(DiskRefreshKind, storage, with_storage, without_storage); impl_get_set!(DiskRefreshKind, io_usage, with_io_usage, witho...
2
28
0
0adb410918f72fec1fa76bba5fcef9b22f4f0796
Vinay Chandra Dommeti
2025-04-03T23:24:10
Create an owned handle for snapshot
diff --git a/src/windows/system.rs b/src/windows/system.rs index dd805e3..5a0cd3d 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -13,7 +13,7 @@ use std::mem::{size_of, zeroed}; use std::os::windows::ffi::OsStrExt; use std::time::{Duration, SystemTime}; -use windows::core::{PCWSTR, PWSTR}; +use wi...
1
6
3
8b59cf76dfdc8d0cc371f87b3afbbf2ccd3c2a51
Guillaume Gomez
2025-04-02T19:57:44
Implement System::open_files_limit Make `open_files*` methods return a `usize` instead of a `u32` Transform `set_open_files_limit` function argument from `isize` into `usize`
diff --git a/src/common/system.rs b/src/common/system.rs index cea5a3b..b7b7737 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -895,6 +895,22 @@ impl System { pub fn physical_core_count() -> Option<usize> { SystemInner::physical_core_count() } + + /// Returns the (default) maximum...
12
124
71
a980e1316d27bfed83c2666f0d5277a9445e284c
Raphael Hetzel
2025-04-02T12:30:41
Fix M4 frequency calculation
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index f078fd7..77774af 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -42,7 +42,7 @@ impl CpusWrapper { return; } if refresh_kind.frequency() && !self.got_cpu_frequency { - let frequency = unsafe { ge...
2
14
7
b249d774a7d986f01d0053b8349bd0aa29d9e432
Guillaume Gomez
2025-04-01T21:03:35
Fix segfault on FreeBSD
diff --git a/examples/simple.rs b/examples/simple.rs index 7b5bf3a..1195d58 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -275,7 +275,7 @@ fn interpret_input( writeln!(&mut io::stdout(), "fifteen minutes: {}%", load_avg.fifteen); } e if e.starts_with("show ") => { - ...
3
61
6
ce087401b234d81ff65918a146475cae1f8ce476
Guillaume Gomez
2025-03-28T14:10:29
Update crate version to `0.34.1`
diff --git a/Cargo.toml b/Cargo.toml index d10f228..7197c3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.34.0" +version = "0.34.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
14ff47f66ef146630fe79757be0e628ea0d48201
Daniel Hofstetter
2025-03-28T13:52:27
Remove debug output on macOS
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index b17d600..879dc48 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -370,7 +370,6 @@ unsafe fn create_new_process( get_cwd_root(&mut p, refresh_kind); return Ok(Some(...
1
0
1
5a11354562fb5744b6440585fd4185c18dd0bf57
Guillaume Gomez
2025-03-27T21:21:03
Update crate version to `0.34.0`
diff --git a/Cargo.toml b/Cargo.toml index 6476f6f..d10f228 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.33.1" +version = "0.34.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
cbac7262ca88f032257e05ad104a6b01265a33ba
Guillaume Gomez
2025-03-26T22:01:06
Add regression test for #1489
diff --git a/tests/process.rs b/tests/process.rs index c171de2..f38ca8b 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -344,6 +344,10 @@ fn test_refresh_processes() { let mut s = System::new(); s.refresh_processes(ProcessesToUpdate::All, false); assert!(s.process(pid).is_some()); + // We will...
1
23
0
62eb2b873e7284ff9c853bead808c8d8c6d3b52c
Guillaume Gomez
2025-03-26T22:00:46
Fix macOS issue where a removed process was still listed
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index bf4fe2d..b17d600 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -366,10 +366,11 @@ unsafe fn create_new_process( Some(info) => info, None => { let mut p = ProcessInn...
2
28
10
cec8f123de699bec9816209e99bb677a566fb94b
Guillaume Gomez
2025-03-26T20:53:22
Fix new clippy lints
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index 7335fb9..387da08 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -160,7 +160,7 @@ impl CpusWrapper { } #[cfg(not(feature = "multithread"))] - fn iter_mut<'a>(val: &'a mut Vec<Cpu>) -> std::slice::It...
2
2
3
a8247a4d014c6ad51af78625de15b634a4a13423
Guillaume Gomez
2025-03-26T20:48:04
Disable `multithread` feature by default
diff --git a/Cargo.toml b/Cargo.toml index a48533c..6476f6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" name = "sysinfo" [features] -default = ["component", "disk", "network", "system", "user", "multithread"] +default = ["component", "disk", "network", "system", "user"] component = ...
1
1
1
15b3be3273ba286740122fed7bb7dccd2a79dc8f
Riccardo Busetti
2025-03-25T12:33:42
Fallback to u64::MAX when memory.max is not a number (#1488) Fallback to u64::MAX when memory.max is not a number
diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs index b8a8cf6..02ceea0 100644 --- a/src/unix/linux/system.rs +++ b/src/unix/linux/system.rs @@ -558,9 +558,15 @@ impl SystemInner { } fn read_u64(filename: &str) -> Option<u64> { - get_all_utf8_data(filename, 16_635) + let result = get_all_utf8_...
1
10
3
8991fdab2d107a6d7c3531de8af6bda5c9fa42fa
Guillaume Gomez
2025-03-23T23:28:53
Update libc version to 0.2.171
diff --git a/Cargo.toml b/Cargo.toml index 27375aa..a48533c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,7 +120,7 @@ ntapi = { version = "0.4", optional = true } windows = { version = ">=0.54, <=0.57", optional = true } [target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies] -libc =...
1
1
1
08bccfd6884433d4b56a9a5346f14580129816fc
Guillaume Gomez
2025-03-23T23:28:10
More apple FFI cleanup
diff --git a/src/unix/apple/ffi.rs b/src/unix/apple/ffi.rs index eedaf25..3993ebf 100644 --- a/src/unix/apple/ffi.rs +++ b/src/unix/apple/ffi.rs @@ -13,26 +13,11 @@ ))] pub use crate::sys::inner::ffi::*; -cfg_if! { - if #[cfg(feature = "disk")] { - use std::ffi::c_void; - - #[link(name = "objc", ki...
2
7
25
8e58e02842f8e99c7291ebaa81a3d6aca7eaba58
Guillaume Gomez
2025-03-23T23:03:46
Simplify macos `ffi.rs` file
diff --git a/src/unix/apple/macos/ffi.rs b/src/unix/apple/macos/ffi.rs index 597072d..791f525 100644 --- a/src/unix/apple/macos/ffi.rs +++ b/src/unix/apple/macos/ffi.rs @@ -1,132 +1,50 @@ // Take a look at the license at the top of the repository in the LICENSE file. -#[cfg(any( - feature = "disk", - all( - ...
1
64
163
8f74ea9ea86f4bd14d9871038ecbc3cb43b3db05
Guillaume Gomez
2025-03-22T17:33:49
Fix new clippy lint
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 6f587a4..f078fd7 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -262,7 +262,7 @@ pub(crate) fn compute_usage_of_cpu(proc_: &Cpu, cpu_info: *mut i32, offset: isiz let idle; // In case we are initializing cpus, there is no "ol...
1
1
1
a4a32afc8292bc827807648bc07d9a816823876c
Guillaume Gomez
2025-03-22T17:21:32
Strenghten disk list refresh on mac
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index 1fbf17a..58ad6e5 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -7,9 +7,9 @@ use objc2_core_foundation::{ kCFAllocatorDefault, kCFTypeArrayCallBacks, kCFURLVolumeAvailableCapacityForImportantUsageKey, kCFURLVolumeAvailable...
1
14
10
89b3cb9f3aa9650dc2bcf07df561c9376f59bbe2
Franck Parat
2025-03-20T16:59:30
FreeBSD: improve `refresh_procs` for the single process case
diff --git a/src/unix/freebsd/system.rs b/src/unix/freebsd/system.rs index d4ffaab..57cc093 100644 --- a/src/unix/freebsd/system.rs +++ b/src/unix/freebsd/system.rs @@ -287,13 +287,14 @@ impl SystemInner { processes_to_update: ProcessesToUpdate<'_>, refresh_kind: ProcessRefreshKind, ) -> usize { ...
1
7
6
c6a76f60477ebd29cb593b0c152be24c0f16c425
Guillaume Gomez
2025-03-19T17:04:39
Add unit test for open_files API
diff --git a/tests/process.rs b/tests/process.rs index 28da513..c171de2 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1103,3 +1103,22 @@ fn test_tasks() { }); scheduler.join().expect("Scheduler panicked"); } + +#[test] +fn open_files() { + if !sysinfo::IS_SUPPORTED_SYSTEM || cfg!(feature = "app...
1
19
0
61c5f583619f5eee01f65a02476afe204fdea34e
Guillaume Gomez
2025-03-19T16:53:53
Add `open_files` API for FreeBSD
diff --git a/src/common/system.rs b/src/common/system.rs index e5a4f11..2e9fd66 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1780,7 +1780,8 @@ impl Process { /// Returns `None` if it failed retrieving the information or if the current system is not /// supported. /// - /// **Import...
4
82
5
2dd7b452112ffb595e01379ecde3616803946c8e
Guillaume Gomez
2025-03-19T16:30:25
Remove FreeBSD FFI types defined in libc
diff --git a/src/unix/freebsd/disk.rs b/src/unix/freebsd/disk.rs index 1100dca..40f1100 100644 --- a/src/unix/freebsd/disk.rs +++ b/src/unix/freebsd/disk.rs @@ -8,12 +8,11 @@ use std::path::{Path, PathBuf}; use std::ptr::{null_mut, NonNull}; use std::sync::OnceLock; -use libc::c_void; +use libc::{c_void, devstat, d...
2
5
52
8488322974d0756f813d1e44abe1c0f534646440
Guillaume Gomez
2025-03-11T20:28:24
Add `open_files` API for unsupported targets
diff --git a/src/unknown/process.rs b/src/unknown/process.rs index ce122fd..1abcf6a 100644 --- a/src/unknown/process.rs +++ b/src/unknown/process.rs @@ -120,4 +120,12 @@ impl ProcessInner { pub(crate) fn exists(&self) -> bool { false } + + pub(crate) fn open_files(&self) -> Option<u32> { + ...
1
8
0
8e842aa9e55842b63d84d20ddf71b406d225ba8f
Guillaume Gomez
2025-03-11T17:52:51
Add `Process::open_files` and `Process::open_files_limit` on windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index cb2d740..0161031 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -44,9 +44,10 @@ use windows::Win32::System::ProcessStatus::{ use windows::Win32::System::RemoteDesktop::ProcessIdToSessionId; use windows::Win32::System::SystemInform...
1
35
3
80e151c61dadffb757d9227b9a779b9a6b2d81e5
Guillaume Gomez
2025-03-09T23:55:31
Implement `open_files` API on mac
diff --git a/src/unix/apple/ffi.rs b/src/unix/apple/ffi.rs index 07fd03b..eedaf25 100644 --- a/src/unix/apple/ffi.rs +++ b/src/unix/apple/ffi.rs @@ -23,6 +23,16 @@ cfg_if! { pub fn objc_autoreleasePoolPush() -> *mut c_void; } } + if #[cfg(feature = "system")] { + // FIXME: to be rem...
2
46
0
59187868a7e775899964d0af6969ac030bb1692f
Guillaume Gomez
2025-03-09T23:54:49
Add example for using `open_files` API
diff --git a/examples/simple.rs b/examples/simple.rs index ff2c7d9..b94fb6a 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -284,9 +284,19 @@ fn interpret_input( writeln!(&mut io::stdout(), "example: show 1254"); } else if let Ok(pid) = Pid::from_str(tmp[1]) { ...
1
13
3
5c3be71e36eb5dd4b1cf08f3342e78083680fcf3
Guillaume Gomez
2025-03-08T22:33:01
Add `Process::open_files` and `Process::open_files_limit` on linux
diff --git a/src/common/system.rs b/src/common/system.rs index 2a74f18..e5a4f11 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1774,6 +1774,54 @@ impl Process { pub fn exists(&self) -> bool { self.inner.exists() } + + /// Returns the number of open files in the current process. +...
3
90
1
8fde4d46aa0fb7ffcdad76d73233f6bc038ef7b0
Guillaume Gomez
2025-03-10T10:37:25
Add `kernel_long_version` output in simple example
diff --git a/examples/simple.rs b/examples/simple.rs index ff2c7d9..2beaf7c 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -143,6 +143,7 @@ fn print_help() { &mut io::stdout(), "pid : Display this example's PID" ); + writeln!(&mut io::stdout(), "quit ...
2
13
12
c1bff6a70de8802820a281263e48a05328c7e53a
Guillaume Gomez
2025-03-09T22:41:46
Fix `System::kernel_long_version`
diff --git a/src/common/system.rs b/src/common/system.rs index 2a74f18..f88ba58 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -792,34 +792,6 @@ impl System { SystemInner::distribution_id() } - /// Provides kernel version following this string format: - /// - /// "<code>[distri...
6
70
32
fc741b4cb2dbeb4030380ea76480332a1f06b0fc
Guillaume Gomez
2025-03-08T21:51:17
Add `System::kernel_long_version`
diff --git a/src/common/system.rs b/src/common/system.rs index a178889..2a74f18 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -792,6 +792,34 @@ impl System { SystemInner::distribution_id() } + /// Provides kernel version following this string format: + /// + /// "<code>[distri...
1
28
0
343eb1304bb664db44a05880149ee096aa067845
Guillaume Gomez
2025-03-08T20:56:31
Fix groups docs
diff --git a/src/common/user.rs b/src/common/user.rs index 4c54a0f..ae1d972 100644 --- a/src/common/user.rs +++ b/src/common/user.rs @@ -432,7 +432,7 @@ impl Groups { Self { groups: Vec::new() } } - /// Creates a new [`Groups`][crate::Groups] type with the user list loaded. + /// Creates a new [`G...
1
2
2
dbcb3f72076e04af67a9587724ee31ccc89e46f8
Fabien Savy
2025-03-07T10:28:33
Fix macos dead code
diff --git a/src/unix/apple/ffi.rs b/src/unix/apple/ffi.rs index d30e564..07fd03b 100644 --- a/src/unix/apple/ffi.rs +++ b/src/unix/apple/ffi.rs @@ -3,7 +3,13 @@ // Reexport items defined in either macos or ios ffi module. #[cfg(all( not(target_os = "ios"), - any(feature = "component", feature = "disk", featu...
3
106
34
a69bf23e943078ad76b893367145d73e5d4ec8e9
Steven Xu
2025-03-05T11:28:12
test: make tasks test reproducible
diff --git a/tests/process.rs b/tests/process.rs index c18e498..6ca5d87 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -1021,35 +1021,25 @@ fn test_tasks() { task_pids } - let scheduler = std::thread::spawn(|| { - let mut system = System::new_with_specifics(RefreshKind::nothing()); - ...
1
19
29
a194b13c7c83bdc22069cdc22d38deddad0abb40
Guillaume Gomez
2025-03-05T10:36:11
Pass `tasks` as arguments instead of re-getting the HashMap process
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index ced241a..a824c60 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -508,6 +508,7 @@ fn update_existing_process( uptime: u64, info: &SystemInfo, refresh_kind: ProcessRefreshKind, + tasks: Option<HashSet<Pid...
1
9
7
d405b62617691326d98470a4b96d4cd548faad27
Guillaume Gomez
2025-03-04T23:06:24
Add regression test for tasks update
diff --git a/tests/process.rs b/tests/process.rs index 8af922b..c18e498 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -116,7 +116,7 @@ fn test_environ() { s.refresh_processes_specifics( ProcessesToUpdate::Some(&[pid]), false, - sysinfo::ProcessRefreshKind::everything(), + ...
1
53
6
c0d5827c3ec7c1ea08fe1b1deef806fa1c54cccd
Guillaume Gomez
2025-03-04T22:54:03
Fix tasks update for linux processes
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 73f2bd9..ced241a 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -508,7 +508,7 @@ fn update_existing_process( uptime: u64, info: &SystemInfo, refresh_kind: ProcessRefreshKind, -) -> Result<(Option<Process>,...
1
14
11
3992e4d9fef5fa120d8421a1974ffaf032f65932
Guillaume Gomez
2025-03-04T21:29:32
Fix clippy warnings
diff --git a/src/windows/process.rs b/src/windows/process.rs index 83e328e..cb2d740 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -963,7 +963,7 @@ fn get_proc_env<T: RtlUserProcessParameters>( let mut begin = 0; while let Some(offset) = raw_env[begin..].iter().position(|&...
1
1
1
44b4f4245ade755318c908c9db52083c826abdfc
Guillaume Gomez
2025-03-04T21:17:38
Improve linux code to update processes
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index a3e83e2..73f2bd9 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -502,86 +502,87 @@ fn retrieve_all_new_process_info( Process { inner: p } } -pub(crate) fn _get_process_data( - path: &Path, - proc_list: &mut...
1
67
64
863155d301e0d662d50829dfb2102a54f86dbe0a
Guillaume Gomez
2025-02-05T23:48:30
Add `Process::exists` method
diff --git a/src/common/system.rs b/src/common/system.rs index 2353a6c..8f098cb 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -351,7 +351,9 @@ impl System { } fn update(pid: &Pid, processes: &mut HashMap<Pid, Process>) { if let Some(proc) = processes.get_mut(pid) { - ...
8
108
1
1a34894db81a7b5267c7ec152fb309e67cfc128b
Guillaume Gomez
2025-02-05T22:12:02
Correctly split proc files
diff --git a/src/unix/linux/process.rs b/src/unix/linux/process.rs index 310802b..cb62c22 100644 --- a/src/unix/linux/process.rs +++ b/src/unix/linux/process.rs @@ -827,6 +827,24 @@ fn trim_ascii(mut bytes: &[u8]) -> &[u8] { bytes } +fn split_content(mut data: &[u8]) -> Vec<OsString> { + let mut out = Vec::w...
1
40
10
520bff3b2a4fdf2e2f255dc457fadf26e2e71ebb
sigsegved
2025-01-31T23:25:35
Introduce ProcessRefreshKind::Thread (#1436) Introduce ProcessRefreshKind::tasks Co-authored-by: Karthik Uthaman <kuthaman@microsoft.com> Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
diff --git a/src/common/system.rs b/src/common/system.rs index abb02ac..0c71f7a 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -263,7 +263,7 @@ impl System { self.inner.refresh_cpu_specifics(refresh_kind) } - /// Gets all processes and updates their information. + /// Gets all pro...
3
160
56
191e6dbfc8885147e2f847260383c52af5fee52d
Guillaume Gomez
2025-01-30T21:53:32
Fix disk confusion when only matching on mount point
diff --git a/src/unix/apple/disk.rs b/src/unix/apple/disk.rs index c5b24b4..d598eb0 100644 --- a/src/unix/apple/disk.rs +++ b/src/unix/apple/disk.rs @@ -322,6 +322,8 @@ unsafe fn get_list(container: &mut Vec<Disk>, refresh_kind: DiskRefreshKind) { let disk = container .iter_mut() + //...
4
20
6
7107b395265f2c32538174a687188f393c4a1ca2
Guillaume Gomez
2025-01-30T21:36:49
Fix linux missing disk entries when some information are not available
diff --git a/src/unix/linux/disk.rs b/src/unix/linux/disk.rs index babbd08..72084e6 100644 --- a/src/unix/linux/disk.rs +++ b/src/unix/linux/disk.rs @@ -465,9 +465,9 @@ impl DiskStat { // 3rd field let name = iter.nth(2).map(ToString::to_string)?; // 6th field - let sectors_read = iter...
1
30
2
0370948a2e27d11685eb13d4684365c234f1430f
Mads Marquart
2025-01-27T14:44:23
Fix various compilation errors
diff --git a/src/lib.rs b/src/lib.rs index b2a455d..76125aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -320,7 +320,7 @@ mod test { } } - #[cfg(feature = "system")] + #[cfg(all(feature = "system", feature = "user"))] #[test] fn check_all_process_uids_resolvable() { // On linux, ...
2
2
2
3bf373b2dc687bd3bd4437bc521ff9236d2faa06
Mads Marquart
2025-01-26T23:14:40
Use objc2-core-foundation
diff --git a/Cargo.toml b/Cargo.toml index de0e81a..27375aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,11 @@ component = [ "windows/Win32_System_Rpc", "windows/Win32_System_Variant", "windows/Win32_System_Wmi", + "objc2-core-foundation/CFArray", + "objc2-core-foundation/CFBase", + "ob...
9
252
451
d46fe075a9ceea34c7540c439b361c8026fe3555
Lisa White
2025-01-25T22:53:18
Add System::distribution_id_like() This is similar to System::distribution_id() but for ID_LIKE. See <https://www.freedesktop.org/software/systemd/man/latest/os-release.html#ID_LIKE=>.
diff --git a/src/common/system.rs b/src/common/system.rs index 2353a6c..abb02ac 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -784,6 +784,33 @@ impl System { SystemInner::distribution_id() } + /// Returns the distribution ids of operating systems that are closely + /// related to...
6
124
0
c25010a499938585649de8cbe5c8b4d26ff0ef42
Guillaume Gomez
2025-01-21T14:41:39
Ignore freebsd in `accumulated_cpu_time` test
diff --git a/tests/process.rs b/tests/process.rs index c499220..e2e8d61 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -946,7 +946,10 @@ fn accumulated_cpu_time() { atomic.store(true, Ordering::Relaxed); } - if !sysinfo::IS_SUPPORTED_SYSTEM || cfg!(feature = "apple-sandbox") { + if !sysin...
1
4
1
603d1f9f6333e8e8cbacc68793bbcfde035f3378
Guillaume Gomez
2025-01-20T20:48:39
Add Process::accumulated_cpu_time feature Co-authored-by: Bruce Guenter <bruce.guenter@datadoghq.com>
diff --git a/src/common/system.rs b/src/common/system.rs index 2836605..2353a6c 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1480,6 +1480,22 @@ impl Process { self.inner.cpu_usage() } + /// Returns the total accumulated CPU usage (in CPU-milliseconds). Note + /// that it might ...
12
173
13
6749d8af0bae276c1d507c6cff552ec95085689a
Ethan
2025-01-17T23:54:24
Replace `NtQuerySystemInformation` with `CreateToolhelp32Snapshot`, `Process32FirstW` and `Process32NextW` (#1451)
diff --git a/Cargo.toml b/Cargo.toml index 0ca8da4..de0e81a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ disk = [ ] system = [ "windows/Win32_Foundation", + "windows/Win32_System_Diagnostics_ToolHelp", "windows/Wdk_System_SystemInformation", "windows/Wdk_System_SystemServices", "w...
3
111
164
ad02d027352829c721198fc234505f390de24ded
Guillaume Gomez
2025-01-16T17:02:51
Implement `Deserialize` on `DiskKind`, `MacAddr`, `IpNetwork`, `Signal`, `ProcessStatus` and `ThreadKind`
diff --git a/Cargo.toml b/Cargo.toml index c094292..0ca8da4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ rustdoc-args = ["--generate-link-to-definition"] [dependencies] memchr = { version = "2.5", optional = true } rayon = { version = "^1.8", optional = true } -serde = { version = "^1.0.190", optional ...
4
7
1
4804c149a516884f0693a5c7ec9f68fdaf43546c
Guillaume Gomez
2025-01-16T15:12:36
Implement `FromStr` for `IpNetwork` and `MacAddr`
diff --git a/src/common/network.rs b/src/common/network.rs index cf3930b..9d62196 100644 --- a/src/common/network.rs +++ b/src/common/network.rs @@ -2,7 +2,9 @@ use std::collections::HashMap; use std::fmt; -use std::net::IpAddr; +use std::net::{AddrParseError, IpAddr}; +use std::num::ParseIntError; +use std::str::F...
2
141
5
73cc3154df3f5d50e078805e520796bd873d2751
Guillaume Gomez
2025-01-15T21:47:40
Implement `Hash` trait on `DiskKind`, `MacAddr`, `Signal` and on `ProcessStatus`
diff --git a/src/common/disk.rs b/src/common/disk.rs index 83996da..fee3dba 100644 --- a/src/common/disk.rs +++ b/src/common/disk.rs @@ -371,7 +371,7 @@ impl std::ops::DerefMut for Disks { /// println!("{:?}: {:?}", disk.name(), disk.kind()); /// } /// ``` -#[derive(Debug, PartialEq, Eq, Clone, Copy)] +#[derive(...
3
4
4
ffe3d20c494984ddecbd869809e605756d8a531b
Guillaume Gomez
2025-01-13T14:30:51
Fix new clippy lints
diff --git a/src/unix/linux/cpu.rs b/src/unix/linux/cpu.rs index c97e84e..7335fb9 100644 --- a/src/unix/linux/cpu.rs +++ b/src/unix/linux/cpu.rs @@ -433,7 +433,7 @@ pub(crate) fn get_cpu_frequency(cpu_core_index: usize) -> u64 { || line.starts_with("bogomips per cpu") }); find_cpu_mhz - .a...
1
3
3
be49f99c70603b0551c915602aeacd0601492396
Ethan
2025-01-10T12:25:38
Improve Windows CPU usage efficiency (#1448)
diff --git a/src/windows/process.rs b/src/windows/process.rs index cc084f3..64efabe 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -17,6 +17,7 @@ use std::process::{self, ExitStatus}; use std::ptr::null_mut; use std::str; use std::sync::{Arc, OnceLock}; +use std::time::Instant; use libc::c_vo...
1
15
2
7f3178346c42ccdc3719db7a4ce465d73c6e4d38
Guillaume Gomez
2024-12-27T12:43:53
Fix clippy lint
diff --git a/src/windows/process.rs b/src/windows/process.rs index 85f3755..cc084f3 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -1020,5 +1020,5 @@ pub(crate) fn update_disk_usage(p: &mut ProcessInner) { #[inline(always)] const fn filetime_to_u64(ft: FILETIME) -> u64 { - (ft.dwHighDateTime...
1
1
1
d463e4fd7cf04f738b88cb065667767361075e34
Guillaume Gomez
2024-12-27T12:37:17
Update crate version to 0.33.1
diff --git a/Cargo.toml b/Cargo.toml index b28ddfa..c094292 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.33.0" +version = "0.33.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
c88a87873a58ebe26c5b6ae04f0e59fbbf9e80b6
Cong Luan Tran
2024-12-26T17:06:00
Fix wrong logic when checking that the DirEntry is a file
diff --git a/src/unix/linux/component.rs b/src/unix/linux/component.rs index e25e9a3..22560fb 100644 --- a/src/unix/linux/component.rs +++ b/src/unix/linux/component.rs @@ -271,7 +271,7 @@ impl ComponentInner { let dir = read_dir(folder).ok()?; let mut matchings: HashMap<u32, Component> = HashMap::wit...
1
1
1
a6c45f3dd5c359765627f8861e05258a2f088729
Arpan Kapoor
2024-12-19T13:02:05
filter out few virtual filesystems on linux
diff --git a/src/unix/linux/disk.rs b/src/unix/linux/disk.rs index 9d49272..babbd08 100644 --- a/src/unix/linux/disk.rs +++ b/src/unix/linux/disk.rs @@ -387,7 +387,10 @@ fn get_all_list(container: &mut Vec<Disk>, content: &str, refresh_kind: DiskRefr "pstore" | // https://www.kernel.org/doc/Documentati...
1
4
1
775315425641f2872faddc09b4641a3bc87f1bab
Guillaume Gomez
2024-12-20T16:17:13
Remove duplication between `Process::wait` methods on unix targets
diff --git a/src/unix/apple/macos/process.rs b/src/unix/apple/macos/process.rs index 244915d..18f1d6e 100644 --- a/src/unix/apple/macos/process.rs +++ b/src/unix/apple/macos/process.rs @@ -3,7 +3,6 @@ use std::ffi::{OsStr, OsString}; use std::mem::{self, MaybeUninit}; use std::os::unix::ffi::{OsStrExt, OsStringExt};...
5
33
48
ee6ea3d106827c88013196425c235d110f655a01
Guillaume Gomez
2024-12-20T16:01:35
Make `Process::wait` return `Option<ExitStatus>`
diff --git a/src/common/system.rs b/src/common/system.rs index fb73918..e5772bc 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -4,6 +4,7 @@ use std::collections::{HashMap, HashSet}; use std::ffi::{OsStr, OsString}; use std::fmt; use std::path::Path; +use std::process::ExitStatus; use std::str::From...
7
43
16
10e2d8c4b0386b31bd66db02a842b0482dd5fda1
Guillaume Gomez
2024-12-20T15:11:20
Improve documentation for `Process:kill*` and `Process::wait` methods
diff --git a/src/common/system.rs b/src/common/system.rs index 7bcadc9..fb73918 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -1135,7 +1135,8 @@ impl Process { /// Sends [`Signal::Kill`] to the process (which is the only signal supported on all supported /// platforms by this crate). //...
1
22
20
415c69298472c85cf88248ba86a19e2ac853aa20
dionysuz
2024-12-18T10:27:35
Add iPhone 15 (#1429) Fix CPU names for iPhone and iPad
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 8df3798..6f587a4 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -413,24 +413,48 @@ pub(crate) fn get_vendor_id_and_brand() -> (String, String) { } let full_brand = get_sysctl_str(b"hw.machine\0"); // This is a fallback wh...
1
42
18
4babe474ec447fe022c9e7a312929465ca46c2de
Guillaume Gomez
2024-12-17T12:04:04
Make `System::refresh_all` and `System::refresh_specifics` remove dead processes and update docs
diff --git a/src/common/system.rs b/src/common/system.rs index b8b5ae7..67f690e 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -91,6 +91,10 @@ impl System { /// Refreshes according to the given [`RefreshKind`]. It calls the corresponding /// "refresh_" methods. /// + /// It will remov...
1
8
1
f290ea3b5f44f0b54e8b81f79baf341e4b970a5b
Guillaume Gomez
2024-12-15T20:37:32
Add some missing CPU brands for iPhone and iPad
diff --git a/src/unix/apple/cpu.rs b/src/unix/apple/cpu.rs index 419c37e..8df3798 100644 --- a/src/unix/apple/cpu.rs +++ b/src/unix/apple/cpu.rs @@ -407,7 +407,33 @@ pub(crate) fn get_vendor_id_and_brand() -> (String, String) { vendor = "Apple".to_string(); } - (vendor, get_sysctl_str(b"machdep.cpu.b...
1
27
1
d375fc6ea686bc9d3358235f294f6f7d8d980581
David Tolnay
2024-12-14T00:31:22
Prefix distro version with "unknown" if distro name is not known
diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs index c53d1ef..f285606 100644 --- a/src/unix/linux/system.rs +++ b/src/unix/linux/system.rs @@ -391,16 +391,17 @@ impl SystemInner { let distro_name = Self::name(); let distro_version = Self::os_version(); - if let (Some(distro_...
1
5
4
d1e0c221dd2ff0c252daa2117d992e72df4aec54
David Tolnay
2024-12-13T19:27:12
Improve System::long_os_version() on Linux
diff --git a/src/common/system.rs b/src/common/system.rs index dabf4e9..dab1ca3 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -735,7 +735,7 @@ impl System { /// /// | example platform | value of `System::long_os_version()` | /// |---|---| - /// | linux laptop | "Linux 24.04 Ubuntu" |...
2
13
8
8c8874b0aa78cc30dfa5c52737dafe75358fa68f
David Tolnay
2024-12-13T19:25:39
Improve System::long_os_version() on Android
diff --git a/src/common/system.rs b/src/common/system.rs index b8b5ae7..dabf4e9 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -736,7 +736,7 @@ impl System { /// | example platform | value of `System::long_os_version()` | /// |---|---| /// | linux laptop | "Linux 24.04 Ubuntu" | - ///...
2
7
4
ddd4dc0b29b9429b4c6a022ecbdca1e3a83f989e
David Tolnay
2024-12-13T19:21:14
Split Linux's and Android's long_os_version into separate functions
diff --git a/src/unix/linux/system.rs b/src/unix/linux/system.rs index 3f14e48..0243bb3 100644 --- a/src/unix/linux/system.rs +++ b/src/unix/linux/system.rs @@ -385,14 +385,26 @@ impl SystemInner { get_system_info_android(InfoType::Name) } + #[cfg(not(target_os = "android"))] pub(crate) fn long_...
1
17
5
6650d2ef4f22c2e67a8226bca45fff6c5c69c481
David Tolnay
2024-12-09T08:32:47
Identify macOS as OS X or Mac OS X on appropriate version ranges (#1425)
diff --git a/src/common/system.rs b/src/common/system.rs index 7c1907d..4be9a95 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -726,7 +726,7 @@ impl System { SystemInner::kernel_version() } - /// Returns the system version (e.g. for MacOS this will return 15.1 rather than the kernel ...
3
37
35
2de1fa4191b450120093b27cafe8bbbb28ff4cbd
David Tolnay
2024-11-27T03:16:49
Avoid trailing whitespace and consecutive whitespace in OS versions
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index da5e984..536c9f3 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -396,40 +396,49 @@ impl SystemInner { pub(crate) fn long_os_version() -> Option<String> { #[cfg(target_os = "macos")] { - let ...
2
52
36
f18b6667881982e07b64daf9de3f4f6d5a020e7d
David Tolnay
2024-11-27T03:10:32
Rearrange Apple long_os_version to avoid repeating macos cfg
diff --git a/src/unix/apple/system.rs b/src/unix/apple/system.rs index f13fe85..da5e984 100644 --- a/src/unix/apple/system.rs +++ b/src/unix/apple/system.rs @@ -395,42 +395,42 @@ impl SystemInner { pub(crate) fn long_os_version() -> Option<String> { #[cfg(target_os = "macos")] - let friendly_name...
1
34
34
72eddd061855ee7e433cc1a17ff45052780e2add
David Tolnay
2024-12-07T18:20:15
Show example outputs in System documentation
diff --git a/src/common/system.rs b/src/common/system.rs index 61bce36..7c1907d 100644 --- a/src/common/system.rs +++ b/src/common/system.rs @@ -688,6 +688,13 @@ impl System { /// Returns the system name. /// + /// | example platform | value of `System::name()` | + /// |---|---| + /// | linux lapto...
1
39
4
e568f4e41b3ccbd89f156eeb51bc42f424701a55
Evan Huff
2024-12-06T02:00:46
fix: fix HSTRING being dropped, causing NERR_UserNotFound errors
diff --git a/src/windows/users.rs b/src/windows/users.rs index bc25dc8..ef88a83 100644 --- a/src/windows/users.rs +++ b/src/windows/users.rs @@ -4,7 +4,7 @@ use crate::sys::utils::to_utf8_str; use crate::{windows::sid::Sid, Gid, Group, GroupInner, Uid, User}; use std::ptr::null_mut; -use windows::core::{w, PCWSTR};...
2
17
15
6d5bf57f338afcaca97e078160811a394ec6ee92
Guillaume Gomez
2024-12-04T13:14:56
Update crate version to 0.33.0
diff --git a/Cargo.toml b/Cargo.toml index 2a9fc59..b28ddfa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.32.1" +version = "0.33.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPUs,...
1
1
1
1bd7f1cd06ac0e84000a24c6a851320cc4d59ffc
Guillaume Gomez
2024-12-04T00:39:41
Make `Component::temperature` and `Component::max` return `Option`
diff --git a/src/common/component.rs b/src/common/component.rs index 7a532c5..ba8de26 100644 --- a/src/common/component.rs +++ b/src/common/component.rs @@ -166,7 +166,11 @@ impl Components { /// /// let components = Components::new_with_refreshed_list(); /// for component in &components { -/// println!("{} {}°C...
9
76
67
3436601246add97de95db994b496eff8ac924295
Guillaume Gomez
2024-12-04T00:05:43
Rename `Users::refresh_list` and `Groups::refresh_list` into `refresh`
diff --git a/benches/basic.rs b/benches/basic.rs index e764622..3a92a2d 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -127,6 +127,6 @@ fn bench_refresh_users_list(b: &mut test::Bencher) { let mut users = sysinfo::Users::new_with_refreshed_list(); b.iter(move || { - users.refresh_list(); + ...
5
15
17