Skip to content

Commit 984309c

Browse files
committed
Endian dependent ioctl constants on mips
1 parent 733b5a8 commit 984309c

File tree

1 file changed

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

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,12 @@ pub const TIOCM_DSR: ::c_int = 0x400;
132132
pub const BOTHER: ::speed_t = 0o010000;
133133
pub const IBSHIFT: ::tcflag_t = 16;
134134

135-
pub const BLKSSZGET: ::c_int = 0x1268;
136-
pub const BLKPBSZGET: ::c_int = 0x127B;
135+
cfg_if! {
136+
if #[cfg(target_endian = "little")] {
137+
pub const BLKSSZGET: ::c_int = 0x1268;
138+
pub const BLKPBSZGET: ::c_int = 0x127B;
139+
} else if #[cfg(target_endian = "big")] {
140+
pub const BLKSSZGET: ::c_int = 0x6812;
141+
pub const BLKPBSZGET: ::c_int = 0x7B12;
142+
}
143+
}

0 commit comments

Comments
 (0)