Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ HelenOS.config	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -573,7 +573,4 @@
 ! CONFIG_BINUTILS (n/y)
 
-% Build MSIM binary
-! CONFIG_MSIM (n/y)
-
 % Line debugging information
 ! [CONFIG_STRIP_BINARIES!=y] CONFIG_LINE_DEBUG (n/y)
Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ boot/Makefile.common	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -201,9 +201,4 @@
 endif
 
-ifeq ($(CONFIG_MSIM),y)
-RD_APPS_NON_ESSENTIAL += \
-	$(USPACE_PATH)/app/msim/msim
-endif
-
 COMPONENTS = \
 	$(KERNEL_PATH)/kernel.bin \
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/Makefile	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -138,9 +138,4 @@
 endif
 
-ifeq ($(CONFIG_MSIM),y)
-DIRS += \
-	app/msim
-endif
-
 ## Platform-specific hardware support
 #
Index: uspace/app/killall/killall.c
===================================================================
--- uspace/app/killall/killall.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/killall/killall.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -36,5 +36,4 @@
 #include <errno.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <task.h>
 #include <stats.h>
Index: pace/app/msim/Makefile
===================================================================
--- uspace/app/msim/Makefile	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,99 +1,0 @@
-#
-# Copyright (c) 2012 Vojtech Horky
-# 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.
-#
-
-USPACE_PREFIX = ../..
-BINARY = msim
-
-MSIM_VERSION = 1.3.8.1
-MSIM_DIST = msim-$(MSIM_VERSION)
-MSIM_TARBALL = $(MSIM_DIST).tar.bz2
-MSIM_MIRROR = http://d3s.mff.cuni.cz/~holub/sw/msim/
-
-MSIM_HELENOS_MAKEFILE = Makefile.msim.src
-MSIM_HELENOS_PLATFORM_FILES = misc.c input.c
-MSIM_HELENOS_ARCH_DIR = arch/helenos
-MSIM_PATCHED_FILES = \
-	$(MSIM_DIST)/config.h \
-	$(MSIM_DIST)/src/$(MSIM_HELENOS_MAKEFILE) \
-	$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/helenos.h \
-	$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/misc.c \
-	$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/input.c
-
-MSIM_EXTRA_SOURCES := $(addprefix $(MSIM_HELENOS_ARCH_DIR)/,$(MSIM_HELENOS_PLATFORM_FILES))
-
-CP = /bin/cp -f
-
-all: $(BINARY)
-
-.PHONY: all clean unpack-tarball
-
-clean:
-	rm -rf msim Makefile.depend* *.map *.disasm $(MSIM_TARBALL) $(MSIM_DIST)
-
-$(BINARY): $(MSIM_DIST)/src/msim
-	$(CP) $< $@
-
-# Run make in MSIM src directory
-$(MSIM_DIST)/src/msim: $(MSIM_PATCHED_FILES) $(MSIM_DIST)/src/Makefile.sources Makefile 
-	cd $(MSIM_DIST)/src; make -f $(MSIM_HELENOS_MAKEFILE) USPACE_PREFIX=../../$(USPACE_PREFIX)
-	
-# Copy HelenOS specific files
-$(MSIM_DIST)/config.h: config.h.msim | unpack-tarball
-	$(CP) $< $@
-
-$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/helenos.h: arch_helenos/helenos.h | unpack-tarball
-	$(CP) $< $@
-
-$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/misc.c: arch_helenos/misc.c | unpack-tarball
-	$(CP) $< $@
-
-$(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)/input.c: arch_helenos/input.c | unpack-tarball
-	$(CP) $< $@
-
-$(MSIM_DIST)/src/$(MSIM_HELENOS_MAKEFILE): $(MSIM_HELENOS_MAKEFILE) | unpack-tarball
-	$(CP) $< $@
-
-# Extract list of sources, remove POSIX/Linux specific
-$(MSIM_DIST)/src/Makefile.sources: | unpack-tarball
-	cd $(MSIM_DIST)/src; ( \
-		echo 'all__:'; \
-		echo -e '\t@echo SOURCES = $$(SOURCES)'; cat Makefile.in \
-	) | make -f - | grep 'SOURCES' >Makefile.sources
-	sed \
-		-e 's:io/input.c:$(MSIM_EXTRA_SOURCES):' \
-		-e 's:debug/gdb.c::' \
-		-e 's:arch/posix/stdin.c::' \
-		-i $(MSIM_DIST)/src/Makefile.sources
-
-# Download tarball
-$(MSIM_TARBALL):
-	wget "$(MSIM_MIRROR)$(MSIM_TARBALL)" -O $(MSIM_TARBALL)
-
-unpack-tarball: $(MSIM_TARBALL)
-	tar xjf $(MSIM_TARBALL)
-	mkdir -p $(MSIM_DIST)/src/$(MSIM_HELENOS_ARCH_DIR)
Index: pace/app/msim/Makefile.msim.src
===================================================================
--- uspace/app/msim/Makefile.msim.src	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#
-# Copyright (c) 2012 Vojtech Horky
-# 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.
-#
-
-
-BINARY = msim
-LIBS = $(LIBCLUI_PREFIX)/libclui.a
-POSIX_COMPAT = y
-# Needed because MSIM is not that strict as HelenOS
-EXTRA_CFLAGS = -Wno-error -I$(LIBCLUI_PREFIX)
-
-include Makefile.sources
-
-include $(USPACE_PREFIX)/Makefile.common
Index: pace/app/msim/arch_helenos/helenos.h
===================================================================
--- uspace/app/msim/arch_helenos/helenos.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2012 Vojtech Horky
- * 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 msim
- * @{
- */
-
-#ifndef MSIM_HELENOS_H_
-#define MSIM_HELENOS_H_
-
-char *helenos_input_get_next_command(void);
-void helenos_dprinter_init(void);
-
-#endif
-
-/**
- * @}
- */
-
Index: pace/app/msim/arch_helenos/input.c
===================================================================
--- uspace/app/msim/arch_helenos/input.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,105 +1,0 @@
-/*
- * Copyright (c) 2012 Vojtech Horky
- * 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 msim
- * @{
- */
-/** @file HelenOS specific functions for MSIM simulator.
- */
-#include "../../io/input.h"
-#include "../../io/output.h"
-#include "../../fault.h"
-#include "helenos.h"
-#include <tinput.h>
-#include <errno.h>
-
-static tinput_t *input_prompt;
-
-/** Terminal and readline initialization
- *
- */
-void input_init(void)
-{
-	input_prompt = tinput_new();
-	if (input_prompt == NULL) {
-		die(1, "Failed to intialize input.");
-	}
-	helenos_dprinter_init();
-}
-
-void input_inter(void)
-{
-}
-
-void input_shadow( void)
-{
-}
-
-void input_back( void)
-{
-}
-
-char *helenos_input_get_next_command(void)
-{
-	tinput_set_prompt(input_prompt, "[msim] ");
-
-	char *commline = NULL;
-	int rc = tinput_read(input_prompt, &commline);
-
-	if (rc == ENOENT) {
-		rc = asprintf(&commline, "quit");
-		mprintf("Quit\n");
-		if (rc != EOK) {
-			exit(1);
-		}
-	}
-
-	/* On error, it remains NULL. */
-	return commline;
-}
-
-
-bool stdin_poll(char *key)
-{
-	kbd_event_t ev;
-	suseconds_t timeout = 0;
-	errno = EOK;
-	console_flush(input_prompt->console);
-	bool has_input = console_get_kbd_event_timeout(input_prompt->console, &ev, &timeout);
-	if (!has_input) {
-		return false;
-	}
-
-	if (ev.type != KEY_PRESS)
-		return false;
-
-	*key = ev.c;
-
-	return true;
-}
-
Index: pace/app/msim/arch_helenos/misc.c
===================================================================
--- uspace/app/msim/arch_helenos/misc.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,149 +1,0 @@
-/*
- * Copyright (c) 2012 Vojtech Horky
- * 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 msim
- * @{
- */
-/** @file HelenOS specific functions for MSIM simulator.
- */
-#include "../../io/input.h"
-#include "../../io/output.h"
-#include "../../device/dprinter.h"
-#include "../../debug/gdb.h"
-#include "../../cmd.h"
-#include "../../fault.h"
-#include "../../device/machine.h"
-#include "helenos.h"
-#include <str.h>
-#include <malloc.h>
-#include <ctype.h>
-#include <stdio.h>
-
-/* Define when the dprinter device shall try to filter
- * out ANSI escape sequences.
- */
-#define IGNORE_ANSI_ESCAPE_SEQUENCES
-/* Define when you want the ANSI escape sequences to be dumped as
- * hex numbers.
- */
-// #define DUMP_ANSI_ESCAPE_SEQUENCES
-
-void interactive_control(void)
-{
-	tobreak = false;
-
-	if (reenter) {
-		mprintf("\n");
-		reenter = false;
-	}
-
-	stepping = 0;
-
-	while (interactive) {
-		char *commline = helenos_input_get_next_command();
-		if (commline == NULL) {
-			mprintf("Quit\n");
-			input_back();
-			exit(1);
-		}
-
-		/* Check for empty input. */
-		if (str_cmp(commline, "") == 0) {
-			interpret("step");
-		} else {
-			interpret(commline);
-		}
-
-		free(commline);
-	}
-}
-
-bool gdb_remote_init(void)
-{
-	return false;
-}
-
-void gdb_session(void)
-{
-}
-
-void gdb_handle_event(gdb_event_t event)
-{
-}
-
-
-static void (*original_printer_write)(cpu_t *, device_s *, ptr_t, uint32_t);
-static void helenos_printer_write(cpu_t *cpu, device_s *dev, ptr_t addr, uint32_t val)
-{
-#ifdef IGNORE_ANSI_ESCAPE_SEQUENCES
-	static bool inside_ansi_escape = false;
-	static bool just_ended_ansi_escape = false;
-
-	if (inside_ansi_escape) {
-#ifdef DUMP_ANSI_ESCAPE_SEQUENCES
-		fprintf(stderr, "%02" PRIx32 "'%c' ", val, val >= 32 ? val : '?');
-#endif
-		if (isalpha((int) val)) {
-			just_ended_ansi_escape = true;
-			inside_ansi_escape = false;
-#ifdef DUMP_ANSI_ESCAPE_SEQUENCES
-			fprintf(stderr, " [END]\n");
-#endif
-		}
-
-		return;
-	}
-
-	if (val == 0x1B) {
-		inside_ansi_escape = true;
-
-		if (!just_ended_ansi_escape) {
-#ifdef DUMP_ANSI_ESCAPE_SEQUENCES
-			fprintf(stderr, "\n");
-#endif
-		}
-#ifdef DUMP_ANSI_ESCAPE_SEQUENCES
-		fprintf(stderr, "ESC sequence: ");
-#endif
-
-		return;
-	}
-
-	just_ended_ansi_escape = false;
-#endif
-
-	(*original_printer_write)(cpu, dev, addr, val);
-}
-
-void helenos_dprinter_init(void)
-{
-	original_printer_write = dprinter.write;
-	dprinter.write = helenos_printer_write;
-}
-
-
Index: pace/app/msim/config.h.msim
===================================================================
--- uspace/app/msim/config.h.msim	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/* config.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
-/* Define to 1 if you have the `getopt_long' function. */
-#define HAVE_GETOPT_LONG 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `readline' library (-lreadline). */
-#define HAVE_LIBREADLINE 1
-
-/* Define to 1 if you have the `wsock32' library (-lwsock32). */
-/* #undef HAVE_LIBWSOCK32 */
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <readline/history.h> header file. */
-#define HAVE_READLINE_HISTORY_H 1
-
-/* Define to 1 if you have the <readline/readline.h> header file. */
-#define HAVE_READLINE_READLINE_H 1
-
-/* Define to 1 if you have the <signal.h> header file. */
-#define HAVE_SIGNAL_H 1
-
-/* Define to 1 if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1
-
-/* Define to 1 if you have the <stdbool.h> header file. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#define HAVE_STDIO_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Name of package */
-#define PACKAGE "msim"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "1.3.8.1"
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
Index: uspace/app/nettest1/nettest1.c
===================================================================
--- uspace/app/nettest1/nettest1.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/nettest1/nettest1.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -40,5 +40,4 @@
 #include <malloc.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <str.h>
 #include <task.h>
Index: uspace/app/nettest2/nettest2.c
===================================================================
--- uspace/app/nettest2/nettest2.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/nettest2/nettest2.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -40,5 +40,4 @@
 #include <malloc.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <str.h>
 #include <task.h>
Index: uspace/app/sbi/src/mytypes.h
===================================================================
--- uspace/app/sbi/src/mytypes.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/sbi/src/mytypes.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -51,6 +51,4 @@
 /** Error return codes. */
 #include <errno.h>
-/** We need NULL defined. */
-#include <unistd.h>
 #define EOK 0
 
Index: uspace/app/sysinfo/sysinfo.c
===================================================================
--- uspace/app/sysinfo/sysinfo.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/sysinfo/sysinfo.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -36,5 +36,4 @@
 #include <errno.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <sysinfo.h>
 #include <malloc.h>
Index: uspace/app/websrv/websrv.c
===================================================================
--- uspace/app/websrv/websrv.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/app/websrv/websrv.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -36,5 +36,4 @@
 #include <bool.h>
 #include <errno.h>
-#include <assert.h>
 #include <stdio.h>
 #include <sys/types.h>
Index: uspace/drv/bus/usb/ohci/utils/malloc32.h
===================================================================
--- uspace/drv/bus/usb/ohci/utils/malloc32.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/drv/bus/usb/ohci/utils/malloc32.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -37,5 +37,4 @@
 #include <assert.h>
 #include <malloc.h>
-#include <unistd.h>
 #include <errno.h>
 #include <mem.h>
Index: uspace/drv/bus/usb/uhci/utils/malloc32.h
===================================================================
--- uspace/drv/bus/usb/uhci/utils/malloc32.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/drv/bus/usb/uhci/utils/malloc32.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -36,5 +36,4 @@
 
 #include <assert.h>
-#include <unistd.h>
 #include <errno.h>
 #include <malloc.h>
Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/generic/stacktrace.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -38,5 +38,4 @@
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 
 static int stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
Index: uspace/lib/c/generic/stats.c
===================================================================
--- uspace/lib/c/generic/stats.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/generic/stats.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -40,5 +40,4 @@
 #include <inttypes.h>
 #include <malloc.h>
-#include <unistd.h>
 
 #define SYSINFO_STATS_MAX_PATH  64
Index: uspace/lib/c/generic/sysinfo.c
===================================================================
--- uspace/lib/c/generic/sysinfo.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/generic/sysinfo.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -39,5 +39,4 @@
 #include <malloc.h>
 #include <bool.h>
-#include <unistd.h>
 
 /** Get sysinfo keys size
Index: uspace/lib/c/generic/time.c
===================================================================
--- uspace/lib/c/generic/time.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/generic/time.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -43,5 +43,4 @@
 #include <ddi.h>
 #include <libc.h>
-#include <unistd.h>
 
 /** Pointer to kernel shared variables with time */
Index: uspace/lib/c/include/errno.h
===================================================================
--- uspace/lib/c/include/errno.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/include/errno.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -37,4 +37,5 @@
 
 #include <abi/errno.h>
+#include <fibril.h>
 
 #define errno  (*(__errno()))
Index: uspace/lib/c/include/stdarg.h
===================================================================
--- uspace/lib/c/include/stdarg.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/include/stdarg.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -43,5 +43,4 @@
 #define va_arg(ap, type)    __builtin_va_arg(ap, type)
 #define va_end(ap)          __builtin_va_end(ap)
-#define va_copy(dst, src)   __builtin_va_copy(dst, src)
 
 #endif
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/c/include/stdio.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -39,4 +39,5 @@
 #include <stdarg.h>
 #include <str.h>
+#include <adt/list.h>
 
 #ifndef NVERIFY_PRINTF
Index: uspace/lib/clui/tinput.h
===================================================================
--- uspace/lib/clui/tinput.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/clui/tinput.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -37,4 +37,6 @@
 #define LIBCLUI_TINPUT_H_
 
+#include <adt/list.h>
+#include <async.h>
 #include <inttypes.h>
 #include <io/console.h>
Index: uspace/lib/drv/generic/logbuf.c
===================================================================
--- uspace/lib/drv/generic/logbuf.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/drv/generic/logbuf.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -35,5 +35,4 @@
 #include <ddf/log.h>
 #include <assert.h>
-#include <unistd.h>
 
 /** Formatting string for printing number of not-printed items. */
Index: uspace/lib/drv/include/ddf/interrupt.h
===================================================================
--- uspace/lib/drv/include/ddf/interrupt.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/drv/include/ddf/interrupt.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -36,6 +36,4 @@
 #define DDF_INTERRUPT_H_
 
-#include <libarch/common.h>
-#include <libarch/types.h>
 #include <abi/ddi/irq.h>
 #include <adt/list.h>
Index: uspace/lib/posix/Makefile
===================================================================
--- uspace/lib/posix/Makefile	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/Makefile	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -43,5 +43,4 @@
 	fcntl.c \
 	fnmatch.c \
-	getopt.c \
 	locale.c \
 	math.c \
Index: uspace/lib/posix/errno.h
===================================================================
--- uspace/lib/posix/errno.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/errno.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -66,6 +66,4 @@
 #undef errno
 #define errno (*__posix_errno())
-
-#include "unistd.h"
 
 extern int *__posix_errno(void);
Index: pace/lib/posix/getopt.c
===================================================================
--- uspace/lib/posix/getopt.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- * Copyright (c) 2012 Vojtech Horky
- * 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 libposix
- * @{
- */
-/** @file Command line argument parsing.
- */
-#define LIBPOSIX_INTERNAL
-
-#include "internal/common.h"
-#include "libc/getopt.h"
-#include "getopt.h"
-
-
-int posix_getopt_long(int argc, char * const argv[],
-    const char *opt_string, const struct option *long_opts, int *long_index)
-{
-	int rc = getopt_long(argc, argv, opt_string, long_opts, long_index);
-	posix_optarg = (char *) optarg;
-	return rc;
-}
-
-int posix_getopt(int argc, char * const argv[], const char *opt_string)
-{
-	int rc = getopt(argc, argv, opt_string);
-	posix_optarg = (char *) optarg;
-	return rc;
-}
Index: pace/lib/posix/getopt.h
===================================================================
--- uspace/lib/posix/getopt.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2012 Vojtech Horky
- * 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 libposix
- * @{
- */
-/** @file Command line argument parsing.
- */
-#ifndef POSIX_GETOPT_H
-#define POSIX_GETOPT_H
-
-#include "unistd.h"
-
-/* Option Arguments */
-#define no_argument        0
-#define required_argument  1
-#define optional_argument  2
-
-#ifndef LIBPOSIX_INTERNAL
-struct option {
-	const char *name;
-	int has_arg;
-	int *flag;
-	int val;
-};
-#endif
-
-extern int posix_getopt_long(int, char * const [], const char *, const struct option *, int *);
-
-
-#ifndef LIBPOSIX_INTERNAL
-	#define getopt_long posix_getopt_long
-#endif
-
-
-#endif
-/**
- * @}
- */
Index: uspace/lib/posix/pwd.c
===================================================================
--- uspace/lib/posix/pwd.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/pwd.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -38,5 +38,4 @@
 #include "string.h"
 #include "errno.h"
-#include "assert.h"
 
 static bool entry_read = false;
Index: uspace/lib/posix/stdbool.h
===================================================================
--- uspace/lib/posix/stdbool.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/stdbool.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -37,11 +37,6 @@
 
 #ifdef LIBC_BOOL_H_
-#if (!defined(POSIX_STDIO_H_)) \
-		&& (!defined(POSIX_STDLIB_H_)) \
-		&& (!defined(POSIX_STRING_H_))
-#error "You can't include bool.h and stdbool.h at the same time."
+	#error "You can't include bool.h and stdbool.h at the same time."
 #endif
-#endif
-
 #define LIBC_BOOL_H_
 
Index: uspace/lib/posix/stdio.h
===================================================================
--- uspace/lib/posix/stdio.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/stdio.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -37,6 +37,4 @@
 #define POSIX_STDIO_H_
 
-#include "stddef.h"
-#include "unistd.h"
 #include "libc/stdio.h"
 #include "sys/types.h"
Index: uspace/lib/posix/time.c
===================================================================
--- uspace/lib/posix/time.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/time.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -45,5 +45,4 @@
 #include "errno.h"
 #include "signal.h"
-#include "assert.h"
 
 #include "libc/malloc.h"
Index: uspace/lib/posix/unistd.c
===================================================================
--- uspace/lib/posix/unistd.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/unistd.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -49,5 +49,4 @@
 /* Array of environment variable strings (NAME=VALUE). */
 char **posix_environ = NULL;
-char *posix_optarg;
 
 /**
Index: uspace/lib/posix/unistd.h
===================================================================
--- uspace/lib/posix/unistd.h	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/lib/posix/unistd.h	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -43,7 +43,8 @@
 #define _exit exit
 
-extern char *posix_optarg;
+/* Option Arguments */
+extern char *optarg;
 extern int optind, opterr, optopt;
-extern int posix_getopt(int, char * const [], const char *);
+extern int getopt(int, char * const [], const char *);
 
 /* Environment */
@@ -143,7 +144,4 @@
 
 #ifndef LIBPOSIX_INTERNAL
-	#define getopt posix_getopt
-	#define optarg posix_optarg
-
 	#define environ posix_environ
 
Index: uspace/srv/fs/fat/fat_dentry.c
===================================================================
--- uspace/srv/fs/fat/fat_dentry.c	(revision c19667106913b684f8620943caecb3fdab81ea38)
+++ uspace/srv/fs/fat/fat_dentry.c	(revision 3e67ab12bbb2df2b1ef285b00f3b1336a5d82d17)
@@ -43,5 +43,4 @@
 #include <byteorder.h>
 #include <assert.h>
-#include <unistd.h>
 
 /** Compare path component with the name read from the dentry.
