1seekdir(3)                 Library Functions Manual                 seekdir(3)
2
3
4

NAME

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

LIBRARY

10       Standard C library (libc, -lc)
11

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

30       The seekdir() function returns no value.
31

ATTRIBUTES

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

STANDARDS

43       POSIX.1-2008.
44

HISTORY

46       POSIX.1-2001, 4.3BSD.
47

CAVEATS

49       Up   to   glibc  2.1.1,  the  type  of  the  loc  argument  was  off_t.
50       POSIX.1-2001 specifies long, and this is  the  type  used  since  glibc
51       2.1.2.   See telldir(3) for information on why you should be careful in
52       making any assumptions about the value in this argument.
53

SEE ALSO

55       lseek(2),  closedir(3),  opendir(3),  readdir(3),  rewinddir(3),  scan‐
56       dir(3), telldir(3)
57
58
59
60Linux man-pages 6.04              2023-03-30                        seekdir(3)
Impressum