VirtualBox

Changeset 23052 in vbox for trunk/src


Ignore:
Timestamp:
Sep 16, 2009 8:28:05 AM (15 years ago)
Author:
vboxsync
Message:

VBoxFUSE: make it build and work on Linux

Location:
trunk/src/VBox/ImageMounter/VBoxFUSE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ImageMounter/VBoxFUSE/Makefile.kmk

    r21129 r23052  
    5454        $(LIB_RUNTIME)
    5555VBoxFUSE_LIBS.darwin = fuse
     56VBoxFUSE_LIBS.linux = fuse
    5657VBoxFUSE_LIBPATHS.darwin = /usr/local/lib
    5758
  • trunk/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp

    r21129 r23052  
    2727#include <iprt/types.h>
    2828
    29 #if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
    3030# include <sys/param.h>
    3131# undef PVM     /* Blasted old BSD mess still hanging around darwin. */
     
    4141//#  define EDOOFUS EXYZ
    4242# else
    43 error "Choose an unlikely and (if possible) fun error number for EDOOFUS."
     43define EDOOFUS 0xfad8484d
    4444# endif
    4545#endif
     
    338338    pStat->st_blocks    = (pNode->cbPrimary + DEV_BSIZE - 1) / DEV_BSIZE;
    339339    pStat->st_blksize   = 0x1000;           /* ignored */
     340#ifndef RT_OS_LINUX
    340341    pStat->st_flags     = 0;
    341342    pStat->st_gen       = 0;
     343#endif
    342344}
    343345
     
    520522     */
    521523    char *pszFormat;
    522     rc = VDGetFormat(pszImage, &pszFormat);
     524    rc = VDGetFormat(NULL /* pVDIIfsDisk */, pszImage, &pszFormat);
    523525    if (RT_FAILURE(rc))
    524526    {
     
    10031005    if (pInfo->flags & (O_APPEND | O_NONBLOCK | O_SYMLINK | O_NOCTTY | O_SHLOCK | O_EXLOCK | O_ASYNC
    10041006                        | O_CREAT | O_TRUNC | O_EXCL | O_EVTONLY))
     1007        return -EINVAL;
     1008    if ((pInfo->flags & O_ACCMODE) == O_ACCMODE)
     1009        return -EINVAL;
     1010#elif defined(RT_OS_LINUX)
     1011    if (pInfo->flags & (  O_APPEND | O_ASYNC | O_DIRECT /* | O_LARGEFILE ? */
     1012                        | O_NOATIME | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK
     1013                        /* | O_SYNC ? */))
    10051014        return -EINVAL;
    10061015    if ((pInfo->flags & O_ACCMODE) == O_ACCMODE)
     
    11521161    AssertReturn((unsigned)cbBuf == cbBuf, -EINVAL);
    11531162    AssertReturn(offFile >= 0, -EINVAL);
    1154     AssertReturn(offFile + cbBuf >= offFile, -EINVAL);
     1163    AssertReturn(offFile + (ssize_t)cbBuf >= offFile, -EINVAL);
    11551164
    11561165    PVBOXFUSENODE pNode = (PVBOXFUSENODE)(uintptr_t)pInfo->fh;
     
    11681177
    11691178            int rc;
    1170             if (offFile + cbBuf < offFile)
     1179            if (offFile + (ssize_t)cbBuf < offFile)
    11711180                rc = -EINVAL;
    11721181            else if (offFile >= pFlatImage->Node.cbPrimary)
     
    11771186            {
    11781187                /* Adjust for EOF. */
    1179                 if (offFile + cbBuf >= pFlatImage->Node.cbPrimary)
     1188                if (offFile + (ssize_t)cbBuf >= pFlatImage->Node.cbPrimary)
    11801189                    cbBuf = pFlatImage->Node.cbPrimary - offFile;
    11811190
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