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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms