a000f4798b
PR: ports/98847 Submitted by: Matthias Andree <matthias.andree@gmx.de> (maintainer)
16 lines
549 B
Text
16 lines
549 B
Text
diff -r 46fd786b5562 -r 69fad9bdafc0 lib/blkid/getsize.c
|
|
--- a/lib/blkid/getsize.c Mon May 29 11:47:49 2006 -0400
|
|
+++ b/lib/blkid/getsize.c Tue May 30 00:54:49 2006 +0200
|
|
@@ -121,6 +121,12 @@ blkid_loff_t blkid_get_dev_size(int fd)
|
|
if (ioctl(fd, BLKGETSIZE, &size) >= 0)
|
|
return (blkid_loff_t)size << 9;
|
|
#endif
|
|
+
|
|
+/* tested on FreeBSD 6.1-RELEASE i386 */
|
|
+#ifdef DIOCGMEDIASIZE
|
|
+ if (ioctl(fd, DIOCGMEDIASIZE, &size64) >= 0)
|
|
+ return (off_t)size64;
|
|
+#endif /* DIOCGMEDIASIZE */
|
|
|
|
#ifdef FDGETPRM
|
|
if (ioctl(fd, FDGETPRM, &this_floppy) >= 0)
|