pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bottom: patch libc and sysinfo crates.
Module Name: pkgsrc-wip
Committed By: Santhosh Raju <fox%NetBSD.org@localhost>
Pushed By: fox
Date: Sat Jul 4 15:10:01 2026 +0200
Changeset: e66cdd8db69c42b6c6557d57c86abd9e6ffef30e
Modified Files:
bottom/distinfo
Added Files:
bottom/patches/patch-.._vendor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs
bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs
bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_mod.rs
bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs
bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs
Log Message:
bottom: patch libc and sysinfo crates.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e66cdd8db69c42b6c6557d57c86abd9e6ffef30e
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
bottom/distinfo | 5 +++
...ndor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs | 22 +++++++++++
...c-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs | 14 +++++++
.../patch-.._vendor_libc-0.2.180_src_unix_mod.rs | 17 +++++++++
...ndor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs | 43 ++++++++++++++++++++++
...r_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs | 36 ++++++++++++++++++
6 files changed, 137 insertions(+)
diffs:
diff --git a/bottom/distinfo b/bottom/distinfo
index f1f13742b6..f99b7cf50d 100644
--- a/bottom/distinfo
+++ b/bottom/distinfo
@@ -690,6 +690,11 @@ Size (wrapcenum-derive-0.4.1.crate) = 7400 bytes
BLAKE2s (zmij-1.0.19.crate) = e6857f8f672ab60cba6575bda0b64bfd4898ee7c34cb1f799842885965039969
SHA512 (zmij-1.0.19.crate) = aa191ba286f10d59727981e68f7fb0214d53b02d6c28951e6f16670433cd79abc4615384b3b1e1f74adc81a3f51c15d906fda0340b03938984693332feeac2cc
Size (zmij-1.0.19.crate) = 23948 bytes
+SHA1 (patch-.._vendor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs) = 574d63d17f76f30f17e2dd0e843cb0ded477632f
+SHA1 (patch-.._vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs) = 59c853c2ed727b88b3cb6a84787d767e325a87a9
+SHA1 (patch-.._vendor_libc-0.2.180_src_unix_mod.rs) = 7f898d3cdcb4c17be7d0844fe7fc369ecf8c1077
+SHA1 (patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs) = ef5d757b084edf6716a3b011e78bac3e7ded52f6
+SHA1 (patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs) = b7e0aef4f5807340b9aa88bddd8ffa670643bbc3
SHA1 (patch-src_canvas_dialogs_process__kill__dialog.rs) = 85bd46668e3312a95835d8fe253e4366d81fed91
SHA1 (patch-src_collection.rs) = 57f4af4730adc2b56074cd7da93afaec218cc93b
SHA1 (patch-src_collection_disks.rs) = 63f0217e955e53a87ff134e74d15f315075e8a8c
diff --git a/bottom/patches/patch-.._vendor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs b/bottom/patches/patch-.._vendor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs
new file mode 100644
index 0000000000..cf09202d91
--- /dev/null
+++ b/bottom/patches/patch-.._vendor_libc-0.2.180_src_new_netbsd_sys_statvfs.rs
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Upstream patch: https://github.com/rust-lang/libc/pull/5243
+
+--- ../vendor/libc-0.2.180/src/new/netbsd/sys/statvfs.rs.orig 2026-07-04 11:20:16.859754761 +0000
++++ ../vendor/libc-0.2.180/src/new/netbsd/sys/statvfs.rs
+@@ -35,13 +35,11 @@ s! {
+ pub f_namemax: c_ulong,
+ pub f_owner: crate::uid_t,
+
+- // This type is updated in a future version
+- f_spare: [u32; 4],
++ f_spare: [u64; 4],
+
+ pub f_fstypename: [c_char; _VFS_NAMELEN],
+ pub f_mntonname: [c_char; _VFS_MNAMELEN],
+ pub f_mntfromname: [c_char; _VFS_MNAMELEN],
+- // Added in NetBSD10
+- // pub f_mntfromlabel: [c_char; _VFS_MNAMELEN],
++ pub f_mntfromlabel: [c_char; _VFS_MNAMELEN],
+ }
+ }
diff --git a/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs b/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs
new file mode 100644
index 0000000000..09d87bbc10
--- /dev/null
+++ b/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_bsd_netbsdlike_netbsd_mod.rs
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Upstream patch: https://github.com/rust-lang/libc/pull/5243
+
+--- ../vendor/libc-0.2.180/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig 2026-07-04 11:20:16.886076859 +0000
++++ ../vendor/libc-0.2.180/src/unix/bsd/netbsdlike/netbsd/mod.rs
+@@ -2206,6 +2206,7 @@ extern "C" {
+ ntargets: size_t,
+ hint: *const c_void,
+ ) -> c_int;
++ #[link_name = "__getmntinfo90"]
+ pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int;
+ pub fn getvfsstat(buf: *mut crate::statvfs, bufsize: size_t, flags: c_int) -> c_int;
+
diff --git a/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_mod.rs b/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_mod.rs
new file mode 100644
index 0000000000..52d7ee6e86
--- /dev/null
+++ b/bottom/patches/patch-.._vendor_libc-0.2.180_src_unix_mod.rs
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Upstream patch: https://github.com/rust-lang/libc/pull/5243
+
+--- ../vendor/libc-0.2.180/src/unix/mod.rs.orig 2026-07-04 11:20:16.882281039 +0000
++++ ../vendor/libc-0.2.180/src/unix/mod.rs
+@@ -1567,8 +1567,10 @@ extern "C" {
+ pub fn sem_trywait(sem: *mut sem_t) -> c_int;
+ pub fn sem_post(sem: *mut sem_t) -> c_int;
+ #[cfg_attr(gnu_file_offset_bits64, link_name = "statvfs64")]
++ #[cfg_attr(target_os = "netbsd", link_name = "__statvfs190")]
+ pub fn statvfs(path: *const c_char, buf: *mut crate::statvfs) -> c_int;
+ #[cfg_attr(gnu_file_offset_bits64, link_name = "fstatvfs64")]
++ #[cfg_attr(target_os = "netbsd", link_name = "__fstatvfs190")]
+ pub fn fstatvfs(fd: c_int, buf: *mut crate::statvfs) -> c_int;
+
+ #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
diff --git a/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs b/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs
new file mode 100644
index 0000000000..bb5555caf1
--- /dev/null
+++ b/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_disk.rs
@@ -0,0 +1,43 @@
+$NetBSD$
+
+Extract device name correctly.
+
+Patch not yet upstreamed.
+
+--- ../vendor/sysinfo-0.39.3/src/unix/bsd/netbsd/disk.rs.orig 2026-07-04 11:34:38.984915123 +0000
++++ ../vendor/sysinfo-0.39.3/src/unix/bsd/netbsd/disk.rs
+@@ -223,7 +223,15 @@ impl GetValues for DiskInner {
+ }
+
+ fn same_name(dev_id: &[c_char], drive_name: &[c_char]) -> bool {
++ // NetBSD iostats returns device names without partition letters (e.g., "ld0")
++ // but mount points use full device names with partitions (e.g., "ld0a").
++ // We need to match by checking if dev_id starts with drive_name.
++
+ for (c1, c2) in dev_id.iter().zip(drive_name.iter()) {
++ // Stop comparison at null terminator in drive_name
++ if *c2 == 0 {
++ return true;
++ }
+ if c1 != c2 {
+ return false;
+ }
+@@ -347,10 +355,14 @@ pub unsafe fn get_all_list(
+ if mount_point == "/boot/efi" {
+ continue;
+ }
+- let name = if mount_point == "/" {
+- OsString::from("root")
+- } else {
+- OsString::from(mount_point)
++
++ // Extract device name from f_mntfromname (e.g., "/dev/ld0a")
++ let name = match c_buf_to_utf8_str(&fs_info.f_mntfromname) {
++ Some(device_name) => OsString::from(device_name),
++ None => {
++ sysinfo_debug!("Cannot get disk device name, ignoring it.");
++ continue;
++ }
+ };
+
+ if let Some(disk) = container.iter_mut().find(|d| {
diff --git a/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs b/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs
new file mode 100644
index 0000000000..6c020155da
--- /dev/null
+++ b/bottom/patches/patch-.._vendor_sysinfo-0.39.3_src_unix_bsd_netbsd_process.rs
@@ -0,0 +1,36 @@
+$NetBSD$
+
+Extract proper read / write statistics.
+
+Patch not yet upstreamed.
+
+--- ../vendor/sysinfo-0.39.3/src/unix/bsd/netbsd/process.rs.orig 2026-07-04 11:34:38.991541351 +0000
++++ ../vendor/sysinfo-0.39.3/src/unix/bsd/netbsd/process.rs
+@@ -44,10 +44,10 @@ impl ProcessInner {
+
+ pub(crate) fn disk_usage(&self) -> DiskUsage {
+ DiskUsage {
+- written_bytes: 0, // self.written_bytes.saturating_sub(self.old_written_bytes),
+- total_written_bytes: 0, // self.written_bytes,
+- read_bytes: 0, // self.read_bytes.saturating_sub(self.old_read_bytes),
+- total_read_bytes: 0, // self.read_bytes,
++ written_bytes: self.written_bytes.saturating_sub(self.old_written_bytes),
++ total_written_bytes: self.written_bytes,
++ read_bytes: self.read_bytes.saturating_sub(self.old_read_bytes),
++ total_read_bytes: self.read_bytes,
+ }
+ }
+
+@@ -123,9 +123,10 @@ fn update_proc_info(
+
+ if refresh_kind.disk_usage() {
+ proc_.old_read_bytes = proc_.read_bytes;
+- proc_.read_bytes = kproc.p_uru_inblock as _;
++ // NetBSD reports I/O in 512-byte blocks, convert to bytes
++ proc_.read_bytes = (kproc.p_uru_inblock as u64) * 512;
+ proc_.old_written_bytes = proc_.written_bytes;
+- proc_.written_bytes = kproc.p_uru_oublock as _;
++ proc_.written_bytes = (kproc.p_uru_oublock as u64) * 512;
+ }
+
+ if refresh_kind.cpu() {
Home |
Main Index |
Thread Index |
Old Index