Changeset 5894 in vbox
- Timestamp:
- Nov 30, 2007 2:52:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvHostRawDisk.cpp
r4071 r5894 38 38 #include <linux/hdreg.h> 39 39 #include <linux/fs.h> 40 #endif /* !RT_OS_WINDOWS && !RT_OS_LINUX */ 40 #elif RT_OS_SOLARIS 41 #include <sys/types.h> 42 #include <sys/stat.h> 43 #include <sys/dkio.h> 44 #include <stropts.h> 45 #include <errno.h> 46 #endif /* !RT_OS_WINDOWS && !RT_OS_LINUX && !RT_OS_SOLARIS */ 41 47 42 48 #include "Builtins.h" … … 379 385 rc = RTErrConvertFromErrno(errno); 380 386 } 387 #elif defined(RT_OS_SOLARIS) 388 struct stat DevStat; 389 if (!fstat(pThis->HostDiskFile, &DevStat) && S_ISBLK(DevStat.st_mode)) 390 { 391 struct dk_geom DriveGeo; 392 if (!ioctl(pThis->HostDiskFile, DKIOCGGEOM, &DriveGeo)) 393 { 394 pThis->cCylinders = DriveGeo.dkg_ncyl; 395 pThis->cHeads = DriveGeo.dkg_nhead; 396 pThis->cSectors = DriveGeo.dkg_nsect; 397 if (!pThis->cbSize) 398 { 399 struct dk_minfo DriveInfo; 400 if (!ioctl(pThis->HostDiskFile, DKIOCGMEDIAINFO, &DriveInfo)) 401 pThis->cbSize = (uint64_t)DriveInfo.dki_lbsize * DriveInfo.dki_capacity; 402 else 403 rc = RTErrConvertFromErrno(errno); 404 } 405 } 406 else 407 rc = RTErrConvertFromErrno(errno); 408 } 381 409 #else 382 410 /** @todo add further host OS geometry detection mechanisms. */
Note:
See TracChangeset
for help on using the changeset viewer.