Index: abi/include/_bits/all.h
===================================================================
--- abi/include/_bits/all.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/all.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_ALL_H_
+#define _BITS_ALL_H_
+
+#include <_bits/inttypes.h>
+#include <_bits/limits.h>
+#include <_bits/native.h>
+#include <_bits/ptrdiff_t.h>
+#include <_bits/size_t.h>
+#include <_bits/ssize_t.h>
+#include <_bits/stdint.h>
+#include <_bits/wchar_t.h>
+#include <_bits/wint_t.h>
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/inttypes.h
===================================================================
--- abi/include/_bits/inttypes.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/inttypes.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_INTTYPES_H_
+#define _BITS_INTTYPES_H_
+
+#include <_bits/macros.h>
+#include <_bits/stdint.h>
+#include <_bits/wchar_t.h>
+
+struct {
+	intmax_t quot;
+	intmax_t rem;
+} imaxdiv_t;
+
+#define PRId8       __PRId8__
+#define PRIdLEAST8  __PRId8__
+#define PRIdFAST8   __PRId8__
+
+#define PRIi8       __PRIi8__
+#define PRIiLEAST8  __PRIi8__
+#define PRIiFAST8   __PRIi8__
+
+#define PRIo8       __PRIo8__
+#define PRIoLEAST8  __PRIo8__
+#define PRIoFAST8   __PRIo8__
+
+#define PRIu8       __PRIu8__
+#define PRIuLEAST8  __PRIu8__
+#define PRIuFAST8   __PRIu8__
+
+#define PRIx8       __PRIx8__
+#define PRIxLEAST8  __PRIx8__
+#define PRIxFAST8   __PRIx8__
+
+#define PRIX8       __PRIX8__
+#define PRIXLEAST8  __PRIX8__
+#define PRIXFAST8   __PRIX8__
+
+#define SCNd8       __SCNd8__
+#define SCNdLEAST8  __SCNd8__
+#define SCNdFAST8   __SCNd8__
+
+#define SCNi8       __SCNi8__
+#define SCNiLEAST8  __SCNi8__
+#define SCNiFAST8   __SCNi8__
+
+#define SCNo8       __SCNo8__
+#define SCNoLEAST8  __SCNo8__
+#define SCNoFAST8   __SCNo8__
+
+#define SCNu8       __SCNu8__
+#define SCNuLEAST8  __SCNu8__
+#define SCNuFAST8   __SCNu8__
+
+#define SCNx8       __SCNx8__
+#define SCNxLEAST8  __SCNx8__
+#define SCNxFAST8   __SCNx8__
+
+#define PRId16       __PRId16__
+#define PRIdLEAST16  __PRId16__
+#define PRIdFAST16   __PRId16__
+
+#define PRIi16       __PRIi16__
+#define PRIiLEAST16  __PRIi16__
+#define PRIiFAST16   __PRIi16__
+
+#define PRIo16       __PRIo16__
+#define PRIoLEAST16  __PRIo16__
+#define PRIoFAST16   __PRIo16__
+
+#define PRIu16       __PRIu16__
+#define PRIuLEAST16  __PRIu16__
+#define PRIuFAST16   __PRIu16__
+
+#define PRIx16       __PRIx16__
+#define PRIxLEAST16  __PRIx16__
+#define PRIxFAST16   __PRIx16__
+
+#define PRIX16       __PRIX16__
+#define PRIXLEAST16  __PRIX16__
+#define PRIXFAST16   __PRIX16__
+
+#define SCNd16       __SCNd16__
+#define SCNdLEAST16  __SCNd16__
+#define SCNdFAST16   __SCNd16__
+
+#define SCNi16       __SCNi16__
+#define SCNiLEAST16  __SCNi16__
+#define SCNiFAST16   __SCNi16__
+
+#define SCNo16       __SCNo16__
+#define SCNoLEAST16  __SCNo16__
+#define SCNoFAST16   __SCNo16__
+
+#define SCNu16       __SCNu16__
+#define SCNuLEAST16  __SCNu16__
+#define SCNuFAST16   __SCNu16__
+
+#define SCNx16       __SCNx16__
+#define SCNxLEAST16  __SCNx16__
+#define SCNxFAST16   __SCNx16__
+
+#define PRId32       __PRId32__
+#define PRIdLEAST32  __PRId32__
+#define PRIdFAST32   __PRId32__
+
+#define PRIi32       __PRIi32__
+#define PRIiLEAST32  __PRIi32__
+#define PRIiFAST32   __PRIi32__
+
+#define PRIo32       __PRIo32__
+#define PRIoLEAST32  __PRIo32__
+#define PRIoFAST32   __PRIo32__
+
+#define PRIu32       __PRIu32__
+#define PRIuLEAST32  __PRIu32__
+#define PRIuFAST32   __PRIu32__
+
+#define PRIx32       __PRIx32__
+#define PRIxLEAST32  __PRIx32__
+#define PRIxFAST32   __PRIx32__
+
+#define PRIX32       __PRIX32__
+#define PRIXLEAST32  __PRIX32__
+#define PRIXFAST32   __PRIX32__
+
+#define SCNd32       __SCNd32__
+#define SCNdLEAST32  __SCNd32__
+#define SCNdFAST32   __SCNd32__
+
+#define SCNi32       __SCNi32__
+#define SCNiLEAST32  __SCNi32__
+#define SCNiFAST32   __SCNi32__
+
+#define SCNo32       __SCNo32__
+#define SCNoLEAST32  __SCNo32__
+#define SCNoFAST32   __SCNo32__
+
+#define SCNu32       __SCNu32__
+#define SCNuLEAST32  __SCNu32__
+#define SCNuFAST32   __SCNu32__
+
+#define SCNx32       __SCNx32__
+#define SCNxLEAST32  __SCNx32__
+#define SCNxFAST32   __SCNx32__
+
+#define PRId64       __PRId64__
+#define PRIdLEAST64  __PRId64__
+#define PRIdFAST64   __PRId64__
+
+#define PRIi64       __PRIi64__
+#define PRIiLEAST64  __PRIi64__
+#define PRIiFAST64   __PRIi64__
+
+#define PRIo64       __PRIo64__
+#define PRIoLEAST64  __PRIo64__
+#define PRIoFAST64   __PRIo64__
+
+#define PRIu64       __PRIu64__
+#define PRIuLEAST64  __PRIu64__
+#define PRIuFAST64   __PRIu64__
+
+#define PRIx64       __PRIx64__
+#define PRIxLEAST64  __PRIx64__
+#define PRIxFAST64   __PRIx64__
+
+#define PRIX64       __PRIX64__
+#define PRIXLEAST64  __PRIX64__
+#define PRIXFAST64   __PRIX64__
+
+#define SCNd64       __SCNd64__
+#define SCNdLEAST64  __SCNd64__
+#define SCNdFAST64   __SCNd64__
+
+#define SCNi64       __SCNi64__
+#define SCNiLEAST64  __SCNi64__
+#define SCNiFAST64   __SCNi64__
+
+#define SCNo64       __SCNo64__
+#define SCNoLEAST64  __SCNo64__
+#define SCNoFAST64   __SCNo64__
+
+#define SCNu64       __SCNu64__
+#define SCNuLEAST64  __SCNu64__
+#define SCNuFAST64   __SCNu64__
+
+#define SCNx64       __SCNx64__
+#define SCNxLEAST64  __SCNx64__
+#define SCNxFAST64   __SCNx64__
+
+#define PRIdPTR  __PRIdPTR__
+#define PRIiPTR  __PRIiPTR__
+#define PRIoPTR  __PRIoPTR__
+#define PRIuPTR  __PRIuPTR__
+#define PRIxPTR  __PRIxPTR__
+#define PRIXPTR  __PRIXPTR__
+#define SCNdPTR  __SCNdPTR__
+#define SCNiPTR  __SCNiPTR__
+#define SCNoPTR  __SCNoPTR__
+#define SCNuPTR  __SCNuPTR__
+#define SCNxPTR  __SCNxPTR__
+
+#define PRIdMAX  __PRIdMAX__
+#define PRIiMAX  __PRIiMAX__
+#define PRIoMAX  __PRIoMAX__
+#define PRIuMAX  __PRIuMAX__
+#define PRIxMAX  __PRIxMAX__
+#define PRIXMAX  __PRIXMAX__
+#define SCNdMAX  __SCNdMAX__
+#define SCNiMAX  __SCNiMAX__
+#define SCNoMAX  __SCNoMAX__
+#define SCNuMAX  __SCNuMAX__
+#define SCNxMAX  __SCNxMAX__
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/limits.h
===================================================================
--- abi/include/_bits/limits.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/limits.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_LIMITS_H_
+#define _BITS_LIMITS_H_
+
+#include <_bits/macros.h>
+
+/* _MIN macros for unsigned types are non-standard (and of course, always 0),
+ * but we already have them for some reason, so whatever.
+ */
+
+#define CHAR_BIT  __CHAR_BIT__
+
+#define SCHAR_MIN  __SCHAR_MIN__
+#define SCHAR_MAX  __SCHAR_MAX__
+
+#define UCHAR_MIN  0
+#define UCHAR_MAX  __UCHAR_MAX__
+
+#define CHAR_MIN  __CHAR_MIN__
+#define CHAR_MAX  __CHAR_MAX__
+
+#define MB_LEN_MAX  16
+
+#define SHRT_MIN  __SHRT_MIN__
+#define SHRT_MAX  __SHRT_MAX__
+
+#define USHRT_MIN  0
+#define USHRT_MAX  __USHRT_MAX__
+
+#define INT_MIN  __INT_MIN__
+#define INT_MAX  __INT_MAX__
+
+#define UINT_MIN  0U
+#define UINT_MAX  __UINT_MAX__
+
+#define LONG_MIN  __LONG_MIN__
+#define LONG_MAX  __LONG_MAX__
+
+#define ULONG_MIN  0UL
+#define ULONG_MAX  __ULONG_MAX__
+
+#define LLONG_MIN  __LLONG_MIN__
+#define LLONG_MAX  __LLONG_MAX__
+
+#define ULLONG_MIN  0ULL
+#define ULLONG_MAX  __ULLONG_MAX__
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/macros.h
===================================================================
--- abi/include/_bits/macros.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/macros.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,626 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ * Basic macro definitions and redefinitions that support basic C types.
+ *
+ * Both GCC and clang define macros for fixed-size integer names
+ * (e.g. __INT32_TYPE__ for int32_t). However, while clang also provides
+ * definitions for formatting macros (PRId32 et al.), GCC does not.
+ * This poses a subtle problem for diagnostics -- when 'int' and 'long int'
+ * have the same width, it's not possible to detect which one is used to
+ * define 'int32_t', but using a formatting specifier for 'int' on 'long int'
+ * value, or vice versa, causes a compiler warning. Analogous problem occurs
+ * with 'long int' and 'long long int', if they are the same size.
+ *
+ * In the interest of compatibility, we ignore the compiler's opinion on
+ * fixed-size types, and redefine the macros consistently.
+ *
+ * However, we can't do the same for 'size_t', 'ptrdiff_t', 'wchar_t', 'wint_t',
+ * 'intmax_t' and 'uintmax_t', since their format specifiers and other
+ * properties are built into the language and their identity is therefore
+ * determined by the compiler.
+ *
+ * We use some macros if they are present, but provide our own fallbacks when
+ * they are not. There are several macros that have to be predefined either by
+ * the compiler itself, or supplied by the build system if necessary
+ * (e.g. using the '-imacros' compiler argument). This is basically a subset
+ * of the common denominator of GCC and clang predefined macros at this moment.
+ *
+ * These required macros include:
+ *
+ *	__CHAR_BIT__
+ *	__SIZEOF_SHORT__
+ *	__SIZEOF_INT__
+ *	__SIZEOF_LONG__
+ *	__SIZEOF_LONG_LONG__
+ *	__SIZEOF_POINTER__
+ *
+ *	__SIZE_TYPE__
+ *	__SIZE_MAX__
+ *
+ *	__PTRDIFF_TYPE__
+ *	__PTRDIFF_MAX__
+ *
+ *	__WCHAR_TYPE__
+ *	__WCHAR_MAX__
+ *
+ *	__WINT_TYPE__
+ *	__WINT_MAX__ or
+ *	__WINT_WIDTH__ and __WINT_UNSIGNED__ when wint_t is unsigned
+ *
+ *	__INTMAX_TYPE__
+ *	__INTMAX_MAX__
+ *	either __INTMAX_C_SUFFIX__ or __INTMAX_C
+ *
+ *	__CHAR_UNSIGNED__ when char is unsigned
+ *
+ * After this header is processed, the following additional macros are
+ * guaranteed to be defined:
+ *
+ *	TODO: List them all.
+ *
+ */
+
+// TODO: add sig_atomic_t for compatibility with C language standard
+
+#ifndef _BITS_MACROS_H_
+#define _BITS_MACROS_H_
+
+#if __CHAR_BIT__ != 8
+#error HelenOS expects char that is 8 bits wide.
+#endif
+
+#ifndef __SCHAR_MAX__
+#define __SCHAR_MAX__  0x7f
+#endif
+
+#ifndef __SCHAR_MIN__
+#define __SCHAR_MIN__  (-__SCHAR_MAX__ - 1)
+#endif
+
+#ifndef __UCHAR_MAX__
+#define __UCHAR_MAX__  0xff
+#endif
+
+#ifndef __CHAR_MIN__
+#ifdef __CHAR_UNSIGNED__
+#define __CHAR_MIN__  0
+#else
+#define __CHAR_MIN__  __SCHAR_MIN__
+#endif
+#endif
+
+#ifndef __CHAR_MAX__
+#ifdef __CHAR_UNSIGNED__
+#define __CHAR_MAX__  __UCHAR_MAX__
+#else
+#define __CHAR_MAX__  __SCHAR_MAX__
+#endif
+#endif
+
+#undef __INT8_TYPE__
+#undef __INT8_C
+#undef __INT8_C_SUFFIX__
+#undef __INT8_MIN__
+#undef __INT8_MAX__
+
+#define __INT8_TYPE__  signed char
+#define __INT8_C(x)    x
+#define __INT8_MIN__   __SCHAR_MIN__
+#define __INT8_MAX__   __SCHAR_MAX__
+
+#undef __UINT8_TYPE__
+#undef __UINT8_C
+#undef __UINT8_C_SUFFIX__
+#undef __UINT8_MIN__
+#undef __UINT8_MAX__
+
+#define __UINT8_TYPE__  unsigned char
+#define __UINT8_C(x)    x
+#define __UINT8_MAX__   __UCHAR_MAX__
+
+#undef __PRId8__
+#undef __PRIi8__
+#undef __PRIu8__
+#undef __PRIo8__
+#undef __PRIx8__
+#undef __PRIX8__
+
+#define __PRId8__  "hhd"
+#define __PRIi8__  "hhi"
+#define __PRIu8__  "hhu"
+#define __PRIo8__  "hho"
+#define __PRIx8__  "hhx"
+#define __PRIX8__  "hhX"
+
+#undef __SCNd8__
+#undef __SCNi8__
+#undef __SCNu8__
+#undef __SCNo8__
+#undef __SCNx8__
+
+#define __SCNd8__  "hhd"
+#define __SCNi8__  "hhi"
+#define __SCNu8__  "hhu"
+#define __SCNo8__  "hho"
+#define __SCNx8__  "hhx"
+
+#if __SIZEOF_SHORT__ != 2
+#error HelenOS expects short that is 16 bits wide.
+#endif
+
+#ifndef __SHRT_MAX__
+#define __SHRT_MAX__  0x7fff
+#endif
+
+#ifndef __SHRT_MIN__
+#define __SHRT_MIN__  (-__SHRT_MAX__ - 1)
+#endif
+
+#ifndef __USHRT_MAX__
+#define __USHRT_MAX__  0xffff
+#endif
+
+#undef __INT16_TYPE__
+#undef __INT16_C
+#undef __INT16_C_SUFFIX__
+#undef __INT16_MIN__
+#undef __INT16_MAX__
+
+#define __INT16_TYPE__  short
+#define __INT16_C(x)    x
+#define __INT16_MIN__   __SHRT_MIN__
+#define __INT16_MAX__   __SHRT_MAX__
+
+#undef __UINT16_TYPE__
+#undef __UINT16_C
+#undef __UINT16_C_SUFFIX__
+#undef __UINT16_MIN__
+#undef __UINT16_MAX__
+
+#define __UINT16_TYPE__  unsigned short
+#define __UINT16_C(x)    x
+#define __UINT16_MAX__   __USHRT_MAX__
+
+#undef __PRId16__
+#undef __PRIi16__
+#undef __PRIu16__
+#undef __PRIo16__
+#undef __PRIx16__
+#undef __PRIX16__
+
+#define __PRId16__  "hd"
+#define __PRIi16__  "hi"
+#define __PRIu16__  "hu"
+#define __PRIo16__  "ho"
+#define __PRIx16__  "hx"
+#define __PRIX16__  "hX"
+
+#undef __SCNd16__
+#undef __SCNi16__
+#undef __SCNu16__
+#undef __SCNo16__
+#undef __SCNx16__
+
+#define __SCNd16__  "hd"
+#define __SCNi16__  "hi"
+#define __SCNu16__  "hu"
+#define __SCNo16__  "ho"
+#define __SCNx16__  "hx"
+
+#if __SIZEOF_INT__ != 4
+#error HelenOS expects int that is 32 bits wide.
+#endif
+
+#ifndef __INT_MAX__
+#define __INT_MAX__  0x7fffffff
+#endif
+
+#ifndef __INT_MIN__
+#define __INT_MIN__  (-__INT_MAX__ - 1)
+#endif
+
+#ifndef __UINT_MAX__
+#define __UINT_MAX__  0xffffffffU
+#endif
+
+#undef __INT32_TYPE__
+#undef __INT32_C
+#undef __INT32_C_SUFFIX__
+#undef __INT32_MIN__
+#undef __INT32_MAX__
+
+#define __INT32_TYPE__  int
+#define __INT32_C(x)    x
+#define __INT32_MIN__   __INT_MIN__
+#define __INT32_MAX__   __INT_MAX__
+
+#undef __UINT32_TYPE__
+#undef __UINT32_C
+#undef __UINT32_C_SUFFIX__
+#undef __UINT32_MIN__
+#undef __UINT32_MAX__
+
+#define __UINT32_TYPE__  unsigned int
+#define __UINT32_C(x)    x##U
+#define __UINT32_MAX__   __UINT_MAX__
+
+#undef __PRId32__
+#undef __PRIi32__
+#undef __PRIu32__
+#undef __PRIo32__
+#undef __PRIx32__
+#undef __PRIX32__
+
+#define __PRId32__  "d"
+#define __PRIi32__  "i"
+#define __PRIu32__  "u"
+#define __PRIo32__  "o"
+#define __PRIx32__  "x"
+#define __PRIX32__  "X"
+
+#undef __SCNd32__
+#undef __SCNi32__
+#undef __SCNu32__
+#undef __SCNo32__
+#undef __SCNx32__
+
+#define __SCNd32__  "d"
+#define __SCNi32__  "i"
+#define __SCNu32__  "u"
+#define __SCNo32__  "o"
+#define __SCNx32__  "x"
+
+#if __SIZEOF_LONG__ != __SIZEOF_POINTER__
+#error HelenOS expects long that has native width for the architecture.
+#endif
+
+#if __SIZEOF_POINTER__ < 4 || __SIZEOF_POINTER__ > 8
+#error HelenOS expects pointer width to be either 32 bits or 64 bits.
+#endif
+
+#ifndef __LONG_MAX__
+#if __SIZEOF_LONG__ == 4
+#define __LONG_MAX__  0x7fffffffL
+#elif __SIZEOF_LONG__ == 8
+#define __LONG_MAX__  0x7fffffffffffffffL
+#endif
+#endif
+
+#ifndef __LONG_MIN__
+#define __LONG_MIN__  (-__LONG_MAX__ - 1)
+#endif
+
+#ifndef __ULONG_MAX__
+#if __SIZEOF_LONG__ == 4
+#define __ULONG_MAX__  0xffffffffUL
+#elif __SIZEOF_LONG__ == 8
+#define __ULONG_MAX__  0xffffffffffffffffUL
+#endif
+#endif
+
+#undef __INTPTR_TYPE__
+#undef __INTPTR_C
+#undef __INTPTR_C_SUFFIX__
+#undef __INTPTR_MIN__
+#undef __INTPTR_MAX__
+#undef __UINTPTR_TYPE__
+#undef __UINTPTR_C
+#undef __UINTPTR_C_SUFFIX__
+#undef __UINTPTR_MIN__
+#undef __UINTPTR_MAX__
+#undef __PRIdPTR__
+#undef __PRIiPTR__
+#undef __PRIuPTR__
+#undef __PRIoPTR__
+#undef __PRIxPTR__
+#undef __PRIXPTR__
+#undef __SCNdPTR__
+#undef __SCNiPTR__
+#undef __SCNuPTR__
+#undef __SCNoPTR__
+#undef __SCNxPTR__
+
+#ifdef __intptr_is_long__
+
+#define __INTPTR_TYPE__   long
+#define __INTPTR_MIN__    __LONG_MIN__
+#define __INTPTR_MAX__    __LONG_MAX__
+#define __UINTPTR_TYPE__  unsigned long
+#define __UINTPTR_MAX__   __ULONG_MAX__
+
+#define __PRIdPTR__  "ld"
+#define __PRIiPTR__  "li"
+#define __PRIuPTR__  "lu"
+#define __PRIoPTR__  "lo"
+#define __PRIxPTR__  "lx"
+#define __PRIXPTR__  "lX"
+
+#define __SCNdPTR__  "ld"
+#define __SCNiPTR__  "li"
+#define __SCNuPTR__  "lu"
+#define __SCNoPTR__  "lo"
+#define __SCNxPTR__  "lx"
+
+#else
+
+// Original definition results in size_t and uintptr_t always having the same
+// type. We keep this definition for the time being, to avoid unnecessary noise.
+
+#define __INTPTR_TYPE__   __PTRDIFF_TYPE__
+#define __INTPTR_MIN__    __PTRDIFF_MIN__
+#define __INTPTR_MAX__    __PTRDIFF_MAX__
+#define __UINTPTR_TYPE__  __SIZE_TYPE__
+#define __UINTPTR_MAX__   __SIZE_MAX__
+
+#define __PRIdPTR__  "zd"
+#define __PRIiPTR__  "zi"
+#define __PRIuPTR__  "zu"
+#define __PRIoPTR__  "zo"
+#define __PRIxPTR__  "zx"
+#define __PRIXPTR__  "zX"
+
+#define __SCNdPTR__  "zd"
+#define __SCNiPTR__  "zi"
+#define __SCNuPTR__  "zu"
+#define __SCNoPTR__  "zo"
+#define __SCNxPTR__  "zx"
+
+#endif
+
+#if __SIZEOF_LONG_LONG__ != 8
+#error HelenOS expects long long that is 64 bits wide.
+#endif
+
+#ifndef __LLONG_MAX__
+#define __LLONG_MAX__  0x7fffffffffffffffLL
+#endif
+
+#ifndef __LLONG_MIN__
+#define __LLONG_MIN__  (-__LLONG_MAX__ - 1)
+#endif
+
+#ifndef __ULLONG_MAX__
+#define __ULLONG_MAX__  0xffffffffffffffffULL
+#endif
+
+#undef __INT64_TYPE__
+#undef __INT64_C
+#undef __INT64_C_SUFFIX__
+#undef __INT64_MIN__
+#undef __INT64_MAX__
+
+#define __INT64_TYPE__  long long
+#define __INT64_C(x)    x##LL
+#define __INT64_MIN__   __LLONG_MIN__
+#define __INT64_MAX__   __LLONG_MAX__
+
+#undef __UINT64_TYPE__
+#undef __UINT64_C
+#undef __UINT64_C_SUFFIX__
+#undef __UINT64_MIN__
+#undef __UINT64_MAX__
+
+#define __UINT64_TYPE__  unsigned long long
+#define __UINT64_C(x)    x##ULL
+#define __UINT64_MAX__   __ULLONG_MAX__
+
+#undef __PRId64__
+#undef __PRIi64__
+#undef __PRIu64__
+#undef __PRIo64__
+#undef __PRIx64__
+#undef __PRIX64__
+
+#define __PRId64__  "lld"
+#define __PRIi64__  "lli"
+#define __PRIu64__  "llu"
+#define __PRIo64__  "llo"
+#define __PRIx64__  "llx"
+#define __PRIX64__  "llX"
+
+#undef __SCNd64__
+#undef __SCNi64__
+#undef __SCNu64__
+#undef __SCNo64__
+#undef __SCNx64__
+
+#define __SCNd64__  "lld"
+#define __SCNi64__  "lli"
+#define __SCNu64__  "llu"
+#define __SCNo64__  "llo"
+#define __SCNx64__  "llx"
+
+#if !defined(__SIZE_TYPE__) || !defined(__SIZE_MAX__)
+#error HelenOS expects __SIZE_TYPE__ and __SIZE_MAX__ \
+    to be defined by the toolchain.
+#endif
+
+#if !defined(__PTRDIFF_TYPE__) || !defined(__PTRDIFF_MAX__)
+#error HelenOS expects __PTRDIFF_TYPE__ and __PTRDIFF_MAX__ \
+    to be defined by the toolchain.
+#endif
+
+#ifndef __PTRDIFF_MIN__
+#define __PTRDIFF_MIN__  (-__PTRDIFF_MAX__ - 1)
+#endif
+
+#if !defined(__WCHAR_TYPE__) || !defined(__WCHAR_MAX__)
+#error HelenOS expects __WCHAR_TYPE__ and __WCHAR_MAX__ \
+    to be defined by the toolchain.
+#endif
+
+#undef __WCHAR_SIGNED__
+#undef __WCHAR_UNSIGNED__
+
+#if __WCHAR_MAX__ == __INT32_MAX__
+#define __WCHAR_SIGNED__  1
+#elif __WCHAR_MAX__ == __UINT32_MAX__
+#define __WCHAR_UNSIGNED__  1
+#else
+#error HelenOS expects __WCHAR_TYPE__ to be 32 bits wide.
+#endif
+
+#ifndef __WCHAR_MIN__
+#ifdef __WCHAR_UNSIGNED__
+#define __WCHAR_MIN__  0
+#else
+#define __WCHAR_MIN__  (-__WCHAR_MAX__ - 1)
+#endif
+#endif
+
+#if !defined(__WINT_TYPE__) || !defined(__WINT_WIDTH__)
+#error HelenOS expects __WINT_TYPE__ and __WINT_WIDTH__ \
+    to be defined by the toolchain.
+#endif
+
+#if __WINT_WIDTH__ != 32
+#error HelenOS expects __WINT_TYPE__ to be 32 bits wide.
+#endif
+
+#undef __WINT_SIGNED__
+#undef __WINT_UNSIGNED__
+
+#if __WINT_MAX__ == __INT32_MAX__
+#define __WINT_SIGNED__  1
+#elif __WINT_MAX__ == __UINT32_MAX__
+#define __WINT_UNSIGNED__  1
+#elif defined(__WINT_MAX__)
+#error Unrecognized value of __WINT_MAX__
+#endif
+
+#ifndef __WINT_MAX__
+#ifdef __WINT_UNSIGNED__
+#define __WINT_MAX__  0xffffffffU
+#else
+#define __WINT_MAX__  0x7fffffff
+#endif
+#endif
+
+#ifndef __WINT_MIN__
+#ifdef __WINT_UNSIGNED__
+#define __WINT_MIN__  0
+#else
+#define __WINT_MIN__  (-__WINT_MAX__ - 1)
+#endif
+#endif
+
+#ifndef __WINT_EOF__
+#ifdef __WINT_UNSIGNED__
+#define __WINT_EOF__  __WINT_MAX__
+#else
+#define __WINT_EOF__  -1
+#endif
+#endif
+
+#if !defined(__INTMAX_TYPE__) || !defined(__INTMAX_MAX__)
+#error HelenOS expects __INTMAX_TYPE__ and __INTMAX_MAX__ \
+    to be defined by the toolchain.
+#endif
+
+#ifndef __INTMAX_MIN__
+#define __INTMAX_MIN__  (-__INTMAX_MAX__ - 1)
+#endif
+
+#ifndef __INTMAX_C
+#ifndef __INTMAX_C_SUFFIX__
+#error HelenOS expects __INTMAX_C or __INTMAX_C_SUFFIX__ \
+    to be defined by the toolchain.
+#endif
+#define __INTMAX_C__(x, y)  x##y
+#define __INTMAX_C(x)       __INTMAX_C__(x, __INTMAX_C_SUFFIX__)
+#endif
+
+#ifndef __UINTMAX_TYPE__
+#define __UINTMAX_TYPE__  unsigned __INTMAX_TYPE__
+#endif
+
+#ifndef __UINTMAX_C
+#ifdef __UINTMAX_C_SUFFIX__
+#define __UINTMAX_C__(x, y)  x##y
+#define __UINTMAX_C(x)       __UINTMAX_C__(x, __UINTMAX_C_SUFFIX__)
+#else
+#define __UINTMAX_C(x)  __INTMAX_C(x##U)
+#endif
+#endif
+
+#ifndef __UINTMAX_MAX__
+#define ___UNSIGNED_INTMAX_MAX___(x)  x##U
+#define __UINTMAX_MAX__  (2 * ___UNSIGNED_INTMAX_MAX___(__INTMAX_MAX__) + 1)
+#endif
+
+#undef __PRIdMAX__
+#undef __PRIiMAX__
+#undef __PRIuMAX__
+#undef __PRIoMAX__
+#undef __PRIxMAX__
+#undef __PRIXMAX__
+
+#define __PRIdMAX__  "jd"
+#define __PRIiMAX__  "ji"
+#define __PRIuMAX__  "ju"
+#define __PRIoMAX__  "jo"
+#define __PRIxMAX__  "jx"
+#define __PRIXMAX__  "jX"
+
+#undef __SCNdMAX__
+#undef __SCNiMAX__
+#undef __SCNuMAX__
+#undef __SCNoMAX__
+#undef __SCNxMAX__
+
+#define __SCNdMAX__  "jd"
+#define __SCNiMAX__  "ji"
+#define __SCNuMAX__  "ju"
+#define __SCNoMAX__  "jo"
+#define __SCNxMAX__  "jx"
+
+#ifndef __SIZEOF_FLOAT__
+#error HelenOS expects __SIZEOF_FLOAT__ to be defined.
+#endif
+
+#ifndef __SIZEOF_DOUBLE__
+#error HelenOS expects __SIZEOF_DOUBLE__ to be defined.
+#endif
+
+#ifndef __SIZEOF_LONG_DOUBLE__
+#error HelenOS expects __SIZEOF_LONG_DOUBLE__ to be defined.
+#endif
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/native.h
===================================================================
--- abi/include/_bits/native.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/native.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ * A bunch of type aliases HelenOS code uses.
+ *
+ * They were originally defined as either u/int32_t or u/int64_t,
+ * specifically for each architecture, but in practice they are
+ * currently assumed to be identical to u/intptr_t, so we do just that.
+ */
+
+#ifndef _BITS_NATIVE_H_
+#define _BITS_NATIVE_H_
+
+#include <_bits/macros.h>
+
+#define ATOMIC_COUNT_MIN  __UINTPTR_MIN__
+#define ATOMIC_COUNT_MAX  __UINTPTR_MAX__
+
+typedef __UINTPTR_TYPE__ pfn_t;
+typedef __UINTPTR_TYPE__ ipl_t;
+typedef __UINTPTR_TYPE__ sysarg_t;
+typedef __INTPTR_TYPE__  native_t;
+typedef __UINTPTR_TYPE__ atomic_count_t;
+typedef __INTPTR_TYPE__  atomic_signed_t;
+
+#define PRIdn  __PRIdPTR__  /**< Format for native_t. */
+#define PRIun  __PRIuPTR__  /**< Format for sysarg_t. */
+#define PRIxn  __PRIxPTR__  /**< Format for hexadecimal sysarg_t. */
+#define PRIua  __PRIuPTR__  /**< Format for atomic_count_t. */
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/ptrdiff_t.h
===================================================================
--- abi/include/_bits/ptrdiff_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/ptrdiff_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_PTRDIFF_T_H_
+#define _BITS_PTRDIFF_T_H_
+
+#include <_bits/macros.h>
+
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/size_t.h
===================================================================
--- abi/include/_bits/size_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/size_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_SIZE_T_H_
+#define _BITS_SIZE_T_H_
+
+#include <_bits/macros.h>
+
+typedef __SIZE_TYPE__ size_t;
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/ssize_t.h
===================================================================
--- abi/include/_bits/ssize_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/ssize_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_SSIZE_T_H_
+#define _BITS_SSIZE_T_H_
+
+#include <_bits/macros.h>
+
+typedef __PTRDIFF_TYPE__ ssize_t;
+
+#define SSIZE_MIN  __PTRDIFF_MIN__
+#define SSIZE_MAX  __PTRDIFF_MAX__
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/stdint.h
===================================================================
--- abi/include/_bits/stdint.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/stdint.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_STDINT_H_
+#define _BITS_STDINT_H_
+
+#include <_bits/macros.h>
+
+typedef __INT8_TYPE__ int8_t;
+typedef __INT8_TYPE__ int_least8_t;
+typedef __INT8_TYPE__ int_fast8_t;
+
+typedef __UINT8_TYPE__ uint8_t;
+typedef __UINT8_TYPE__ uint_least8_t;
+typedef __UINT8_TYPE__ uint_fast8_t;
+
+typedef __INT16_TYPE__ int16_t;
+typedef __INT16_TYPE__ int_least16_t;
+typedef __INT16_TYPE__ int_fast16_t;
+
+typedef __UINT16_TYPE__ uint16_t;
+typedef __UINT16_TYPE__ uint_least16_t;
+typedef __UINT16_TYPE__ uint_fast16_t;
+
+typedef __INT32_TYPE__ int32_t;
+typedef __INT32_TYPE__ int_least32_t;
+typedef __INT32_TYPE__ int_fast32_t;
+
+typedef __UINT32_TYPE__ uint32_t;
+typedef __UINT32_TYPE__ uint_least32_t;
+typedef __UINT32_TYPE__ uint_fast32_t;
+
+typedef __INT64_TYPE__ int64_t;
+typedef __INT64_TYPE__ int_least64_t;
+typedef __INT64_TYPE__ int_fast64_t;
+
+typedef __UINT64_TYPE__ uint64_t;
+typedef __UINT64_TYPE__ uint_least64_t;
+typedef __UINT64_TYPE__ uint_fast64_t;
+
+#define INT8_MIN        __INT8_MIN__
+#define INT_LEAST8_MIN  __INT8_MIN__
+#define INT_FAST8_MIN   __INT8_MIN__
+
+#define INT8_MAX        __INT8_MAX__
+#define INT_LEAST8_MAX  __INT8_MAX__
+#define INT_FAST8_MAX   __INT8_MAX__
+
+#define UINT8_MIN        __UINT8_C(0)
+#define UINT_LEAST8_MIN  __UINT8_C(0)
+#define UINT_FAST8_MIN   __UINT8_C(0)
+
+#define UINT8_MAX        __UINT8_MAX__
+#define UINT_LEAST8_MAX  __UINT8_MAX__
+#define UINT_FAST8_MAX   __UINT8_MAX__
+
+#define INT16_MIN        __INT16_MIN__
+#define INT_LEAST16_MIN  __INT16_MIN__
+#define INT_FAST16_MIN   __INT16_MIN__
+
+#define INT16_MAX        __INT16_MAX__
+#define INT_LEAST16_MAX  __INT16_MAX__
+#define INT_FAST16_MAX   __INT16_MAX__
+
+#define UINT16_MIN        __UINT16_C(0)
+#define UINT_LEAST16_MIN  __UINT16_C(0)
+#define UINT_FAST16_MIN   __UINT16_C(0)
+
+#define UINT16_MAX        __UINT16_MAX__
+#define UINT_LEAST16_MAX  __UINT16_MAX__
+#define UINT_FAST16_MAX   __UINT16_MAX__
+
+#define INT32_MIN        __INT32_MIN__
+#define INT_LEAST32_MIN  __INT32_MIN__
+#define INT_FAST32_MIN   __INT32_MIN__
+
+#define INT32_MAX        __INT32_MAX__
+#define INT_LEAST32_MAX  __INT32_MAX__
+#define INT_FAST32_MAX   __INT32_MAX__
+
+#define UINT32_MIN        __UINT32_C(0)
+#define UINT_LEAST32_MIN  __UINT32_C(0)
+#define UINT_FAST32_MIN   __UINT32_C(0)
+
+#define UINT32_MAX        __UINT32_MAX__
+#define UINT_LEAST32_MAX  __UINT32_MAX__
+#define UINT_FAST32_MAX   __UINT32_MAX__
+
+#define INT64_MIN        __INT64_MIN__
+#define INT_LEAST64_MIN  __INT64_MIN__
+#define INT_FAST64_MIN   __INT64_MIN__
+
+#define INT64_MAX        __INT64_MAX__
+#define INT_LEAST64_MAX  __INT64_MAX__
+#define INT_FAST64_MAX   __INT64_MAX__
+
+#define UINT64_MIN        __UINT64_C(0)
+#define UINT_LEAST64_MIN  __UINT64_C(0)
+#define UINT_FAST64_MIN   __UINT64_C(0)
+
+#define UINT64_MAX        __UINT64_MAX__
+#define UINT_LEAST64_MAX  __UINT64_MAX__
+#define UINT_FAST64_MAX   __UINT64_MAX__
+
+#define INT8_C(x)    __INT8_C(x)
+#define INT16_C(x)   __INT16_C(x)
+#define INT32_C(x)   __INT32_C(x)
+#define INT64_C(x)   __INT64_C(x)
+#define UINT8_C(x)   __UINT8_C(x)
+#define UINT16_C(x)  __UINT16_C(x)
+#define UINT32_C(x)  __UINT32_C(x)
+#define UINT64_C(x)  __UINT64_C(x)
+
+typedef __INTPTR_TYPE__  intptr_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+#define INTPTR_MIN   __INTPTR_MIN__
+#define INTPTR_MAX   __INTPTR_MAX__
+#define UINTPTR_MIN  __UINTPTR_C(0)
+#define UINTPTR_MAX  __UINTPTR_MAX__
+
+typedef __INTMAX_TYPE__  intmax_t;
+typedef __UINTMAX_TYPE__ uintmax_t;
+
+#define INTMAX_MIN   __INTMAX_MIN__
+#define INTMAX_MAX   __INTMAX_MAX__
+#define UINTMAX_MIN  __UINTMAX_C(0)
+#define UINTMAX_MAX  __UINTMAX_MAX__
+
+#define INTMAX_C(x)   __INTMAX_C(x)
+#define UINTMAX_C(x)  __UINTMAX_C(x)
+
+#define PTRDIFF_MIN  __PTRDIFF_MIN__
+#define PTRDIFF_MAX  __PTRDIFF_MAX__
+
+#define SIZE_MIN  0
+#define SIZE_MAX  __SIZE_MAX__
+
+#define WCHAR_MIN  __WCHAR_MIN__
+#define WCHAR_MAX  __WCHAR_MAX__
+
+#define WINT_MIN  __WINT_MIN__
+#define WINT_MAX  __WINT_MAX__
+
+/* Use nonstandard 128-bit types if they are supported by the compiler. */
+
+#ifdef __SIZEOF_INT128__
+typedef __int128 int128_t;
+typedef unsigned __int128 uint128_t;
+#endif
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/wchar_t.h
===================================================================
--- abi/include/_bits/wchar_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/wchar_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_WCHAR_T_H_
+#define _BITS_WCHAR_T_H_
+
+#include <_bits/macros.h>
+
+typedef __WCHAR_TYPE__ wchar_t;
+
+#endif
+
+/** @}
+ */
Index: abi/include/_bits/wint_t.h
===================================================================
--- abi/include/_bits/wint_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
+++ abi/include/_bits/wint_t.h	(revision 9ddcb0b4f918bbb21c6f46b9561e3b7e30f29b12)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017 CZ.NIC, z.s.p.o.
+ * 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.
+ */
+
+/* Authors:
+ *	Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
+ */
+
+/** @addtogroup bits
+ * @{
+ */
+/** @file
+ */
+
+#ifndef _BITS_WINT_T_H_
+#define _BITS_WINT_T_H_
+
+#include <_bits/macros.h>
+
+typedef __WINT_TYPE__ wint_t;
+
+#endif
+
+/** @}
+ */
