|
|
@ -245,6 +245,7 @@ LOCAL int lfsFuncIoctl(LFS_FILE_DESC *pfd, int cmd, _Vx_ioctl_arg_t arg) |
|
|
|
int ret = OK; |
|
|
|
const char *name; |
|
|
|
DIR *dirp; |
|
|
|
size_t offset; |
|
|
|
struct lfs_info info; |
|
|
|
lfsDrvCtrl *pDrvCtrl = pfd->ctrl; |
|
|
|
|
|
|
@ -282,6 +283,15 @@ LOCAL int lfsFuncIoctl(LFS_FILE_DESC *pfd, int cmd, _Vx_ioctl_arg_t arg) |
|
|
|
strncpy(dirp->dd_dirent.d_name, info.name, _PARM_NAME_MAX + 1); |
|
|
|
dirp->dd_dirent.d_name[_PARM_NAME_MAX - 1] = EOS; |
|
|
|
break; |
|
|
|
case FIOSEEK: |
|
|
|
if (pfd->isDir) { |
|
|
|
errnoSet(EINVAL); |
|
|
|
ret = ERROR; |
|
|
|
break; |
|
|
|
} |
|
|
|
offset = (size_t)arg; |
|
|
|
lfs_file_seek(&pDrvCtrl->fsh, &pfd->u.file, offset, LFS_SEEK_SET); |
|
|
|
break; |
|
|
|
case FIOUNLINK: |
|
|
|
name = (const char *)arg; |
|
|
|
ret = lfs_remove(&pDrvCtrl->fsh, name); |
|
|
@ -290,8 +300,8 @@ LOCAL int lfsFuncIoctl(LFS_FILE_DESC *pfd, int cmd, _Vx_ioctl_arg_t arg) |
|
|
|
ret = OK; |
|
|
|
break; |
|
|
|
default: |
|
|
|
printf("unsupport ioctl: %d\n", cmd); |
|
|
|
errnoSet(EINVAL); |
|
|
|
printf("lfs unsupport ioctl: %d\n", cmd); |
|
|
|
errnoSet(ENOTSUP); |
|
|
|
ret = ERROR; |
|
|
|
break; |
|
|
|
} |
|
|
@ -355,7 +365,7 @@ LOCAL int lfsFlashProg(const struct lfs_config *cfg, lfs_block_t block, lfs_off_ |
|
|
|
lfsDrvCtrl *pDrvCtrl = cfg->context; |
|
|
|
UINT8 *buffers[2]; |
|
|
|
|
|
|
|
buffers[0] = buffer; |
|
|
|
buffers[0] = (void *)buffer; |
|
|
|
buffers[1] = NULL; |
|
|
|
pos = pDrvCtrl->flashOffset + block * cfg->block_size + off; |
|
|
|
|
|
|
|