Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision fcab7ef52ce87f4e12983237693d25d80bdb4fd7)
+++ uspace/lib/c/generic/io/io.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -41,5 +41,4 @@
 #include <stdbool.h>
 #include <malloc.h>
-#include <sys/stat.h>
 #include <async.h>
 #include <io/kio.h>
@@ -765,4 +764,6 @@
 int fseek(FILE *stream, off64_t offset, int whence)
 {
+	int rc;
+
 	if (stream->error)
 		return -1;
@@ -785,6 +786,7 @@
 		break;
 	case SEEK_END:
-		if (fstat(stream->fd, &st) != EOK) {
-			/* errno was set by fstat() */
+		rc = vfs_stat(stream->fd, &st);
+		if (rc != EOK) {
+			errno = rc;
 			stream->error = true;
 			return -1;	
