RE: How to get the size of the block device ???? (Important)

Matt_Domsch@Dell.com
Tue, 17 Dec 2002 12:49:09 -0600


> I think the question being asked is 'how do I find out how many block
> long the device is?'

You can use the BLKGETSIZE64 ioctl() too. I refer you to the GNU Parted
code (ftp.gnu.org/gnu/parted) in libparted/linux.c to see how it's done
there. It first tries BLKGETSIZE64, then if that fails, tries BLKGETSIZE
instead.

Thanks,
Matt

--
Matt Domsch
Sr. Software Engineer, Lead Engineer, Architect
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/