diff --git a/components/newlib/syscalls.c b/components/newlib/syscalls.c index c3da628da6..56a12293d9 100644 --- a/components/newlib/syscalls.c +++ b/components/newlib/syscalls.c @@ -21,12 +21,23 @@ #include +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(); diff --git a/components/newlib/test/test_newlib.c b/components/newlib/test/test_newlib.c index 41f72329bf..4cfec3e40b 100644 --- a/components/newlib/test/test_newlib.c +++ b/components/newlib/test/test_newlib.c @@ -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); +}