Changeset 5184 in vbox for trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
- Timestamp:
- Oct 8, 2007 1:23:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r5126 r5184 45 45 # include <fcntl.h> 46 46 # include <errno.h> 47 # include <stropts.h> 48 # include <sys/dkio.h> 47 49 48 50 #elif defined(RT_OS_WINDOWS) … … 918 920 return rc; 919 921 920 #elif defined(RT_OS_LINUX) 922 #elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 921 923 /** @todo we've got RTFILE_O_NON_BLOCK now. Change the code to use RTFileOpen. */ 922 924 int FileDevice = open(pThis->pszDeviceOpen, (pThis->fReadOnlyConfig ? O_RDONLY : O_RDWR) | O_NONBLOCK); … … 1013 1015 } 1014 1016 return rc; 1017 1018 #elif defined(RT_OS_SOLARIS) 1019 /* 1020 * Sun docs suggests using DKIOCGGEOM instead of DKIOCGMEDIAINFO, but 1021 * Sun themselves use DKIOCGMEDIAINFO for DVDs/CDs, and use DKIOCGGEOM 1022 * for secondary storage devices. 1023 */ 1024 struct dk_minfo MediaInfo; 1025 if (ioctl(pThis->FileDevice, DKIOCGMEDIAINFO, &MediaInfo) == 0) 1026 { 1027 *pcb = MediaInfo.dki_capacity * (uint64_t)MediaInfo.dki_lbsize; 1028 return VINF_SUCCESS; 1029 } 1030 return RTFileSeek(pThis->FileDevice, 0, RTFILE_SEEK_END, pcb); 1015 1031 1016 1032 #elif defined(RT_OS_WINDOWS)
Note:
See TracChangeset
for help on using the changeset viewer.