[ug-bosug] size of device files
Ashwin Bhat
ashwinbhatks at gmail.com
Tue Oct 7 23:34:01 PDT 2008
harini g wrote:
>
>
> Hi,
>
> Would like to know how to find the size of the block device using C.
> SEEK_END seems to be little controversial means of finding the size.
>
> Is ioctl supported on solaris?
>
> Can some one help me on this ?
>
> Regards,
> -harini
>
Yes ioctl is supported in Solaris
Use ioctl(fd, DIOCGMEDIASIZE, &mediasize) where mediasize is of type off_t
See this link -
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/hackers/2006-06/msg00214.html
It might work in OpenSolaris as well.
More information about the ug-bosug
mailing list