Index: uspace/lib/c/include/adt/hash_table.h
===================================================================
--- uspace/lib/c/include/adt/hash_table.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/adt/hash_table.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -102,5 +102,4 @@
     void *);
 
-
 #endif
 
Index: uspace/lib/c/include/cc.h
===================================================================
--- uspace/lib/c/include/cc.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/cc.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -44,5 +44,4 @@
 #endif
 
-
 #endif
 
Index: uspace/lib/c/include/ddi.h
===================================================================
--- uspace/lib/c/include/ddi.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/ddi.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -40,4 +40,5 @@
 #include <stdint.h>
 #include <sys/time.h>
+#include <byteorder.h>
 #include <abi/ddi/irq.h>
 #include <device/hw_res.h>
@@ -64,5 +65,6 @@
 
 extern errno_t pio_enable_range(addr_range_t *, void **);
-extern errno_t pio_enable_resource(pio_window_t *, hw_resource_t *, void **);
+extern errno_t pio_enable_resource(pio_window_t *, hw_resource_t *, void **,
+    uintptr_t *, size_t *);
 extern errno_t pio_enable(void *, size_t, void **);
 extern errno_t pio_disable(void *, size_t);
@@ -85,4 +87,54 @@
 extern uint64_t pio_read_64(const ioport64_t *);
 
+static inline void pio_write_le16(ioport16_t *reg, uint16_t val)
+{
+	pio_write_16(reg, host2uint16_t_le(val));
+}
+static inline void pio_write_be16(ioport16_t *reg, uint16_t val)
+{
+	pio_write_16(reg, host2uint16_t_be(val));
+}
+static inline void pio_write_le32(ioport32_t *reg, uint32_t val)
+{
+	pio_write_32(reg, host2uint32_t_le(val));
+}
+static inline void pio_write_be32(ioport32_t *reg, uint32_t val)
+{
+	pio_write_32(reg, host2uint32_t_be(val));
+}
+static inline void pio_write_le64(ioport64_t *reg, uint64_t val)
+{
+	pio_write_64(reg, host2uint64_t_le(val));
+}
+static inline void pio_write_be64(ioport64_t *reg, uint64_t val)
+{
+	pio_write_64(reg, host2uint64_t_be(val));
+}
+
+static inline uint16_t pio_read_le16(const ioport16_t *reg)
+{
+	return uint16_t_le2host(pio_read_16(reg));
+}
+static inline uint16_t pio_read_be16(const ioport16_t *reg)
+{
+	return uint16_t_be2host(pio_read_16(reg));
+}
+static inline uint32_t pio_read_le32(const ioport32_t *reg)
+{
+	return uint32_t_le2host(pio_read_32(reg));
+}
+static inline uint32_t pio_read_be32(const ioport32_t *reg)
+{
+	return uint32_t_be2host(pio_read_32(reg));
+}
+static inline uint64_t pio_read_le64(const ioport64_t *reg)
+{
+	return uint64_t_le2host(pio_read_64(reg));
+}
+static inline uint64_t pio_read_be64(const ioport64_t *reg)
+{
+	return uint64_t_be2host(pio_read_64(reg));
+}
+
 static inline uint8_t pio_change_8(ioport8_t *reg, uint8_t val, uint8_t mask,
     useconds_t delay)
Index: uspace/lib/c/include/fibril_synch.h
===================================================================
--- uspace/lib/c/include/fibril_synch.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/fibril_synch.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -67,6 +67,6 @@
 typedef struct {
 	fibril_owner_info_t oi;  /**< Keep this the first thing. */
-	unsigned writers;
-	unsigned readers;
+	unsigned int writers;
+	unsigned int readers;
 	list_t waiters;
 } fibril_rwlock_t;
@@ -145,5 +145,5 @@
 /** A counting semaphore for fibrils. */
 typedef struct {
-	long count;
+	long int count;
 	list_t waiters;
 } fibril_semaphore_t;
Index: uspace/lib/c/include/ipc/common.h
===================================================================
--- uspace/lib/c/include/ipc/common.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/ipc/common.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -50,5 +50,5 @@
 	task_id_t in_task_id;
 	sysarg_t in_phone_hash;
-	unsigned flags;
+	unsigned int flags;
 	struct async_call *label;
 	cap_call_handle_t cap_handle;
Index: uspace/lib/c/include/macros.h
===================================================================
--- uspace/lib/c/include/macros.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/macros.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -38,5 +38,5 @@
 #define min(a, b)  ((a) < (b) ? (a) : (b))
 #define max(a, b)  ((a) > (b) ? (a) : (b))
-#define abs(a)     ((a) >= 0 ? (a) : -(a))
+#define mabs(a)    ((a) >= 0 ? (a) : -(a))
 
 #define ARRAY_SIZE(array)   (sizeof(array) / sizeof(array[0]))
Index: uspace/lib/c/include/mem.h
===================================================================
--- uspace/lib/c/include/mem.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/mem.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Martin Decky
+ * Copyright (c) 2018 Jiri Svoboda
  * All rights reserved.
  *
@@ -49,4 +50,6 @@
 extern int memcmp(const void *, const void *, size_t)
     __attribute__((nonnull(1, 2)));
+extern void *memchr(const void *, int, size_t)
+    __attribute__((nonnull(1)));
 
 #endif
