Skip to content

Commit 0f2e45c

Browse files
committed
feat(newlib): add dummy implementations for statvfs/fstatvfs
1 parent fdb4212 commit 0f2e45c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

components/newlib/src/syscalls.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -12,6 +12,10 @@
1212
#include <sys/time.h>
1313
#include <sys/stat.h>
1414

15+
#if CONFIG_IDF_TOOLCHAIN_GCC
16+
#include <sys/statvfs.h>
17+
#endif
18+
1519
#if CONFIG_LIBC_PICOLIBC
1620
int open(const char *pathname, int flags, ...)
1721
{
@@ -127,6 +131,22 @@ int system(const char* str)
127131
return _system_r(__getreent(), str);
128132
}
129133

134+
#if CONFIG_IDF_TOOLCHAIN_GCC
135+
int statvfs(const char *restrict path, struct statvfs *restrict buf)
136+
{
137+
/* TODO IDF-9879 */
138+
errno = ENOSYS;
139+
return -1;
140+
}
141+
142+
int fstatvfs(int fd, struct statvfs *buf)
143+
{
144+
/* TODO IDF-9879 */
145+
errno = ENOSYS;
146+
return -1;
147+
}
148+
#endif
149+
130150
void esp_libc_include_syscalls_impl(void)
131151
{
132152
}

0 commit comments

Comments
 (0)