diff --git a/interpreters/bas/Kconfig b/interpreters/bas/Kconfig index b19e44d73..ae027d63c 100644 --- a/interpreters/bas/Kconfig +++ b/interpreters/bas/Kconfig @@ -49,4 +49,11 @@ config INTERPRETER_BAS_USE_SELECT bool "Use select()" default n +config INTERPRETER_BAS_HAVE_FTRUNCATE + bool + default n + ---help-- + NuttX does not currently support the ftruncate interface + + endif diff --git a/interpreters/bas/fs.c b/interpreters/bas/fs.c index b34aa1a90..790774543 100644 --- a/interpreters/bas/fs.c +++ b/interpreters/bas/fs.c @@ -813,6 +813,7 @@ int FS_lock(int chn, off_t offset, off_t length, int mode, int w) int FS_truncate(int chn) { +#ifdef CONFIG_INTERPRETER_BAS_HAVE_FTRUNCATE int fd; off_t o; @@ -843,6 +844,10 @@ int FS_truncate(int chn) } return 0; +#else + FS_errmsg = strerror(ENOSYS); + return -1; +#endif } void FS_shellmode(int dev)