Skip to content

Commit 5d88c52

Browse files
committed
fix!: fix get sector size on mips64
1 parent 6513773 commit 5d88c52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/linux.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ use std::os::unix::io::AsRawFd;
55
use thiserror::Error;
66

77
mod ioctl {
8-
use nix::{ioctl_none, ioctl_read_bad};
8+
use nix::{ioctl_none, ioctl_read_bad, request_code_none};
99

10-
ioctl_read_bad!(blksszget, 0x1268, u64);
10+
ioctl_read_bad!(
11+
blksszget,
12+
request_code_none!(0x12, 104),
13+
::std::os::raw::c_int
14+
);
1115
ioctl_none!(blkrrpart, 0x12, 95);
1216
}
1317

@@ -50,7 +54,7 @@ pub fn reread_partition_table(file: &mut fs::File) -> Result<(), BlockError> {
5054
}
5155

5256
/// Makes an ioctl call to obtain the sector size of a block device
53-
pub fn get_sector_size(file: &mut fs::File) -> Result<u64, BlockError> {
57+
pub fn get_sector_size(file: &mut fs::File) -> Result<i32, BlockError> {
5458
let metadata = file.metadata().map_err(BlockError::Metadata)?;
5559
let mut sector_size = 512;
5660

0 commit comments

Comments
 (0)