lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> |
| 3 | * |
| 4 | * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. |
| 5 | */ |
| 6 | |
| 7 | #include <dirent.h> |
| 8 | #include <errno.h> |
| 9 | #include <unistd.h> |
| 10 | #include "dirstream.h" |
| 11 | |
| 12 | |
| 13 | void seekdir(DIR * dir, long int offset) |
| 14 | { |
| 15 | if (!dir) { |
| 16 | __set_errno(EBADF); |
| 17 | return; |
| 18 | } |
| 19 | __UCLIBC_MUTEX_LOCK(dir->dd_lock); |
| 20 | dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET); |
| 21 | dir->dd_size = dir->dd_nextloc = 0; |
| 22 | __UCLIBC_MUTEX_UNLOCK(dir->dd_lock); |
| 23 | } |