Index: uspace/lib/c/include/stdbool.h
===================================================================
--- uspace/lib/c/include/stdbool.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/stdbool.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -41,5 +41,5 @@
 #define true   1
 
-#define __bool_true_false_are_defined 1
+#define __bool_true_false_are_defined  1
 
 #endif
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/stdio.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Martin Decky
+ * Copyright (c) 2018 Jiri Svoboda
  * All rights reserved.
  *
@@ -36,33 +37,55 @@
 #define LIBC_STDIO_H_
 
+#include <offset.h>
 #include <stdarg.h>
 #include <io/verify.h>
+#include <_bits/NULL.h>
 #include <_bits/size_t.h>
 #include <_bits/wchar_t.h>
 #include <_bits/wint_t.h>
 
-#define EOF  (-1)
-
-#ifndef SEEK_SET
-#define SEEK_SET  0
-#endif
-
-#ifndef SEEK_CUR
-#define SEEK_CUR  1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END  2
-#endif
-
-/** Default size for stream I/O buffers */
-#define BUFSIZ  4096
-
-/** Recommended size of fixed-size array for holding file names. */
-#define FILENAME_MAX 4096
-
 /** Forward declaration */
 struct _IO_FILE;
 typedef struct _IO_FILE FILE;
+
+/** File position */
+typedef struct {
+	off64_t pos;
+} fpos_t;
+
+#ifndef _HELENOS_SOURCE
+#define _IONBF 0
+#define _IOLBF 1
+#define _IOFBF 2
+#endif
+
+/** Default size for stream I/O buffers */
+#define BUFSIZ  4096
+
+#define EOF  (-1)
+
+/** Max number of files that is guaranteed to be able to open at the same time */
+#define FOPEN_MAX VFS_MAX_OPEN_FILES
+
+/** Recommended size of fixed-size array for holding file names. */
+#define FILENAME_MAX 4096
+
+/** Length of "/tmp/tmp.XXXXXX" + 1 */
+#define L_tmpnam 16
+
+#ifndef SEEK_SET
+#define SEEK_SET  0
+#endif
+
+#ifndef SEEK_CUR
+#define SEEK_CUR  1
+#endif
+
+#ifndef SEEK_END
+#define SEEK_END  2
+#endif
+
+/** Minimum number of unique temporary file names */
+#define TMP_MAX 1000000
 
 extern FILE *stdin;
@@ -74,4 +97,5 @@
 extern int fgetc(FILE *);
 extern char *fgets(char *, int, FILE *);
+extern char *gets(char *, size_t) __attribute__((deprecated));
 
 extern int getchar(void);
@@ -104,7 +128,11 @@
 extern int vasprintf(char **, const char *, va_list);
 extern int asprintf(char **, const char *, ...)
-#endif
     _HELENOS_PRINTF_ATTRIBUTE(2, 3);
+#endif
 extern int vsnprintf(char *, size_t, const char *, va_list);
+
+extern int sprintf(char *, const char *, ...)
+    __attribute__((deprecated)) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
+extern int vsprintf(char *, const char *, va_list) __attribute__((deprecated));
 
 /* Formatted input */
@@ -124,4 +152,7 @@
 extern size_t fwrite(const void *, size_t, size_t, FILE *);
 
+extern int fgetpos(FILE *, fpos_t *);
+extern int fsetpos(FILE *, const fpos_t *);
+
 extern int fseek(FILE *, long, int);
 extern void rewind(FILE *);
@@ -133,19 +164,15 @@
 extern void clearerr(FILE *);
 
+extern void perror(const char *);
+
 extern void setvbuf(FILE *, void *, int, size_t);
 extern void setbuf(FILE *, void *);
 
 /* Misc file functions */
+extern int remove(const char *);
 extern int rename(const char *, const char *);
-extern int remove(const char *);
-
-#ifndef _HELENOS_SOURCE
-#define _IONBF 0
-#define _IOLBF 1
-#define _IOFBF 2
-
-extern char *gets(char *, size_t);
-
-#endif
+
+extern FILE *tmpfile(void);
+extern char *tmpnam(char *s) __attribute__((deprecated));
 
 #ifdef _HELENOS_SOURCE
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/stdlib.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -87,4 +87,8 @@
 extern int system(const char *);
 
+extern int abs(int);
+extern long labs(long);
+extern long long llabs(long long);
+
 extern int atoi(const char *);
 extern long atol(const char *);
Index: uspace/lib/c/include/tmpfile.h
===================================================================
--- uspace/lib/c/include/tmpfile.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
+++ uspace/lib/c/include/tmpfile.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2018 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.
+ */
+
+#ifndef LIBC_TMPFILE_H_
+#define LIBC_TMPFILE_H_
+
+#include <stdbool.h>
+
+extern int __tmpfile_templ(char *, bool);
+extern int __tmpfile(void);
+extern char *__tmpnam(char *);
+
+#endif
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision b59318e5ac29b0f8d47f0b4407a9f99be6ad5654)
+++ uspace/lib/c/include/vfs/vfs.h	(revision 81193639c9f3af3b65a6ea46f1f7422d4d3bec12)
@@ -45,5 +45,5 @@
 #include <offset.h>
 
-#define MAX_OPEN_FILES	128
+#define VFS_MAX_OPEN_FILES  128
 
 enum vfs_change_state_type {
