Index: uspace/lib/c/include/err.h
===================================================================
--- uspace/lib/c/include/err.h	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/c/include/err.h	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -36,4 +36,11 @@
 #define LIBC_ERR_H_
 
+#include <stdio.h>
+#include <errno.h>
+
+#ifdef CONFIG_DEBUG
+#include <str_error.h>
+#endif
+
 #define errx(status, fmt, ...) { \
 	printf((fmt), ##__VA_ARGS__); \
@@ -41,4 +48,52 @@
 }
 
+
+/** An actual stored error code.  */
+#define ERROR_CODE  error_check_return_value
+
+/** An error processing routines declaration.
+ *
+ * This has to be declared in the block where the error processing
+ * is desired.
+ */
+#define ERROR_DECLARE  int ERROR_CODE
+
+/** Store the value as an error code and checks if an error occurred.
+ *
+ * @param[in] value	The value to be checked. May be a function call.
+ * @return		False if the value indicates success (EOK).
+ * @return		True otherwise.
+ */
+#ifdef CONFIG_DEBUG
+
+#define ERROR_OCCURRED(value) \
+	(((ERROR_CODE = (value)) != EOK) && \
+	({ \
+		fprintf(stderr, "libsocket error at %s:%d (%s)\n", \
+		__FILE__, __LINE__, str_error(ERROR_CODE)); \
+		1; \
+	}))
+
+#else
+
+#define ERROR_OCCURRED(value)	((ERROR_CODE = (value)) != EOK)
+
+#endif
+
+#define ERROR_NONE(value)	!ERROR_OCCURRED((value))
+
+/** Error propagation
+ *
+ * Check if an error occurred and immediately exit the actual
+ * function returning the error code.
+ *
+ * @param[in] value	The value to be checked. May be a function call.
+ *
+ */
+
+#define ERROR_PROPAGATE(value) \
+	if (ERROR_OCCURRED(value)) \
+		return ERROR_CODE
+
 #endif
 
Index: uspace/lib/net/adt/module_map.c
===================================================================
--- uspace/lib/net/adt/module_map.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/net/adt/module_map.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -38,8 +38,8 @@
 #include <task.h>
 #include <unistd.h>
+#include <err.h>
 
 #include <ipc/services.h>
 
-#include <net_err.h>
 #include <net_modules.h>
 
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/net/generic/packet_remote.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -38,8 +38,8 @@
 #include <async.h>
 #include <errno.h>
+#include <err.h>
 #include <ipc/ipc.h>
 #include <sys/mman.h>
 
-#include <net_err.h>
 #include <net_messages.h>
 #include <packet/packet.h>
Index: uspace/lib/net/include/netif_local.h
===================================================================
--- uspace/lib/net/include/netif_local.h	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/net/include/netif_local.h	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -44,7 +44,7 @@
 #include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <err.h>
 
 #include <adt/measured_strings.h>
-#include <net_err.h>
 #include <net_device.h>
 #include <packet/packet.h>
Index: uspace/lib/net/netif/netif_local.c
===================================================================
--- uspace/lib/net/netif/netif_local.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/net/netif/netif_local.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -42,6 +42,6 @@
 #include <ipc/ipc.h>
 #include <ipc/services.h>
-
-#include <net_err.h>
+#include <err.h>
+
 #include <net_messages.h>
 #include <net_modules.h>
Index: uspace/lib/net/tl/tl_common.c
===================================================================
--- uspace/lib/net/tl/tl_common.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/net/tl/tl_common.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -39,6 +39,6 @@
 #include <ipc/services.h>
 #include <errno.h>
-
-#include <net_err.h>
+#include <err.h>
+
 #include <packet/packet.h>
 #include <packet/packet_client.h>
Index: uspace/lib/socket/adt/measured_strings.c
===================================================================
--- uspace/lib/socket/adt/measured_strings.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/adt/measured_strings.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -36,12 +36,12 @@
  */
 
-#include <errno.h>
 #include <malloc.h>
 #include <mem.h>
 #include <unistd.h>
+#include <errno.h>
+#include <err.h>
 
 #include <ipc/ipc.h>
 
-#include <net_err.h>
 #include <net_modules.h>
 #include <adt/measured_strings.h>
Index: uspace/lib/socket/generic/net_modules.c
===================================================================
--- uspace/lib/socket/generic/net_modules.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/generic/net_modules.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -37,4 +37,5 @@
 #include <async.h>
 #include <malloc.h>
