]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/seekdir.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / seekdir.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\" 386BSD man pages
29 .\" Modified Sat Jul 24 18:25:21 1993 by Rik Faith (faith@cs.unc.edu)
30 .\"
31 .TH SEEKDIR 3 2016-03-15 "" "Linux Programmer's Manual"
32 .SH NAME
33 seekdir \- set the position of the next readdir() call in the directory
34 stream.
35 .SH SYNOPSIS
36 .nf
37 .B #include <dirent.h>
38 .PP
39 .BI "void seekdir(DIR *" dirp ", long " loc );
40 .fi
41 .PP
42 .in -4n
43 Feature Test Macro Requirements for glibc (see
44 .BR feature_test_macros (7)):
45 .in
46 .PP
47 .BR seekdir ():
48 _XOPEN_SOURCE
49 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
50 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
51 .SH DESCRIPTION
52 The
53 .BR seekdir ()
54 function sets the location in the directory stream
55 from which the next
56 .BR readdir (2)
57 call will start.
58 The
59 .I loc
60 argument should be a value returned by a previous call to
61 .BR telldir (3).
62 .SH RETURN VALUE
63 The
64 .BR seekdir ()
65 function returns no value.
66 .SH ATTRIBUTES
67 For an explanation of the terms used in this section, see
68 .BR attributes (7).
69 .TS
70 allbox;
71 lb lb lb
72 l l l.
73 Interface Attribute Value
74 T{
75 .BR seekdir ()
76 T} Thread safety MT-Safe
77 .TE
78 .SH CONFORMING TO
79 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
80 .SH NOTES
81 In glibc up to version 2.1.1, the type of the
82 .I loc
83 argument was
84 .IR off_t .
85 POSIX.1-2001 specifies
86 .IR long ,
87 and this is the type used since glibc 2.1.2.
88 See
89 .BR telldir (3)
90 for information on why you should be careful in making any
91 assumptions about the value in this argument.
92 .SH SEE ALSO
93 .BR lseek (2),
94 .BR closedir (3),
95 .BR opendir (3),
96 .BR readdir (3),
97 .BR rewinddir (3),
98 .BR scandir (3),
99 .BR telldir (3)