examples/userfs: Add truncate() support for userfs
This commit is contained in:
parent
ccee5daaf3
commit
8566a16a82
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user