From 0f2e45c1ad52262cd0e9393270ab3c584723b0bb Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Fri, 16 May 2025 23:57:44 +0700 Subject: [PATCH] feat(newlib): add dummy implementations for statvfs/fstatvfs --- components/newlib/src/syscalls.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/components/newlib/src/syscalls.c b/components/newlib/src/syscalls.c index 2eb8f5011a..ed5ee9f03a 100644 --- a/components/newlib/src/syscalls.c +++ b/components/newlib/src/syscalls.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,6 +12,10 @@ #include #include +#if CONFIG_IDF_TOOLCHAIN_GCC +#include +#endif + #if CONFIG_LIBC_PICOLIBC int open(const char *pathname, int flags, ...) { @@ -127,6 +131,22 @@ int system(const char* str) return _system_r(__getreent(), str); } +#if CONFIG_IDF_TOOLCHAIN_GCC +int statvfs(const char *restrict path, struct statvfs *restrict buf) +{ + /* TODO IDF-9879 */ + errno = ENOSYS; + return -1; +} + +int fstatvfs(int fd, struct statvfs *buf) +{ + /* TODO IDF-9879 */ + errno = ENOSYS; + return -1; +} +#endif + void esp_libc_include_syscalls_impl(void) { }