Skip to content

Commit 62f9f5f

Browse files
committed
Endian dependent ioctl constants on PowerPC
1 parent 984309c commit 62f9f5f

File tree

1 file changed

+9
-2
lines changed
  • src/unix/linux_like/linux/arch/powerpc

1 file changed

+9
-2
lines changed

src/unix/linux_like/linux/arch/powerpc/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,12 @@ pub const TIOCM_DSR: ::c_int = 0x100;
110110
pub const BOTHER: ::speed_t = 0o0037;
111111
pub const IBSHIFT: ::tcflag_t = 16;
112112

113-
pub const BLKSSZGET: ::c_int = 0x1268;
114-
pub const BLKPBSZGET: ::c_int = 0x127B;
113+
cfg_if! {
114+
if #[cfg(target_endian = "little")] {
115+
pub const BLKSSZGET: ::c_int = 0x1268;
116+
pub const BLKPBSZGET: ::c_int = 0x127B;
117+
} else if #[cfg(target_endian = "big")] {
118+
pub const BLKSSZGET: ::c_int = 0x6812;
119+
pub const BLKPBSZGET: ::c_int = 0x7B12;
120+
}
121+
}

0 commit comments

Comments
 (0)