VirtualBox

Ignore:
Timestamp:
Dec 19, 2012 6:12:31 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82883
Message:

SUPDrv,SUPLib: Introducing /dev/vboxdrvu on darwin (other platforms soon to follow).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp

    r39091 r44173  
    6262*   Defined Constants And Macros                                               *
    6363*******************************************************************************/
    64 /** Unix Device name. */
    65 #define DEVICE_NAME     "/dev/vboxdrv"
     64/** System device name. */
     65#define DEVICE_NAME_SYS     "/dev/vboxdrv"
     66/** User device name. */
     67#define DEVICE_NAME_USR     "/dev/vboxdrvu"
    6668
    6769/* define MADV_DONTFORK if it's missing from the system headers. */
     
    7274
    7375
    74 int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited)
     76int suplibOsInit(PSUPLIBDATA pThis, bool fPreInited, bool fUnrestricted)
    7577{
    7678    /*
     
    9395     * Try open the device.
    9496     */
    95     int hDevice = open(DEVICE_NAME, O_RDWR, 0);
     97    int hDevice = open(fUnrestricted ? DEVICE_NAME_SYS : DEVICE_NAME_USR, O_RDWR, 0);
    9698    if (hDevice < 0)
    9799    {
     
    99101         * Try load the device.
    100102         */
    101         hDevice = open(DEVICE_NAME, O_RDWR, 0);
     103        hDevice = open(fUnrestricted ? DEVICE_NAME_SYS : DEVICE_NAME_USR, O_RDWR, 0);
    102104        if (hDevice < 0)
    103105        {
     
    133135     * We're done.
    134136     */
    135     pThis->hDevice = hDevice;
     137    pThis->hDevice       = hDevice;
     138    pThis->fUnrestricted = fUnrestricted;
    136139    return VINF_SUCCESS;
    137140}
Note: See TracChangeset for help on using the changeset viewer.

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