From 8566a16a82a595d1ea68369bedaf67ac3adee52b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 3 Jan 2018 16:01:40 -0600 Subject: [PATCH] examples/userfs: Add truncate() support for userfs --- examples/userfs/userfs_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/userfs/userfs_main.c b/examples/userfs/userfs_main.c index 12d840a96..ed4bd1ad1 100644 --- a/examples/userfs/userfs_main.c +++ b/examples/userfs/userfs_main.c @@ -114,6 +114,8 @@ static int ufstest_dup(FAR void *volinfo, FAR void *oldinfo, FAR void **newinfo); static int ufstest_fstat(FAR void *volinfo, FAR void *openinfo, FAR struct stat *buf); +static int ufstest_truncate(FAR void *volinfo, FAR void *openinfo, + off_t *length); static int ufstest_opendir(FAR void *volinfo, FAR const char *relpath, FAR void **dir); static int ufstest_closedir(FAR void *volinfo, FAR void *dir); @@ -177,6 +179,7 @@ static const struct userfs_operations_s g_ufstest_ops = ufstest_sync, ufstest_dup, ufstest_fstat, + ufstest_truncate, ufstest_opendir, ufstest_closedir, ufstest_readdir, @@ -416,6 +419,12 @@ static int ufstest_fstat(FAR void *volinfo, FAR void *openinfo, return OK; } +static int ufstest_truncate(FAR void *volinfo, FAR void *openinfo, + off_t *length) +{ + return -ENOSYS; +} + static int ufstest_opendir(FAR void *volinfo, FAR const char *relpath, FAR void **dir) {