From 032a0554884495fba134a2e97a3d1d3fbe3890f5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 21 Apr 2023 05:26:13 -0700 Subject: [PATCH] Define `FICLONE` on mips and power. PR #3173 added definitions of `FICLONE` for mips and power to a generic file, however mips and power have their own versions of this file, so move their `FICLONE` definitions into their own files. --- src/unix/linux_like/linux/arch/generic/mod.rs | 10 ++-------- src/unix/linux_like/linux/arch/mips/mod.rs | 3 +++ src/unix/linux_like/linux/arch/powerpc/mod.rs | 3 +++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 4693978311948..8acf5b5520bf1 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -104,6 +104,8 @@ cfg_if! { pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68; } } +// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; +// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; cfg_if! { if #[cfg(any(target_arch = "x86", @@ -114,16 +116,8 @@ cfg_if! { target_arch = "s390x"))] { pub const FICLONE: ::c_ulong = 0x40049409; pub const FICLONERANGE: ::c_ulong = 0x4020940D; - } else if #[cfg(any(target_arch = "mips", - target_arch = "mips64", - target_arch = "powerpc", - target_arch = "powerpc64"))] { - pub const FICLONE: ::c_ulong = 0x80049409; - pub const FICLONERANGE: ::c_ulong = 0x8020940D; } } -// pub const SO_PREFER_BUSY_POLL: ::c_int = 69; -// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index 077417de52faf..34c00a293696a 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -103,6 +103,9 @@ pub const SO_TIMESTAMPING: ::c_int = 37; // pub const SO_PREFER_BUSY_POLL: ::c_int = 69; // pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; +pub const FICLONE: ::c_ulong = 0x80049409; +pub const FICLONERANGE: ::c_ulong = 0x8020940D; + // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS; diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index 637b7a1e34746..64c3eaab543a6 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -85,6 +85,9 @@ pub const SO_BINDTOIFINDEX: ::c_int = 62; // pub const SO_PREFER_BUSY_POLL: ::c_int = 69; // pub const SO_BUSY_POLL_BUDGET: ::c_int = 70; +pub const FICLONE: ::c_ulong = 0x80049409; +pub const FICLONERANGE: ::c_ulong = 0x8020940D; + // Defined in unix/linux_like/mod.rs // pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP; pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;