BAS: Conditional compile out use of ftruncate()

This commit is contained in:
Gregory Nutt 2014-11-06 13:16:22 -06:00
parent ba51398214
commit 36dbd756ba
2 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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)