From 9845d13347d6b26bfc157652ea09027203a461a7 Mon Sep 17 00:00:00 2001 From: Devyn Cairns Date: Fri, 21 Jun 2024 03:03:10 -0700 Subject: [PATCH] fix nu-system build on arm64 FreeBSD (#13196) # Description Fixes #13194 `ki_stat` is supposed to be a `c_char`, but was defined was `i8`. Unfortunately, `c_char` is `u8` on Aarch64 (on all platforms), so this doesn't compile. I fixed it to use `c_char` instead. Double checked whether NetBSD is affected, but the `libc` code defines it as `i8` for some reason (erroneously, really) but that doesn't matter too much. Anyway should be ok there. Confirmed to be working. --- crates/nu-system/src/freebsd.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/nu-system/src/freebsd.rs b/crates/nu-system/src/freebsd.rs index ff0f67dd10..4a556762e4 100644 --- a/crates/nu-system/src/freebsd.rs +++ b/crates/nu-system/src/freebsd.rs @@ -1,6 +1,7 @@ use itertools::{EitherOrBoth, Itertools}; use libc::{ - kinfo_proc, sysctl, CTL_HW, CTL_KERN, KERN_PROC, KERN_PROC_ALL, KERN_PROC_ARGS, TDF_IDLETD, + c_char, kinfo_proc, sysctl, CTL_HW, CTL_KERN, KERN_PROC, KERN_PROC_ALL, KERN_PROC_ARGS, + TDF_IDLETD, }; use std::{ ffi::CStr, @@ -16,7 +17,7 @@ pub struct ProcessInfo { pub ppid: i32, pub name: String, pub argv: Vec, - pub stat: i8, + pub stat: c_char, pub percent_cpu: f64, pub mem_resident: u64, // in bytes pub mem_virtual: u64, // in bytes