summaryrefslogtreecommitdiff
path: root/futility/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/misc.c')
-rw-r--r--futility/misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/futility/misc.c b/futility/misc.c
index 24e645be..3d85f691 100644
--- a/futility/misc.c
+++ b/futility/misc.c
@@ -5,7 +5,9 @@
*/
#include <errno.h>
+#ifndef HAVE_MACOS
#include <linux/fs.h> /* For BLKGETSIZE64 */
+#endif
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
@@ -241,8 +243,10 @@ enum futil_file_err futil_map_file(int fd, int writeable,
return FILE_ERR_STAT;
}
+#ifndef HAVE_MACOS
if (S_ISBLK(sb.st_mode))
ioctl(fd, BLKGETSIZE64, &sb.st_size);
+#endif
/* If the image is larger than 2^32 bytes, it's wrong. */
if (sb.st_size < 0 || sb.st_size > UINT32_MAX) {