2018-07-19 08:42:12 +01:00
|
|
|
#include "devoptab_fs.h"
|
2018-05-27 12:11:45 +01:00
|
|
|
|
|
|
|
int
|
|
|
|
__wut_fs_dirreset(struct _reent *r,
|
|
|
|
DIR_ITER *dirState)
|
|
|
|
{
|
2018-10-06 10:41:24 +01:00
|
|
|
FSStatus status;
|
|
|
|
FSCmdBlock cmd;
|
|
|
|
__wut_fs_dir_t *dir;
|
2018-05-27 12:11:45 +01:00
|
|
|
|
2018-10-06 10:41:24 +01:00
|
|
|
if (!dirState) {
|
|
|
|
r->_errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
2018-05-27 12:11:45 +01:00
|
|
|
|
2018-10-06 10:41:24 +01:00
|
|
|
FSInitCmdBlock(&cmd);
|
|
|
|
dir = (__wut_fs_dir_t *)(dirState->dirStruct);
|
2020-12-29 09:37:32 +01:00
|
|
|
status = FSRewindDir(__wut_devoptab_fs_client, &cmd, dir->fd, FS_ERROR_FLAG_ALL);
|
2018-10-06 10:41:24 +01:00
|
|
|
if (status < 0) {
|
|
|
|
r->_errno = __wut_fs_translate_error(status);
|
|
|
|
return -1;
|
2018-05-27 12:11:45 +01:00
|
|
|
}
|
|
|
|
|
2018-10-06 10:41:24 +01:00
|
|
|
return 0;
|
2018-05-27 12:11:45 +01:00
|
|
|
}
|