share/mk/: Fix includes
[man-pages.git] / man3 / seekdir.3
blobceb5850b2e388ee246599b520049eeb84c6f4988
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\"     Linux libc source code
8 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\"     386BSD man pages
10 .\" Modified Sat Jul 24 18:25:21 1993 by Rik Faith (faith@cs.unc.edu)
11 .\"
12 .TH seekdir 3 (date) "Linux man-pages (unreleased)"
13 .SH NAME
14 seekdir \- set the position of the next readdir() call in the directory
15 stream.
16 .SH LIBRARY
17 Standard C library
18 .RI ( libc ", " \-lc )
19 .SH SYNOPSIS
20 .nf
21 .B #include <dirent.h>
23 .BI "void seekdir(DIR *" dirp ", long " loc );
24 .fi
26 .RS -4
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
29 .RE
31 .BR seekdir ():
32 .nf
33     _XOPEN_SOURCE
34         || /* glibc >= 2.19: */ _DEFAULT_SOURCE
35         || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
36 .fi
37 .SH DESCRIPTION
38 The
39 .BR seekdir ()
40 function sets the location in the directory stream
41 from which the next
42 .BR readdir (2)
43 call will start.
44 The
45 .I loc
46 argument should be a value returned by a previous call to
47 .BR telldir (3).
48 .SH RETURN VALUE
49 The
50 .BR seekdir ()
51 function returns no value.
52 .SH ATTRIBUTES
53 For an explanation of the terms used in this section, see
54 .BR attributes (7).
55 .TS
56 allbox;
57 lbx lb lb
58 l l l.
59 Interface       Attribute       Value
61 .na
62 .nh
63 .BR seekdir ()
64 T}      Thread safety   MT-Safe
65 .TE
66 .SH STANDARDS
67 POSIX.1-2008.
68 .SH HISTORY
69 POSIX.1-2001, 4.3BSD.
70 .SH CAVEATS
71 Up to glibc 2.1.1, the type of the
72 .I loc
73 argument was
74 .IR off_t .
75 POSIX.1-2001 specifies
76 .IR long ,
77 and this is the type used since glibc 2.1.2.
78 See
79 .BR telldir (3)
80 for information on why you should be careful in making any
81 assumptions about the value in this argument.
82 .SH SEE ALSO
83 .BR lseek (2),
84 .BR closedir (3),
85 .BR opendir (3),
86 .BR readdir (3),
87 .BR rewinddir (3),
88 .BR scandir (3),
89 .BR telldir (3)