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.

Reply via email to