Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision 17c1427397e6ec84fdd0ce49eddfd8c5ffb03b62)
+++ uspace/lib/c/generic/io/io.c	(revision 04552d8e069bc8f1a0bd6e07f5414ab3f54e038a)
@@ -799,5 +799,5 @@
 }
 
-int fseek(FILE *stream, long offset, int whence)
+int fseek64(FILE *stream, off64_t offset, int whence)
 {
 	errno_t rc;
@@ -837,10 +837,6 @@
 }
 
-long ftell(FILE *stream)
-{
-	/* The native position is too large for the C99-ish interface. */
-	if (stream->pos - stream->ungetc_chars > LONG_MAX)
-		return EOF;
-
+off64_t ftell64(FILE *stream)
+{
 	if (stream->error)
 		return EOF;
@@ -853,4 +849,20 @@
 
 	return stream->pos - stream->ungetc_chars;
+}
+
+int fseek(FILE *stream, long offset, int whence)
+{
+	return fseek64(stream, offset, whence);
+}
+
+long ftell(FILE *stream)
+{
+	off64_t off = ftell64(stream);
+
+	/* The native position is too large for the C99-ish interface. */
+	if (off > LONG_MAX)
+		return EOF;
+
+	return off;
 }
 
