From de9f3568758d8aa365f3f6f4a72273db3dae6645 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Wed, 4 Mar 2026 17:57:52 +0900 Subject: [PATCH] nproc: Cleanup a const --- src/uu/nproc/src/nproc.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/uu/nproc/src/nproc.rs b/src/uu/nproc/src/nproc.rs index a400440fb7a..b624f6d4952 100644 --- a/src/uu/nproc/src/nproc.rs +++ b/src/uu/nproc/src/nproc.rs @@ -13,15 +13,6 @@ use uucore::error::{UResult, USimpleError}; use uucore::format_usage; use uucore::translate; -#[cfg(any(target_os = "linux", target_os = "android"))] -pub const _SC_NPROCESSORS_CONF: libc::c_int = 83; -#[cfg(target_vendor = "apple")] -pub const _SC_NPROCESSORS_CONF: libc::c_int = libc::_SC_NPROCESSORS_CONF; -#[cfg(target_os = "freebsd")] -pub const _SC_NPROCESSORS_CONF: libc::c_int = 57; -#[cfg(target_os = "netbsd")] -pub const _SC_NPROCESSORS_CONF: libc::c_int = 1001; - static OPT_ALL: &str = "all"; static OPT_IGNORE: &str = "ignore"; @@ -122,7 +113,7 @@ pub fn uu_app() -> Command { target_os = "netbsd" ))] fn num_cpus_all() -> usize { - let nprocs = unsafe { libc::sysconf(_SC_NPROCESSORS_CONF) }; + let nprocs = unsafe { libc::sysconf(libc::_SC_NPROCESSORS_CONF) }; if nprocs == 1 { // In some situation, /proc and /sys are not mounted, and sysconf returns 1. // However, we want to guarantee that `nproc --all` >= `nproc`.