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