summaryrefslogtreecommitdiffstats
path: root/lib/blkdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/blkdev.c')
-rw-r--r--lib/blkdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/blkdev.c b/lib/blkdev.c
index fb69e88b5..5cb6554df 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -210,11 +210,15 @@ blkdev_get_sector_size(int fd, int *sector_size)
*/
int blkdev_is_misaligned(int fd)
{
+#ifdef BLKALIGNOFF
int aligned;
if (ioctl(fd, BLKALIGNOFF, &aligned) < 0)
return 0; /* probably kernel < 2.6.32 */
return aligned;
+#else
+ return 0;
+#endif
}
#ifdef TEST_PROGRAM