Index: uspace/lib/libc/generic/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs.c	(revision 4db6eaf06a371efbb5d1f20919cbf3e224a20036)
+++ uspace/lib/libc/generic/vfs.c	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2007 Jakub Jermar 
+ * Copyright (c) 2008 Jakub Jermar 
  * All rights reserved.
  *
@@ -185,4 +185,34 @@
 	return (ssize_t) IPC_GET_ARG1(answer);
 }
+
+off_t lseek(int fildes, off_t offset, int whence)
+{
+	int res;
+	ipcarg_t rc;
+
+	futex_down(&vfs_phone_futex);
+	async_serialize_start();
+	if (vfs_phone < 0) {
+		res = vfs_connect();
+		if (res < 0) {
+			async_serialize_end();
+			futex_up(&vfs_phone_futex);
+			return res;
+		}
+	}
+		
+	off_t newoffs;
+	rc = async_req_3_1(vfs_phone, VFS_SEEK, fildes, offset, whence,
+	    &newoffs);
+
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+
+	if (rc != EOK)
+		return (off_t) -1;
+	
+	return newoffs;
+}
+
 /** @}
  */
Index: uspace/lib/libc/include/unistd.h
===================================================================
--- uspace/lib/libc/include/unistd.h	(revision 4db6eaf06a371efbb5d1f20919cbf3e224a20036)
+++ uspace/lib/libc/include/unistd.h	(revision 752ccee70526f37f204304e646f75b26bdfe2b07)
@@ -42,6 +42,12 @@
 #define getpagesize()     (PAGE_SIZE)
 
+#define SEEK_SET	0
+#define SEEK_CUR	1
+#define SEEK_END	2
+
 extern ssize_t write(int fd, const void * buf, size_t count);
 extern ssize_t read(int fd, void * buf, size_t count);
+extern off_t lseek(int, off_t, int);
+
 extern void _exit(int status);
 extern void *sbrk(ssize_t incr);
