MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / seekdir

Function seekdir

components/dfs/dfs_v1/src/dfs_posix.c:834–849  ·  view source on GitHub ↗

* this function is a POSIX compliant version, which will set position of * next directory structure in the directory stream. * * @param d the directory stream. * @param offset the offset in directory stream. */

Source from the content-addressed store, hash-verified

832 * @param offset the offset in directory stream.
833 */
834void seekdir(DIR *d, long offset)
835{
836 struct dfs_file *fd;
837
838 fd = fd_get(d->fd);
839 if (fd == NULL)
840 {
841 rt_set_errno(-EBADF);
842
843 return ;
844 }
845
846 /* seek to the offset position of directory */
847 if (dfs_file_lseek(fd, offset) >= 0)
848 d->num = d->cur = 0;
849}
850RTM_EXPORT(seekdir);
851
852/**

Callers 2

libc_direntFunction · 0.50
seekdir_testFunction · 0.50

Calls 3

rt_set_errnoFunction · 0.85
fd_getFunction · 0.70
dfs_file_lseekFunction · 0.70

Tested by

no test coverage detected