VirtualBox

Changeset 40305 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Feb 29, 2012 9:34:36 PM (13 years ago)
Author:
vboxsync
Message:

IPRT: Fixed unresolved symbols on OS/2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-heap-posix.cpp

    r39083 r40305  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4848# define MAP_ANONYMOUS MAP_ANON
    4949#endif
    50 
    5150
    5251
     
    145144static RTHEAPPAGE   g_MemExecPosixHeap;
    146145
     146
     147#ifdef RT_OS_OS2
     148/*
     149 * A quick mmap/munmap mockup for avoid duplicating lots of good code.
     150 */
     151# define INCL_BASE
     152# include <os2.h>
     153# define MAP_PRIVATE    0
     154# define MAP_ANONYMOUS  0
     155# define MAP_FAILED  (void *)-1
     156
     157static void *mmap(void *pvWhere, size_t cb, int fProt, int fFlags, int fd, off_t off)
     158{
     159    NOREF(pvWhere); NOREF(fd); NOREF(off);
     160    void   *pv    = NULL;
     161    ULONG  fAlloc = OBJ_ANY | PAG_COMMIT;
     162    if (fProt & PROT_EXEC)
     163        fAlloc |= PAG_EXECUTE;
     164    if (fProt & PROT_READ)
     165        fAlloc |= PAG_READ;
     166    if (fProt & PROT_WRITE)
     167        fAlloc |= PAG_WRITE;
     168    APIRET rc = DosAllocMem(&pv, cb, fAlloc);
     169    if (rc == NO_ERROR)
     170        return pv;
     171    errno = ENOMEM;
     172    return MAP_FAILED;
     173}
     174
     175static int munmap(void *pv, size_t cb)
     176{
     177    APIRET rc = DosFreeMem(pv);
     178    if (rc == NO_ERROR)
     179        return 0;
     180    errno = EINVAL;
     181    return -1;
     182}
     183
     184#endif
    147185
    148186/**
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