Debian Codegraph @

upstream/debian-trixie/man3/fseeko.3

raw
1 '\" t
2 .\" Copyright 2001 Andries Brouwer <[email protected]>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH fseeko 3 2024-05-02 "Linux man-pages 6.9.1"
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 .P
16 .BI "int fseeko(FILE *" stream ", off_t " offset ", int " whence );
17 .BI "off_t ftello(FILE *" stream );
18 .fi
19 .P
20 .RS -4
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .RE
24 .P
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 .P
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 ATTRIBUTES
77 For an explanation of the terms used in this section, see
78 .BR attributes (7).
79 .TS
80 allbox;
81 lbx lb lb
82 l l l.
83 Interface Attribute Value
84 T{
85 .na
86 .nh
87 .BR fseeko (),
88 .BR ftello ()
89 T} Thread safety MT-Safe
90 .TE
91 .SH STANDARDS
92 POSIX.1-2008.
93 .SH HISTORY
94 glibc 2.1.
95 POSIX.1-2001, SUSv2.
96 .SH NOTES
97 The declarations of these functions can also be obtained by defining
98 the obsolete
99 .B _LARGEFILE_SOURCE
100 feature test macro.
101 .SH SEE ALSO
102 .BR fseek (3)