1SEEKDIR(3)                 Linux Programmer's Manual                SEEKDIR(3)
2
3
4

NAME

6       seekdir  - set the position of the next readdir() call in the directory
7       stream.
8

SYNOPSIS

10       #include <dirent.h>
11
12       void seekdir(DIR *dirp, long loc);
13
14   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
15
16       seekdir():
17           _XOPEN_SOURCE
18               || /* Glibc since 2.19: */ _DEFAULT_SOURCE
19               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
20

DESCRIPTION

22       The seekdir() function sets the location in the directory  stream  from
23       which  the next readdir(2) call will start.  The loc argument should be
24       a value returned by a previous call to telldir(3).
25

RETURN VALUE

27       The seekdir() function returns no value.
28

ATTRIBUTES

30       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
31       tributes(7).
32
33       ┌────────────────────────────────────────────┬───────────────┬─────────┐
34Interface                                   Attribute     Value   
35       ├────────────────────────────────────────────┼───────────────┼─────────┤
36seekdir()                                   │ Thread safety │ MT-Safe │
37       └────────────────────────────────────────────┴───────────────┴─────────┘
38

CONFORMING TO

40       POSIX.1-2001, POSIX.1-2008, 4.3BSD.
41

NOTES

43       In  glibc  up to version 2.1.1, the type of the loc argument was off_t.
44       POSIX.1-2001 specifies long, and this is  the  type  used  since  glibc
45       2.1.2.   See telldir(3) for information on why you should be careful in
46       making any assumptions about the value in this argument.
47

SEE ALSO

49       lseek(2),  closedir(3),  opendir(3),  readdir(3),  rewinddir(3),  scan‐
50       dir(3), telldir(3)
51

COLOPHON

53       This  page  is  part of release 5.13 of the Linux man-pages project.  A
54       description of the project, information about reporting bugs,  and  the
55       latest     version     of     this    page,    can    be    found    at
56       https://www.kernel.org/doc/man-pages/.
57
58
59
60                                  2021-03-22                        SEEKDIR(3)
Impressum