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

Function telldir

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

* this function is a POSIX compliant version, which will return current * location in directory stream. * * @param d the directory stream pointer. * * @return the current location in directory stream. */

Source from the content-addressed store, hash-verified

806 * @return the current location in directory stream.
807 */
808long telldir(DIR *d)
809{
810 struct dfs_file *fd;
811 long result;
812
813 fd = fd_get(d->fd);
814 if (fd == NULL)
815 {
816 rt_set_errno(-EBADF);
817
818 return 0;
819 }
820
821 result = fd->pos - d->num + d->cur;
822
823 return result;
824}
825RTM_EXPORT(telldir);
826
827/**

Callers 2

libc_direntFunction · 0.50
seekdir_testFunction · 0.50

Calls 2

rt_set_errnoFunction · 0.85
fd_getFunction · 0.70

Tested by

no test coverage detected