Skip to content

Commit 00bff43

Browse files
wlynxgAkhilTThomas
authored andcommitted
feat: add ioctl flags in linux/if_tun.h
fix: values under different architectures style: update code style fix: remove `TUNSETCARRIER` and `TUNGETDEVNETNS` feat: add `TUNSETCARRIER` and `TUNGETDEVNETNS` in `gnu` style: update code style (backport <rust-lang#3960>) (cherry picked from commit c24c516)
1 parent 587b194 commit 00bff43

File tree

1 file changed

+23
-0
lines changed
  • src/unix/linux_like/linux/gnu

1 file changed

+23
-0
lines changed

src/unix/linux_like/linux/gnu/mod.rs

+23
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,29 @@ cfg_if! {
12061206
}
12071207
}
12081208

1209+
cfg_if! {
1210+
if #[cfg(any(target_arch = "x86",
1211+
target_arch = "x86_64",
1212+
target_arch = "arm",
1213+
target_arch = "aarch64",
1214+
target_arch = "loongarch64",
1215+
target_arch = "riscv64",
1216+
target_arch = "s390x"))] {
1217+
pub const TUNSETCARRIER: ::Ioctl = 0x400454e2;
1218+
pub const TUNGETDEVNETNS: ::Ioctl = 0x54e3;
1219+
} else if #[cfg(any(target_arch = "mips",
1220+
target_arch = "mips64",
1221+
target_arch = "powerpc",
1222+
target_arch = "powerpc64",
1223+
target_arch = "sparc",
1224+
target_arch = "sparc64"))] {
1225+
pub const TUNSETCARRIER: ::Ioctl = 0x800454e2;
1226+
pub const TUNGETDEVNETNS: ::Ioctl = 0x200054e3;
1227+
} else {
1228+
// Unknown target_arch
1229+
}
1230+
}
1231+
12091232
extern "C" {
12101233
pub fn fgetspent_r(
12111234
fp: *mut crate::FILE,

0 commit comments

Comments
 (0)