Index: uspace/lib/libc/Makefile
===================================================================
--- uspace/lib/libc/Makefile	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/Makefile	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -33,7 +33,7 @@
 all: ../../../Makefile.config ../../../config.h ../../../config.defs
 	-[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
-	$(MAKE) -f Makefile.build
+	$(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
 
 clean:
-	rm -f $(DEPEND) $(DEPEND_PREV) $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LIBC) arch/*/_link.ld
+	rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(LIBC) arch/*/_link.ld
 	find generic/ arch/*/ -name '*.o' -follow -exec rm \{\} \;
Index: uspace/lib/libc/Makefile.build
===================================================================
--- uspace/lib/libc/Makefile.build	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/Makefile.build	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -112,10 +112,19 @@
 %.o: %.S $(DEPEND)
 	$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
+ifeq ($(PRECHECK),y)
+	$(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__
+endif
 
 %.o: %.s $(DEPEND)
 	$(AS) $(AFLAGS) $< -o $@
+ifeq ($(PRECHECK),y)
+	$(JOBFILE) $(JOB) $< $@ as asm $(AFLAGS)
+endif
 
 %.o: %.c $(DEPEND)
 	$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
+ifeq ($(PRECHECK),y)
+	$(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)
+endif
 
 $(DEPEND): $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH)
Index: uspace/lib/libc/Makefile.common
===================================================================
--- uspace/lib/libc/Makefile.common	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/Makefile.common	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -33,4 +33,5 @@
 DEPEND = Makefile.depend
 DEPEND_PREV = $(DEPEND).prev
+JOB = libc.job
 LIBC = libc.a
 INCLUDE_KERNEL = include/kernel
Index: uspace/lib/libc/Makefile.toolchain
===================================================================
--- uspace/lib/libc/Makefile.toolchain	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/Makefile.toolchain	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -78,4 +78,6 @@
 #
 
+JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
+
 ifeq ($(COMPILER),gcc_cross)
 	CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
Index: uspace/lib/libc/generic/io/io.c
===================================================================
--- uspace/lib/libc/generic/io/io.c	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/generic/io/io.c	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -554,4 +554,15 @@
 }
 
+int ftell(FILE *stream)
+{
+	off_t rc = lseek(stream->fd, 0, SEEK_CUR);
+	if (rc == (off_t) (-1)) {
+		/* errno has been set by lseek. */
+		return -1;
+	}
+
+	return rc;
+}
+
 void rewind(FILE *stream)
 {
@@ -584,4 +595,10 @@
 }
 
+void clearerr(FILE *stream)
+{
+	stream->eof = false;
+	stream->error = false;
+}
+
 int fphone(FILE *stream)
 {
Index: uspace/lib/libc/include/ipc/bd.h
===================================================================
--- uspace/lib/libc/include/ipc/bd.h	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/include/ipc/bd.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -40,4 +40,5 @@
 typedef enum {
 	BD_GET_BLOCK_SIZE = IPC_FIRST_USER_METHOD,
+	BD_GET_NUM_BLOCKS,
 	BD_READ_BLOCKS,
 	BD_WRITE_BLOCKS
Index: uspace/lib/libc/include/ipc/char.h
===================================================================
--- uspace/lib/libc/include/ipc/char.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
+++ uspace/lib/libc/include/ipc/char.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libcipc
+ * @{
+ */
+/** @file
+ * @brief Character device interface.
+ */ 
+
+#ifndef LIBC_IPC_CHAR_H_
+#define LIBC_IPC_CHAR_H_
+
+#include <ipc/ipc.h>
+
+typedef enum {
+	CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD
+} char_request_t;
+
+
+typedef enum {
+	CHAR_NOTIF_BYTE = IPC_FIRST_USER_METHOD
+} char_notif_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/libc/include/ipc/mouse.h
===================================================================
--- uspace/lib/libc/include/ipc/mouse.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
+++ uspace/lib/libc/include/ipc/mouse.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup mouse
+ * @brief
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_MOUSE_H_
+#define LIBC_IPC_MOUSE_H_
+
+#include <ipc/ipc.h>
+
+typedef enum {
+	MEVENT_BUTTON = IPC_FIRST_USER_METHOD,
+	MEVENT_MOVE
+} mouse_notif_t;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/libc/include/sys/types.h
===================================================================
--- uspace/lib/libc/include/sys/types.h	(revision 405f7599e6313c421a16c96d2a71c715c1b5188b)
+++ uspace/lib/libc/include/sys/types.h	(revision fd608dcf23fddc6d2ba03c8127a3289923af802a)
@@ -40,4 +40,5 @@
 typedef long off_t;
 typedef int mode_t;
+typedef uint64_t bn_t;	/**< Block number type. */
 
 typedef int32_t wchar_t;
