Skip to content

Commit e9ad8b8

Browse files
oech3cakebaker
authored andcommitted
nproc: Cleanup a const
1 parent 9bbb58b commit e9ad8b8

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/uu/nproc/src/nproc.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ use uucore::error::{UResult, USimpleError};
1313
use uucore::format_usage;
1414
use uucore::translate;
1515

16-
#[cfg(any(target_os = "linux", target_os = "android"))]
17-
pub const _SC_NPROCESSORS_CONF: libc::c_int = 83;
18-
#[cfg(target_vendor = "apple")]
19-
pub const _SC_NPROCESSORS_CONF: libc::c_int = libc::_SC_NPROCESSORS_CONF;
20-
#[cfg(target_os = "freebsd")]
21-
pub const _SC_NPROCESSORS_CONF: libc::c_int = 57;
22-
#[cfg(target_os = "netbsd")]
23-
pub const _SC_NPROCESSORS_CONF: libc::c_int = 1001;
24-
2516
static OPT_ALL: &str = "all";
2617
static OPT_IGNORE: &str = "ignore";
2718

@@ -122,7 +113,7 @@ pub fn uu_app() -> Command {
122113
target_os = "netbsd"
123114
))]
124115
fn num_cpus_all() -> usize {
125-
let nprocs = unsafe { libc::sysconf(_SC_NPROCESSORS_CONF) };
116+
let nprocs = unsafe { libc::sysconf(libc::_SC_NPROCESSORS_CONF) };
126117
if nprocs == 1 {
127118
// In some situation, /proc and /sys are not mounted, and sysconf returns 1.
128119
// However, we want to guarantee that `nproc --all` >= `nproc`.

0 commit comments

Comments
 (0)