VirtualBox

Ignore:
Timestamp:
Oct 8, 2007 1:23:33 PM (17 years ago)
Author:
vboxsync
Message:

Solaris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r5126 r5184  
    4545# include <fcntl.h>
    4646# include <errno.h>
     47# include <stropts.h>
     48# include <sys/dkio.h>
    4749
    4850#elif defined(RT_OS_WINDOWS)
     
    918920    return rc;
    919921
    920 #elif defined(RT_OS_LINUX)
     922#elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
    921923    /** @todo we've got RTFILE_O_NON_BLOCK now. Change the code to use RTFileOpen. */
    922924    int FileDevice = open(pThis->pszDeviceOpen, (pThis->fReadOnlyConfig ? O_RDONLY : O_RDWR) | O_NONBLOCK);
     
    10131015    }
    10141016    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);
    10151031
    10161032#elif defined(RT_OS_WINDOWS)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette