freebsd-ports/sysutils/e2fsprogs/files/patch-DIOCGMEDIASIZE
Pav Lucistnik a000f4798b - Update to 1.39
PR:		ports/98847
Submitted by:	Matthias Andree <matthias.andree@gmx.de> (maintainer)
2006-06-12 12:13:09 +00:00

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)