fatfs: Add ftruncate api support for VFS and FAT-VFS

Unit test cases added to verify ftruncate within fatfs tests.

Closes https://github.com/espressif/esp-idf/issues/8279
This commit is contained in:
Vamshi Gajjela
2022-03-08 00:01:48 +05:30
committed by BOT
parent 8efd164e7f
commit ebb9cc3670
6 changed files with 162 additions and 13 deletions

View File

@@ -195,6 +195,10 @@ typedef struct
int (*truncate_p)(void* ctx, const char *path, off_t length); /*!< truncate with context pointer */
int (*truncate)(const char *path, off_t length); /*!< truncate without context pointer */
};
union {
int (*ftruncate_p)(void* ctx, int fd, off_t length); /*!< ftruncate with context pointer */
int (*ftruncate)(int fd, off_t length); /*!< ftruncate without context pointer */
};
union {
int (*utime_p)(void* ctx, const char *path, const struct utimbuf *times); /*!< utime with context pointer */
int (*utime)(const char *path, const struct utimbuf *times); /*!< utime without context pointer */