fseeko(3)
π fseeko(3) β the library functions manual, but make it cute π
okay bestie, welcome to fseeko and ftello, aka the library functions manual page for seeking to or reporting file position. yes we're in the Library Functions Manual section, section 3, we're fancy like that π
β¨ NAME β¨
fseeko, ftello β seek to or report file position π―
π LIBRARY π
Standard C library (libc, -lc) β she's a classic, she's been here, she's not going anywhere π
π«Ά SYNOPSIS π«Ά
#include <stdio.h>
int fseeko(FILE *stream, off_t offset, int whence);
off_t ftello(FILE *stream);
πΈ Feature Test Macro Requirements for glibc (see feature_test_macros(7)) πΈ
fseeko(), ftello():
_FILE_OFFSET_BITS == 64 || _POSIX_C_SOURCE >= 200112L
(genuinely, go peep feature_test_macros(7) if you need the whole lore drop π)
π« DESCRIPTION π«
so here's the tea, bestie β β fseeko() and ftello() are literally identical to fseek(3) and ftell(3) respectively (go read fseek(3), it's the whole vibe). the ONE difference? the offset argument of fseeko() and the return value of ftello() are of type off_t, not long. that's it. that's the glow-up. β¨
ngl this matters on some architectures where both off_t and long are 32-bit types β but if you define _FILE_OFFSET_BITS with the value 64 (and you do this before including any header files, no skipsies π), then off_t becomes a 64-bit type. huge. iconic. main character energy for your file offsets π
π RETURN VALUE π
when she's serving successfully, fseeko() returns 0, while ftello() returns the current offset π
otherwise? -1 is returned and errno is set to indicate the error. so like, check it, don't ignore it π
π ERRORS π
see the ERRORS section in fseek(3). that's where the drama lives, go look π₯
β ATTRIBUTES β
for an explanation of the terms used in this section, see attributes(7).
fseeko(),ftello()β Thread safety: MT-Safe π§΅β
π STANDARDS π
POSIX.1-2008. periodt π
π¦ HISTORY π¦
glibc 2.1. Also POSIX.1-2001 and SUSv2 β she's got receipts going all the way back π
π NOTES π
fun little easter egg: the declarations of these functions can also be obtained by defining the obsolete _LARGEFILE_SOURCE feature test macro. (obsolete!! it's giving vintage, not in the cute way π)
π SEE ALSO π
fseek(3)β go read her, she's the blueprint π
and that's the whole manual page, bestie!! πβ¨ this one came to you from the Linux man-pages 6.20, dated 2026-02-08, and it's filed right here under fseeko(3) π«Ά mwah, go seek responsibly π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2001, Andries E. Brouwer <aeb@cwi.nl>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms