diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-05-11 00:26:15 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-05-11 00:26:15 +0000 |
commit | a4f07581502ee212aa45e7b0049fdd126dd10b40 (patch) | |
tree | 935a2f668e5fb5306e0e12f380924d2311da5ee5 /libc/misc/dirent/telldir.c | |
parent | d2be3a1d010ea7e953d15a2e705373735723c06e (diff) |
Implement readdir_r. Audit for proper thread safety and locking.
-Erik
Diffstat (limited to 'libc/misc/dirent/telldir.c')
-rw-r--r-- | libc/misc/dirent/telldir.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libc/misc/dirent/telldir.c b/libc/misc/dirent/telldir.c index 8c13a9c23..124030431 100644 --- a/libc/misc/dirent/telldir.c +++ b/libc/misc/dirent/telldir.c @@ -6,31 +6,11 @@ long int telldir(DIR * dir) { - off_t offset; - if (!dir) { __set_errno(EBADF); return -1; } - switch (dir->dd_getdents) { - case no_getdents: - /* We are running the old kernel. This is the starting offset - of the next readdir(). */ - offset = lseek(dir->dd_fd, 0, SEEK_CUR); - break; - - case unknown: - /* readdir () is not called yet. but seekdir () may be called. */ - case have_getdents: - /* The next entry. */ - offset = dir->dd_nextoff; - break; - - default: - __set_errno(EBADF); - offset = -1; - } - - return offset; + /* The next entry. */ + return dir->dd_nextoff; } |