tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / fseeko.3
blobe0d7c0b764e9d24cedf5c4b8d9063916743f6183
1 '\" t
2 .\" Copyright 2001 Andries Brouwer <aeb@cwi.nl>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH fseeko 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 fseeko, ftello \- seek to or report file position
9 .SH LIBRARY
10 Standard C library
11 .RI ( libc ", " \-lc )
12 .SH SYNOPSIS
13 .nf
14 .B #include <stdio.h>
15 .PP
16 .BI "int fseeko(FILE *" stream ", off_t " offset ", int " whence );
17 .BI "off_t ftello(FILE *" stream );
18 .fi
19 .PP
20 .RS -4
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .RE
24 .PP
25 .BR fseeko (),
26 .BR ftello ():
27 .nf
28     _FILE_OFFSET_BITS == 64 || _POSIX_C_SOURCE >= 200112L
29 .fi
30 .SH DESCRIPTION
31 The
32 .BR fseeko ()
33 and
34 .BR ftello ()
35 functions are identical to
36 .BR fseek (3)
37 and
38 .BR ftell (3)
39 (see
40 .BR fseek (3)),
41 respectively, except that the
42 .I offset
43 argument of
44 .BR fseeko ()
45 and the return value of
46 .BR ftello ()
47 is of type
48 .I off_t
49 instead of
50 .IR long .
51 .PP
52 On some architectures, both
53 .I off_t
54 and
55 .I long
56 are 32-bit types, but defining
57 .B _FILE_OFFSET_BITS
58 with the value 64 (before including
59 .I any
60 header files)
61 will turn
62 .I off_t
63 into a 64-bit type.
64 .SH RETURN VALUE
65 On successful completion,
66 .BR fseeko ()
67 returns 0, while
68 .BR ftello ()
69 returns the current offset.
70 Otherwise, \-1 is returned and
71 .I errno
72 is set to indicate the error.
73 .SH ERRORS
74 See the ERRORS in
75 .BR fseek (3).
76 .SH VERSIONS
77 These functions are available since glibc 2.1.
78 .SH ATTRIBUTES
79 For an explanation of the terms used in this section, see
80 .BR attributes (7).
81 .ad l
82 .nh
83 .TS
84 allbox;
85 lbx lb lb
86 l l l.
87 Interface       Attribute       Value
89 .BR fseeko (),
90 .BR ftello ()
91 T}      Thread safety   MT-Safe
92 .TE
93 .hy
94 .ad
95 .sp 1
96 .SH STANDARDS
97 POSIX.1-2001, POSIX.1-2008, SUSv2.
98 .SH NOTES
99 The declarations of these functions can also be obtained by defining
100 the obsolete
101 .B _LARGEFILE_SOURCE
102 feature test macro.
103 .SH SEE ALSO
104 .BR fseek (3)