mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
committed by
Chris Johns
parent
1a304307a2
commit
a2a9751823
@@ -18,6 +18,7 @@
|
||||
#include <stdint.h>
|
||||
#include <dlfcn.h>
|
||||
#include <rtems/rtl/rtl.h>
|
||||
#include "rtl-error.h"
|
||||
|
||||
static rtems_rtl_obj_t*
|
||||
dl_get_obj_from_handle (void* handle)
|
||||
@@ -130,6 +131,7 @@ dlerror (void)
|
||||
{
|
||||
static char msg[64];
|
||||
rtems_rtl_get_error (msg, sizeof (msg));
|
||||
rtems_rtl_clear_error ();
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,3 +52,15 @@ rtems_rtl_get_error (char* message, size_t max_message)
|
||||
|
||||
return EIO;
|
||||
}
|
||||
|
||||
void
|
||||
rtems_rtl_clear_error (void)
|
||||
{
|
||||
rtems_rtl_data_t* rtl = rtems_rtl_lock ();
|
||||
if (rtl != NULL)
|
||||
{
|
||||
rtl->last_errno = 0;
|
||||
rtl->last_error[0] = '\0';
|
||||
rtems_rtl_unlock ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,11 @@ extern "C" {
|
||||
*/
|
||||
void rtems_rtl_set_error (int error, const char* format, ...) RTEMS_RTL_PRINTF_ATTR;
|
||||
|
||||
/**
|
||||
* Clears the error.
|
||||
*/
|
||||
void rtems_rtl_clear_error (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in New Issue
Block a user