Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision a6fc88aa460096502eae43ccce7f29d4eed95e58)
+++ uspace/lib/c/generic/io/io.c	(revision 59f388a67f9319d79d123a42feecf8a6efba764e)
@@ -834,4 +834,8 @@
 off64_t ftell(FILE *stream)
 {
+	/* The native position is too large for the C99-ish interface. */
+	if (stream->pos - stream->ungetc_chars > INT64_MAX)
+		return EOF;
+
 	if (stream->error)
 		return EOF;
