libs/libc/dllfcn: Implement dlerror using strerror.

This commit is contained in:
Xiang Xiao 2019-01-26 11:39:05 -06:00 committed by Gregory Nutt
parent b7f958a02e
commit 9e2238f6cd
4 changed files with 7 additions and 6 deletions

View File

@ -39,7 +39,9 @@
#include <nuttx/config.h>
#include <errno.h>
#include <dllfcn.h>
#include <string.h>
/****************************************************************************
* Public Functions
@ -68,6 +70,5 @@
FAR char *dlerror(void)
{
#warning Missing logic
return NULL;
return (FAR char *)strerror(errno);
}

View File

@ -101,12 +101,12 @@ static inline FAR const void *dlgetsym(FAR void *handle,
modp->modinfo.nexports);
if (symbol == NULL)
{
serr("ERROR: Failed to find symbol in symbol \"$s\" in table\n", name);
serr("ERROR: Failed to find symbol in symbol \"%s\" in table\n", name);
err = ENOENT;
goto errout_with_lock;
}
/* Return the address within the module assoicated with the symbol */
/* Return the address within the module associated with the symbol */
modlib_registry_unlock();
DEBUGASSERT(symbol->sym_value != NULL);

View File

@ -54,7 +54,7 @@
*
* Description:
* dlsymtab() is a non-standard shared library interface. It selects the
* symbol table to use when binding a shared libary to the base firmware
* symbol table to use when binding a shared library to the base firmware
* which may be in FLASH memory.
*
* Input Parameters:

View File

@ -118,7 +118,7 @@ FAR const void *modsym(FAR void *handle, FAR const char *name)
goto errout_with_lock;
}
/* Return the address within the module assoicated with the symbol */
/* Return the address within the module associated with the symbol */
modlib_registry_unlock();
DEBUGASSERT(symbol->sym_value != NULL);