Date: Thu, 22 Jun 2006 15:40:39 -0500 From: Andrew <andrew.chace@gmail.com> To: freebsd-hackers@freebsd.org Subject: Coding question: finding the size of a block device Message-ID: <1151008839.2360.30.camel@LatitudeFC5.network>
next in thread | raw e-mail | index | archive | help
Hello, First off, is this the appropriate list for coding questions? I read questions@, but I do not often see discussions about code there, so I thought I might ask here instead. If not, please correct me. I need to know the size of a block device in some code that I'm writing. I checked the man pages, and I was thinking that I could use fstat(), but after I call it on the device, stat->st_size is still 0. I tested fstat()'s return value, and it's correct; there are no errors. So, I'm thinking that this is not the correct way to do this. So I guess my question is: is there a POSIX compatible function that will allow me to check the size of a given block device? Thanks, -Andrew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1151008839.2360.30.camel>