VirtualBox

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


Ignore:
Timestamp:
Dec 10, 2010 3:17:31 PM (14 years ago)
Author:
vboxsync
Message:

Added RTLdrLoadEx for exposing dlerror info.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp

    r28800 r34959  
    4141
    4242
    43 int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle)
     43int rtldrNativeLoad(const char *pszFilename, uintptr_t *phHandle, char *pszError, size_t cbError)
    4444{
    4545    /*
     
    6969     * Attempt load.
    7070     */
    71 
    7271    void *pvMod = dlopen(pszFilename, RTLD_NOW | RTLD_LOCAL);
    7372    if (pvMod)
     
    7675        return VINF_SUCCESS;
    7776    }
    78     LogRel(("rtldrNativeLoad: dlopen('%s', RTLD_NOW | RTLD_LOCAL) failed: %s\n", pszFilename, dlerror()));
     77
     78    const char *pszDlError = dlerror();
     79    if (pszError)
     80        RTStrCopy(pszError, cbError, pszDlError);
     81    LogRel(("rtldrNativeLoad: dlopen('%s', RTLD_NOW | RTLD_LOCAL) failed: %s\n", pszFilename, pszDlError));
    7982    return VERR_FILE_NOT_FOUND;
    8083}
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