newlib: add definitions of system, raise
Closes IDF-1220 Closes IDFGH-1811 Closes https://github.com/espressif/esp-idf/pull/4020
This commit is contained in:
parent
20742db676
commit
08286ac20f
2 changed files with 16 additions and 0 deletions
|
@ -21,12 +21,23 @@
|
|||
#include <sys/reent.h>
|
||||
|
||||
|
||||
int system(const char* str)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int _system_r(struct _reent *r, const char *str)
|
||||
{
|
||||
__errno_r(r) = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int raise(int sig)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
int _raise_r(struct _reent *r, int sig)
|
||||
{
|
||||
abort();
|
||||
|
|
|
@ -182,3 +182,8 @@ TEST_CASE("fmod and fmodf work as expected", "[newlib]")
|
|||
TEST_ASSERT_EQUAL(0.1, fmod(10.1, 2.0));
|
||||
TEST_ASSERT_EQUAL(0.1f, fmodf(10.1f, 2.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("newlib: can link 'system', 'raise'", "[newlib]")
|
||||
{
|
||||
printf("system: %p, raise: %p\n", &system, &raise);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue