aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-04 01:43:48 +0000
committerhpa <hpa>2005-01-04 01:43:48 +0000
commit2e7cbed5827feec8ce30597d87fb4b1b4695fe4a (patch)
treef597ccdd3c14bbfdee3a01533772483f64b96195
parent5133e41f0d7e33ac4922880eb060d685224a5949 (diff)
downloadsyslinux-elf-2e7cbed5827feec8ce30597d87fb4b1b4695fe4a.tar.gz
syslinux-elf-2e7cbed5827feec8ce30597d87fb4b1b4695fe4a.tar.xz
syslinux-elf-2e7cbed5827feec8ce30597d87fb4b1b4695fe4a.zip
If BLKGETSIZE64 isn't defined, define it.
-rw-r--r--extlinux/extlinux.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/extlinux/extlinux.c b/extlinux/extlinux.c
index 13f1f346..d3fa8c7d 100644
--- a/extlinux/extlinux.c
+++ b/extlinux/extlinux.c
@@ -42,6 +42,11 @@
# define dprintf(...) ((void)0)
#endif
+#if defined(__linux__) && !defined(BLKGETSIZE64)
+/* This takes a u64, but the size field says size_t. Someone screwed big. */
+# define BLKGETSIZE64 _IOR(0x12,114,size_t)
+#endif
+
#define LDLINUX_MAGIC 0x3eb202fe
enum bs_offsets {
@@ -286,7 +291,6 @@ uint64_t get_size(int devfd)
if ( !ioctl(devfd, BLKGETSIZE64, &bytes) )
return bytes;
#endif
-
if ( !ioctl(devfd, BLKGETSIZE, &sects) )
return (uint64_t)sects << 9;
else if ( !fstat(devfd, &st) && st.st_size )