+#include <err.h>
 
 #include <ipc/ipc.h>
@@ -43,5 +44,4 @@
 #include <sys/time.h>
 
-#include <net_err.h>
 #include <net_modules.h>
 
Index: uspace/lib/socket/generic/socket_client.c
===================================================================
--- uspace/lib/socket/generic/socket_client.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/generic/socket_client.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -43,8 +43,8 @@
 #include <stdlib.h>
 #include <errno.h>
+#include <err.h>
 
 #include <ipc/services.h>
 
-#include <net_err.h>
 #include <net_modules.h>
 #include <in.h>
Index: uspace/lib/socket/generic/socket_core.c
===================================================================
--- uspace/lib/socket/generic/socket_core.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/generic/socket_core.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -38,6 +38,6 @@
 #include <stdlib.h>
 #include <errno.h>
-
-#include <net_err.h>
+#include <err.h>
+
 #include <in.h>
 #include <inet.h>
Index: uspace/lib/socket/include/adt/generic_char_map.h
===================================================================
--- uspace/lib/socket/include/adt/generic_char_map.h	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/include/adt/generic_char_map.h	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -38,8 +38,7 @@
 #define __GENERIC_CHAR_MAP_H__
 
+#include <unistd.h>
 #include <errno.h>
-#include <unistd.h>
-
-#include <net_err.h>
+#include <err.h>
 
 #include <adt/char_map.h>
Index: uspace/lib/socket/include/net_err.h
===================================================================
--- uspace/lib/socket/include/net_err.h	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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 net
- * @{
- */
-
-/** @file
- * Common error processing codes and routines.
- */
-
-#ifndef __NET_ERR_H__
-#define __NET_ERR_H__
-
-#include <errno.h>
-
-#ifdef CONFIG_DEBUG
-	#include <stdio.h>
-	#include <str_error.h>
-#endif
-
-/** An actual stored error code.
- *
- */
-#define ERROR_CODE  error_check_return_value
-
-/** An error processing routines declaration.
- *
- * This has to be declared in the block where the error processing
- * is desired.
- *
- */
-#define ERROR_DECLARE  int ERROR_CODE
-
-/** Store the value as an error code and checks if an error occurred.
- *
- * @param[in] value The value to be checked. May be a function call.
- * @return False if the value indicates success (EOK).
- * @return True otherwise.
- *
- */
-#ifdef CONFIG_DEBUG
-
-#define ERROR_OCCURRED(value) \
-	(((ERROR_CODE = (value)) != EOK) \
-	&& ({ \
-		fprintf(stderr, "libsocket error at %s:%d (%s)\n", \
-		__FILE__, __LINE__, str_error(ERROR_CODE)); \
-		1; \
-	}))
-
-#else
-
-#define ERROR_OCCURRED(value)  ((ERROR_CODE = (value)) != EOK)
-
-#endif
-
-#define ERROR_NONE(value)	!ERROR_OCCURRED((value))
-
-/** Error propagation
- *
- * Check if an error occurred and immediately exit the actual
- * function returning the error code.
- *
- * @param[in] value The value to be checked. May be a function call.
- *
- */
-
-#define ERROR_PROPAGATE(value) \
-	if (ERROR_OCCURRED(value)) \
-		return ERROR_CODE
-
-#endif
-
-/** @}
- */
Index: uspace/lib/socket/packet/packet.c
===================================================================
--- uspace/lib/socket/packet/packet.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/packet/packet.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -36,13 +36,13 @@
  */
 
-#include <errno.h>
 #include <malloc.h>
 #include <mem.h>
 #include <fibril_synch.h>
 #include <unistd.h>
+#include <errno.h>
+#include <err.h>
 
 #include <sys/mman.h>
 
-#include <net_err.h>
 #include <adt/generic_field.h>
 #include <packet/packet.h>
Index: uspace/lib/socket/packet/packet_server.c
===================================================================
--- uspace/lib/socket/packet/packet_server.c	(revision e98b1d582137f7a2c521f6e31e0cee410b5acb65)
+++ uspace/lib/socket/packet/packet_server.c	(revision c5b59cee008cd899135ed0a623096d8886843e8c)
@@ -39,4 +39,5 @@
 #include <async.h>
 #include <errno.h>
+#include <err.h>
 #include <fibril_synch.h>
 #include <unistd.h>
@@ -45,5 +46,4 @@
 #include <sys/mman.h>
 
-#include <net_err.h>
 #include <net_messages.h>
 #include <packet/packet.h>
