summaryrefslogtreecommitdiffstats
path: root/include/blkdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/blkdev.h')
-rw-r--r--include/blkdev.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/blkdev.h b/include/blkdev.h
index 1f0fe674e..1b10569b9 100644
--- a/include/blkdev.h
+++ b/include/blkdev.h
@@ -6,7 +6,7 @@
#define DEFAULT_SECTOR_SIZE 512
-#ifndef BLKROSET
+#if !defined(BLKROSET) && defined(__linux__)
#define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-write) */
#define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_write) */
@@ -34,7 +34,9 @@
#endif /* BLKROSET */
#ifndef HDIO_GETGEO
-#define HDIO_GETGEO 0x0301
+# ifdef __linux__
+# define HDIO_GETGEO 0x0301
+# endif
struct hd_geometry {
unsigned char heads;
unsigned char sectors;
@@ -43,6 +45,9 @@ struct hd_geometry {
};
#endif
+/* Determine size in bytes */
+off_t blkdev_find_size (int fd);
+
/* get size in bytes */
int blkdev_get_size(int fd, unsigned long long *bytes);
@@ -52,5 +57,4 @@ int blkdev_get_sectors(int fd, unsigned long long *sectors);
/* get hardware sector size */
int blkdev_get_sector_size(int fd, int *sector_size);
-
#endif /* BLKDEV_H */