Add type limits and print/scan specifiers to <sys/types.h>.
This commit is contained in:
parent
ac7124e1e6
commit
bb84370c34
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
|
||||||
|
|
||||||
This file is part of Sortix.
|
This file is part of Sortix.
|
||||||
|
|
||||||
|
@ -27,60 +27,378 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
|
#include <__/limits.h>
|
||||||
#include <__/stdint.h>
|
#include <__/stdint.h>
|
||||||
#include <__/wordsize.h>
|
#include <__/wordsize.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
typedef __intmax_t __blkcnt_t;
|
typedef __intmax_t __blkcnt_t;
|
||||||
|
/*#define __BLKCNT_UNSIGNED*/
|
||||||
|
#define __BLKCNT_C(c) __INTMAX_C(c)
|
||||||
|
#define __BLKCNT_MIN __INTMAX_MIN
|
||||||
|
#define __BLKCNT_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdBLKCNT __PRIdMAX
|
||||||
|
#define __PRIiBLKCNT __PRIiMAX
|
||||||
|
#define __PRIoBLKCNT __PRIoMAX
|
||||||
|
#define __PRIuBLKCNT __PRIuMAX
|
||||||
|
#define __PRIxBLKCNT __PRIxMAX
|
||||||
|
#define __PRIXBLKCNT __PRIXMAX
|
||||||
|
#define __SCNdBLKCNT __SCNdMAX
|
||||||
|
#define __SCNiBLKCNT __SCNiMAX
|
||||||
|
#define __SCNoBLKCNT __SCNoMAX
|
||||||
|
#define __SCNuBLKCNT __SCNuMAX
|
||||||
|
#define __SCNxBLKCNT __SCNxMAX
|
||||||
|
|
||||||
typedef __intmax_t __blksize_t;
|
typedef __intmax_t __blksize_t;
|
||||||
|
/*#define __BLKSIZE_UNSIGNED*/
|
||||||
|
#define __BLKSIZE_C(c) __INTMAX_C(c)
|
||||||
|
#define __BLKSIZE_MIN __INTMAX_MIN
|
||||||
|
#define __BLKSIZE_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdBLKSIZE __PRIdMAX
|
||||||
|
#define __PRIiBLKSIZE __PRIiMAX
|
||||||
|
#define __PRIoBLKSIZE __PRIoMAX
|
||||||
|
#define __PRIuBLKSIZE __PRIuMAX
|
||||||
|
#define __PRIxBLKSIZE __PRIxMAX
|
||||||
|
#define __PRIXBLKSIZE __PRIXMAX
|
||||||
|
#define __SCNdBLKSIZE __SCNdMAX
|
||||||
|
#define __SCNiBLKSIZE __SCNiMAX
|
||||||
|
#define __SCNoBLKSIZE __SCNoMAX
|
||||||
|
#define __SCNuBLKSIZE __SCNuMAX
|
||||||
|
#define __SCNxBLKSIZE __SCNxMAX
|
||||||
|
|
||||||
typedef long __clock_t;
|
typedef long __clock_t;
|
||||||
|
/*#define __CLOCK_UNSIGNED*/
|
||||||
|
#define __CLOCK_C(c) c ## L
|
||||||
|
#define __CLOCK_MIN __LONG_MIN
|
||||||
|
#define __CLOCK_MAX __LONG_MAX
|
||||||
|
#define __PRIdCLOCK "ld"
|
||||||
|
#define __PRIiCLOCK "li"
|
||||||
|
#define __PRIoCLOCK "lo"
|
||||||
|
#define __PRIuCLOCK "lu"
|
||||||
|
#define __PRIxCLOCK "lx"
|
||||||
|
#define __PRIXCLOCK "lX"
|
||||||
|
#define __SCNdCLOCK "ld"
|
||||||
|
#define __SCNiCLOCK "li"
|
||||||
|
#define __SCNoCLOCK "lo"
|
||||||
|
#define __SCNuCLOCK "lu"
|
||||||
|
#define __SCNxCLOCK "lx"
|
||||||
|
|
||||||
typedef int __clockid_t;
|
typedef int __clockid_t;
|
||||||
|
/*#define __CLOCKID_UNSIGNED*/
|
||||||
|
#define __CLOCKID_C(c) c
|
||||||
|
#define __CLOCKID_MIN __INT_MIN
|
||||||
|
#define __CLOCKID_MAX __INT_MAX
|
||||||
|
#define __PRIdCLOCKID "d"
|
||||||
|
#define __PRIiCLOCKID "i"
|
||||||
|
#define __PRIoCLOCKID "o"
|
||||||
|
#define __PRIuCLOCKID "u"
|
||||||
|
#define __PRIxCLOCKID "x"
|
||||||
|
#define __PRIXCLOCKID "X"
|
||||||
|
#define __SCNdCLOCKID "d"
|
||||||
|
#define __SCNiCLOCKID "i"
|
||||||
|
#define __SCNoCLOCKID "o"
|
||||||
|
#define __SCNuCLOCKID "u"
|
||||||
|
#define __SCNxCLOCKID "x"
|
||||||
|
|
||||||
typedef __uintptr_t __dev_t;
|
typedef __uintptr_t __dev_t;
|
||||||
|
#define __DEV_UNSIGNED
|
||||||
|
#define __DEV_C(c) __UINTPTR_C(c)
|
||||||
|
#define __DEV_MIN 0
|
||||||
|
#define __DEV_MAX __UINTPTR_MAX
|
||||||
|
#define __PRIdDEV __PRIdPTR
|
||||||
|
#define __PRIiDEV __PRIiPTR
|
||||||
|
#define __PRIoDEV __PRIoPTR
|
||||||
|
#define __PRIuDEV __PRIuPTR
|
||||||
|
#define __PRIxDEV __PRIxPTR
|
||||||
|
#define __PRIXDEV __PRIXPTR
|
||||||
|
#define __SCNdDEV __SCNdPTR
|
||||||
|
#define __SCNiDEV __SCNiPTR
|
||||||
|
#define __SCNoDEV __SCNoPTR
|
||||||
|
#define __SCNuDEV __SCNuPTR
|
||||||
|
#define __SCNxDEV __SCNxPTR
|
||||||
|
|
||||||
typedef __intmax_t __fsblkcnt_t;
|
typedef __intmax_t __fsblkcnt_t;
|
||||||
|
/*#define __FSBLKCNT_UNSIGNED*/
|
||||||
|
#define __FSBLKCNT_C(c) __INTMAX_C(c)
|
||||||
|
#define __FSBLKCNT_MIN __INTMAX_MIN
|
||||||
|
#define __FSBLKCNT_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdFSBLKCNT __PRIdMAX
|
||||||
|
#define __PRIiFSBLKCNT __PRIiMAX
|
||||||
|
#define __PRIoFSBLKCNT __PRIoMAX
|
||||||
|
#define __PRIuFSBLKCNT __PRIuMAX
|
||||||
|
#define __PRIxFSBLKCNT __PRIxMAX
|
||||||
|
#define __PRIXFSBLKCNT __PRIXMAX
|
||||||
|
#define __SCNdFSBLKCNT __SCNdMAX
|
||||||
|
#define __SCNiFSBLKCNT __SCNiMAX
|
||||||
|
#define __SCNoFSBLKCNT __SCNoMAX
|
||||||
|
#define __SCNuFSBLKCNT __SCNuMAX
|
||||||
|
#define __SCNxFSBLKCNT __SCNxMAX
|
||||||
|
|
||||||
typedef __intmax_t __fsfilcnt_t;
|
typedef __intmax_t __fsfilcnt_t;
|
||||||
|
/*#define __FSFILCNT_UNSIGNED*/
|
||||||
|
#define __FSFILCNT_C(c) __INTMAX_C(c)
|
||||||
|
#define __FSFILCNT_MIN __INTMAX_MIN
|
||||||
|
#define __FSFILCNT_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdFSFILCNT __PRIdMAX
|
||||||
|
#define __PRIiFSFILCNT __PRIiMAX
|
||||||
|
#define __PRIoFSFILCNT __PRIoMAX
|
||||||
|
#define __PRIuFSFILCNT __PRIuMAX
|
||||||
|
#define __PRIxFSFILCNT __PRIxMAX
|
||||||
|
#define __PRIXFSFILCNT __PRIXMAX
|
||||||
|
#define __SCNdFSFILCNT __SCNdMAX
|
||||||
|
#define __SCNiFSFILCNT __SCNiMAX
|
||||||
|
#define __SCNoFSFILCNT __SCNoMAX
|
||||||
|
#define __SCNuFSFILCNT __SCNuMAX
|
||||||
|
#define __SCNxFSFILCNT __SCNxMAX
|
||||||
|
|
||||||
typedef __uint64_t __gid_t;
|
typedef __uint64_t __gid_t;
|
||||||
|
#define __GID_UNSIGNED
|
||||||
|
#define __GID_C(c) __UINT64_C(c)
|
||||||
|
#define __GID_MIN 0
|
||||||
|
#define __GID_MAX __UINT64_MAX
|
||||||
|
#define __PRIdGID __PRId64
|
||||||
|
#define __PRIiGID __PRIi64
|
||||||
|
#define __PRIoGID __PRIo64
|
||||||
|
#define __PRIuGID __PRIu64
|
||||||
|
#define __PRIxGID __PRIx64
|
||||||
|
#define __PRIXGID __PRIX64
|
||||||
|
#define __SCNdGID __SCNd64
|
||||||
|
#define __SCNiGID __SCNi64
|
||||||
|
#define __SCNoGID __SCNo64
|
||||||
|
#define __SCNuGID __SCNu64
|
||||||
|
#define __SCNxGID __SCNx64
|
||||||
|
|
||||||
typedef __uint64_t __id_t;
|
typedef __uint64_t __id_t;
|
||||||
|
#define __ID_UNSIGNED
|
||||||
|
#define __ID_C(c) __UINT64_C(c)
|
||||||
|
#define __ID_MIN 0
|
||||||
|
#define __ID_MAX __UINT64_MAX
|
||||||
|
#define __PRIdID __PRId64
|
||||||
|
#define __PRIiID __PRIi64
|
||||||
|
#define __PRIoID __PRIo64
|
||||||
|
#define __PRIuID __PRIu64
|
||||||
|
#define __PRIxID __PRIx64
|
||||||
|
#define __PRIXID __PRIX64
|
||||||
|
#define __SCNdID __SCNd64
|
||||||
|
#define __SCNiID __SCNi64
|
||||||
|
#define __SCNoID __SCNo64
|
||||||
|
#define __SCNuID __SCNu64
|
||||||
|
#define __SCNxID __SCNx64
|
||||||
|
|
||||||
typedef __uintmax_t __ino_t;
|
typedef __uintmax_t __ino_t;
|
||||||
|
#define __INO_UNSIGNED
|
||||||
|
#define __INO_C(c) __INTMAX_C(c)
|
||||||
|
#define __INO_MIN __INTMAX_MIN
|
||||||
|
#define __INO_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdINO __PRIdMAX
|
||||||
|
#define __PRIiINO __PRIiMAX
|
||||||
|
#define __PRIoINO __PRIoMAX
|
||||||
|
#define __PRIuINO __PRIuMAX
|
||||||
|
#define __PRIxINO __PRIxMAX
|
||||||
|
#define __PRIXINO __PRIXMAX
|
||||||
|
#define __SCNdINO __SCNdMAX
|
||||||
|
#define __SCNiINO __SCNiMAX
|
||||||
|
#define __SCNoINO __SCNoMAX
|
||||||
|
#define __SCNuINO __SCNuMAX
|
||||||
|
#define __SCNxINO __SCNxMAX
|
||||||
|
|
||||||
/* TODO: __key_t */
|
/* TODO: __key_t */
|
||||||
|
|
||||||
typedef unsigned int __mode_t;
|
typedef unsigned int __mode_t;
|
||||||
|
#define __MODE_UNSIGNED
|
||||||
|
#define __MODE_C(c) c ## U
|
||||||
|
#define __MODE_MIN 0
|
||||||
|
#define __MODE_MAX __UINT_MAX
|
||||||
|
#define __PRIdMODE "d"
|
||||||
|
#define __PRIiMODE "i"
|
||||||
|
#define __PRIoMODE "o"
|
||||||
|
#define __PRIuMODE "u"
|
||||||
|
#define __PRIxMODE "x"
|
||||||
|
#define __PRIXMODE "X"
|
||||||
|
#define __SCNdMODE "d"
|
||||||
|
#define __SCNiMODE "i"
|
||||||
|
#define __SCNoMODE "o"
|
||||||
|
#define __SCNuMODE "u"
|
||||||
|
#define __SCNxMODE "x"
|
||||||
|
|
||||||
typedef unsigned int __nlink_t;
|
typedef unsigned int __nlink_t;
|
||||||
|
#define __NLINK_UNSIGNED
|
||||||
|
#define __NLINK_C(c) c ## U
|
||||||
|
#define __NLINK_MIN 0
|
||||||
|
#define __NLINK_MAX __UINT_MAX
|
||||||
|
#define __PRIdNLINK "d"
|
||||||
|
#define __PRIiNLINK "i"
|
||||||
|
#define __PRIoNLINK "o"
|
||||||
|
#define __PRIuNLINK "u"
|
||||||
|
#define __PRIxNLINK "x"
|
||||||
|
#define __PRIXNLINK "X"
|
||||||
|
#define __SCNdNLINK "d"
|
||||||
|
#define __SCNiNLINK "i"
|
||||||
|
#define __SCNoNLINK "o"
|
||||||
|
#define __SCNuNLINK "u"
|
||||||
|
#define __SCNxNLINK "x"
|
||||||
|
|
||||||
typedef __intmax_t __off_t;
|
typedef __intmax_t __off_t;
|
||||||
|
/*#define __OFF_UNSIGNED*/
|
||||||
|
#define __OFF_C(c) __INTMAX_C(c)
|
||||||
#define __OFF_MIN __INTMAX_MIN
|
#define __OFF_MIN __INTMAX_MIN
|
||||||
#define __OFF_MAX __INTMAX_MAX
|
#define __OFF_MAX __INTMAX_MAX
|
||||||
|
#define __PRIdOFF __PRIdMAX
|
||||||
|
#define __PRIiOFF __PRIiMAX
|
||||||
|
#define __PRIoOFF __PRIoMAX
|
||||||
|
#define __PRIuOFF __PRIuMAX
|
||||||
|
#define __PRIxOFF __PRIxMAX
|
||||||
|
#define __PRIXOFF __PRIXMAX
|
||||||
|
#define __SCNdOFF __SCNdMAX
|
||||||
|
#define __SCNiOFF __SCNiMAX
|
||||||
|
#define __SCNoOFF __SCNoMAX
|
||||||
|
#define __SCNuOFF __SCNuMAX
|
||||||
|
#define __SCNxOFF __SCNxMAX
|
||||||
|
|
||||||
typedef __intptr_t __pid_t;
|
typedef __intptr_t __pid_t;
|
||||||
|
/*#define __PID_UNSIGNED*/
|
||||||
|
#define __PID_C(c) __INTPTR_C(c)
|
||||||
|
#define __PID_MIN __INTPTR_MIN
|
||||||
|
#define __PID_MAX __INTPTR_MAX
|
||||||
|
#define __PRIdPID __PRIdPTR
|
||||||
|
#define __PRIiPID __PRIiPTR
|
||||||
|
#define __PRIoPID __PRIoPTR
|
||||||
|
#define __PRIuPID __PRIuPTR
|
||||||
|
#define __PRIxPID __PRIxPTR
|
||||||
|
#define __PRIXPID __PRIXPTR
|
||||||
|
#define __SCNdPID __SCNdPTR
|
||||||
|
#define __SCNiPID __SCNiPTR
|
||||||
|
#define __SCNoPID __SCNoPTR
|
||||||
|
#define __SCNuPID __SCNuPTR
|
||||||
|
#define __SCNxPID __SCNxPTR
|
||||||
|
|
||||||
/* TODO: __size_t */
|
/* TODO: __size_t */
|
||||||
|
|
||||||
typedef __SIZE_TYPE__ __socklen_t;
|
typedef __SIZE_TYPE__ __socklen_t;
|
||||||
|
#define __SOCKLEN_UNSIGNED
|
||||||
|
/* TODO: Get this from a __SIZE_C */
|
||||||
|
#if defined(__i386__)
|
||||||
|
#define __SOCKLEN_C(c) c ## u
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
#define __SOCKLEN_C(c) c ## ul
|
||||||
|
#else
|
||||||
|
#error "You need to provide __SOCKLEN_C for your platform"
|
||||||
|
#endif
|
||||||
|
#define __SOCKLEN_MIN 0
|
||||||
|
#define __SOCKLEN_MAX __SIZE_MAX__
|
||||||
|
#define __PRIdSOCKLEN "zd"
|
||||||
|
#define __PRIiSOCKLEN "zi"
|
||||||
|
#define __PRIoSOCKLEN "zo"
|
||||||
|
#define __PRIuSOCKLEN "zu"
|
||||||
|
#define __PRIxSOCKLEN "zx"
|
||||||
|
#define __PRIXSOCKLEN "zX"
|
||||||
|
#define __SCNdSOCKLEN "zd"
|
||||||
|
#define __SCNiSOCKLEN "zi"
|
||||||
|
#define __SCNoSOCKLEN "zo"
|
||||||
|
#define __SCNuSOCKLEN "zu"
|
||||||
|
#define __SCNxSOCKLEN "zx"
|
||||||
|
|
||||||
typedef __SSIZE_TYPE__ __ssize_t;
|
typedef __SSIZE_TYPE__ __ssize_t;
|
||||||
|
/*#define __SSIZE_UNSIGNED*/
|
||||||
|
/* TODO: Get this from a __SSIZE_C */
|
||||||
|
#if defined(__i386__)
|
||||||
|
#define __SSIZE_C(c) c
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
#define __SSIZE_C(c) c ## l
|
||||||
|
#else
|
||||||
|
#error "You need to provide __SSIZE_C for your platform"
|
||||||
|
#endif
|
||||||
|
#if defined(__i386__)
|
||||||
|
#define __SSIZE_MIN __INT_MIN
|
||||||
|
#define __SSIZE_MAX __INT_MAX
|
||||||
|
#elif defined(__x86_64__)
|
||||||
|
#define __SSIZE_MIN __LONG_MIN
|
||||||
|
#define __SSIZE_MAX __LONG_MAX
|
||||||
|
#else
|
||||||
|
#error "You need to provide __SSIZE_MIN and __SSIZE_MAX for your platform"
|
||||||
|
#endif
|
||||||
|
#define __PRIdSSIZE "zd"
|
||||||
|
#define __PRIiSSIZE "zi"
|
||||||
|
#define __PRIoSSIZE "zo"
|
||||||
|
#define __PRIuSSIZE "zu"
|
||||||
|
#define __PRIxSSIZE "zx"
|
||||||
|
#define __PRIXSSIZE "zX"
|
||||||
|
#define __SCNdSSIZE "zd"
|
||||||
|
#define __SCNiSSIZE "zi"
|
||||||
|
#define __SCNoSSIZE "zo"
|
||||||
|
#define __SCNuSSIZE "zu"
|
||||||
|
#define __SCNxSSIZE "zx"
|
||||||
|
|
||||||
typedef long __suseconds_t;
|
typedef long __suseconds_t;
|
||||||
|
/*#define __SUSECONDS_UNSIGNED*/
|
||||||
|
#define __SUSECONDS_C(c) c ## L
|
||||||
|
#define __SUSECONDS_MIN __LONG_MIN
|
||||||
|
#define __SUSECONDS_MAX __LONG_MAX
|
||||||
|
#define __PRIdSUSECONDS "ld"
|
||||||
|
#define __PRIiSUSECONDS "li"
|
||||||
|
#define __PRIoSUSECONDS "lo"
|
||||||
|
#define __PRIuSUSECONDS "lu"
|
||||||
|
#define __PRIxSUSECONDS "lx"
|
||||||
|
#define __PRIXSUSECONDS "lX"
|
||||||
|
#define __SCNdSUSECONDS "ld"
|
||||||
|
#define __SCNiSUSECONDS "li"
|
||||||
|
#define __SCNoSUSECONDS "lo"
|
||||||
|
#define __SCNuSUSECONDS "lu"
|
||||||
|
#define __SCNxSUSECONDS "lx"
|
||||||
|
|
||||||
typedef __int64_t __time_t;
|
typedef __int64_t __time_t;
|
||||||
|
/*#define __TIME_UNSIGNED*/
|
||||||
|
#define __TIME_C(c) __INT64_C(c)
|
||||||
|
#define __TIME_MIN __INT64_MIN
|
||||||
|
#define __TIME_MAX __INT64_MAX
|
||||||
|
#define __PRIdTIME __PRId64
|
||||||
|
#define __PRIiTIME __PRIi64
|
||||||
|
#define __PRIoTIME __PRIo64
|
||||||
|
#define __PRIuTIME __PRIu64
|
||||||
|
#define __PRIxTIME __PRIx64
|
||||||
|
#define __PRIXTIME __PRIX64
|
||||||
|
#define __SCNdTIME __SCNd64
|
||||||
|
#define __SCNiTIME __SCNi64
|
||||||
|
#define __SCNoTIME __SCNo64
|
||||||
|
#define __SCNuTIME __SCNu64
|
||||||
|
#define __SCNxTIME __SCNx64
|
||||||
|
|
||||||
typedef __uintptr_t __timer_t;
|
typedef __uintptr_t __timer_t;
|
||||||
|
#define __TIMER_UNSIGNED
|
||||||
|
#define __TIMER_C(c) __UINTPTR_C(c)
|
||||||
|
#define __TIMER_MIN 0
|
||||||
|
#define __TIMER_MAX __UINTPTR_MAX
|
||||||
|
#define __PRIdTIMER __PRIdPTR
|
||||||
|
#define __PRIiTIMER __PRIiPTR
|
||||||
|
#define __PRIoTIMER __PRIoPTR
|
||||||
|
#define __PRIuTIMER __PRIuPTR
|
||||||
|
#define __PRIxTIMER __PRIxPTR
|
||||||
|
#define __PRIXTIMER __PRIXPTR
|
||||||
|
#define __SCNdTIMER __SCNdPTR
|
||||||
|
#define __SCNiTIMER __SCNiPTR
|
||||||
|
#define __SCNoTIMER __SCNoPTR
|
||||||
|
#define __SCNuTIMER __SCNuPTR
|
||||||
|
#define __SCNxTIMER __SCNxPTR
|
||||||
|
|
||||||
/* TODO: trace*_t */
|
/* TODO: trace*_t */
|
||||||
|
|
||||||
typedef __uint64_t __uid_t;
|
typedef __uint64_t __uid_t;
|
||||||
|
#define __UID_UNSIGNED
|
||||||
typedef unsigned int __useconds_t;
|
#define __UID_C(c) __UINT64_C(c)
|
||||||
|
#define __UID_MIN 0
|
||||||
|
#define __UID_MAX __UINT64_MAX
|
||||||
|
#define __PRIdUID __PRId64
|
||||||
|
#define __PRIiUID __PRIi64
|
||||||
|
#define __PRIoUID __PRIo64
|
||||||
|
#define __PRIuUID __PRIu64
|
||||||
|
#define __PRIxUID __PRIx64
|
||||||
|
#define __PRIXUID __PRIX64
|
||||||
|
#define __SCNdUID __SCNd64
|
||||||
|
#define __SCNiUID __SCNi64
|
||||||
|
#define __SCNoUID __SCNo64
|
||||||
|
#define __SCNuUID __SCNu64
|
||||||
|
#define __SCNxUID __SCNx64
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -25,7 +25,49 @@
|
||||||
#ifndef INCLUDE____LIMITS_H
|
#ifndef INCLUDE____LIMITS_H
|
||||||
#define INCLUDE____LIMITS_H
|
#define INCLUDE____LIMITS_H
|
||||||
|
|
||||||
/* Hack: Cooperate with the compiler and provide more stuff here. */
|
/* char */
|
||||||
#define __INT_MAX (2147483647)
|
#define __CHAR_BIT __CHAR_BIT__
|
||||||
|
#define __SCHAR_MIN (-__SCHAR_MAX - 1)
|
||||||
|
#define __SCHAR_MAX __SCHAR_MAX__
|
||||||
|
#if __SCHAR_MAX__ == __INT_MAX__
|
||||||
|
#define __UCHAR_MAX (__SCHAR_MAX * 2U + 1U)
|
||||||
|
#else
|
||||||
|
#define __UCHAR_MAX (__SCHAR_MAX * 2 + 1)
|
||||||
|
#endif
|
||||||
|
#ifdef __CHAR_UNSIGNED__
|
||||||
|
#if __SCHAR_MAX__ == __INT_MAX__
|
||||||
|
#define __CHAR_MIN 0U
|
||||||
|
#else
|
||||||
|
#define __CHAR_MIN 0
|
||||||
|
#endif
|
||||||
|
#define __CHAR_MAX __UCHAR_MAX
|
||||||
|
#else
|
||||||
|
#define __CHAR_MIN __SCHAR_MIN
|
||||||
|
#define __CHAR_MAX __SCHAR_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* short */
|
||||||
|
#define __SHRT_MIN (-__SHRT_MAX - 1)
|
||||||
|
#define __SHRT_MAX __SHRT_MAX__
|
||||||
|
#if __SHRT_MAX__ == __INT_MAX__
|
||||||
|
#define __USHRT_MAX (__SHRT_MAX * 2U + 1U)
|
||||||
|
#else
|
||||||
|
#define __USHRT_MAX (__SHRT_MAX * 2 + 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* int */
|
||||||
|
#define __INT_MIN (-__INT_MAX - 1)
|
||||||
|
#define __INT_MAX __INT_MAX__
|
||||||
|
#define __UINT_MAX (__INT_MAX * 2U + 1U)
|
||||||
|
|
||||||
|
/* long */
|
||||||
|
#define __LONG_MIN (-__LONG_MAX - 1L)
|
||||||
|
#define __LONG_MAX __LONG_MAX__
|
||||||
|
#define __ULONG_MAX (__LONG_MAX * 2UL + 1UL)
|
||||||
|
|
||||||
|
/* long long */
|
||||||
|
#define __LLONG_MIN (-__LLONG_MAX - 1LL)
|
||||||
|
#define __LLONG_MAX __LONG_LONG_MAX__
|
||||||
|
#define __ULLONG_MAX (__LLONG_MAX * 2ULL + 1ULL)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -498,15 +498,7 @@ typedef long long unsigned int __uintmax_t;
|
||||||
#define __SIG_ATOMIC_MAX (2147483647)
|
#define __SIG_ATOMIC_MAX (2147483647)
|
||||||
|
|
||||||
/* TODO: Should these come from a <__stddef.h>? */
|
/* TODO: Should these come from a <__stddef.h>? */
|
||||||
#if __WORDSIZE == 64
|
#define __SIZE_MAX __SIZE_MAX__
|
||||||
#define __SIZE_MAX (18446744073709551615UL)
|
|
||||||
#define __SSIZE_MIN (-9223372036854775807L-1)
|
|
||||||
#define __SSIZE_MAX (9223372036854775807L)
|
|
||||||
#else
|
|
||||||
#define __SIZE_MAX (4294967295U)
|
|
||||||
#define __SSIZE_MIN (-2147483647-1)
|
|
||||||
#define __SSIZE_MAX (2147483647)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,6 @@ __BEGIN_DECLS
|
||||||
#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX
|
#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX
|
||||||
|
|
||||||
#define SIZE_MAX __SIZE_MAX
|
#define SIZE_MAX __SIZE_MAX
|
||||||
/* TODO: Should SSIZE_MIN and SSIZE_MAX be declared here? */
|
|
||||||
#define SSIZE_MIN __SSIZE_MIN
|
|
||||||
#define SSIZE_MAX __SSIZE_MAX
|
|
||||||
|
|
||||||
#ifndef WCHAR_MIN
|
#ifndef WCHAR_MIN
|
||||||
#define WCHAR_MIN __WCHAR_MIN
|
#define WCHAR_MIN __WCHAR_MIN
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
||||||
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013.
|
Copyright(C) Jonas 'Sortie' Termansen 2011, 2012, 2013, 2014.
|
||||||
|
|
||||||
This file is part of the Sortix C Library.
|
This file is part of the Sortix C Library.
|
||||||
|
|
||||||
|
@ -38,51 +38,211 @@ __BEGIN_DECLS
|
||||||
#define __blkcnt_t_defined
|
#define __blkcnt_t_defined
|
||||||
typedef __blkcnt_t blkcnt_t;
|
typedef __blkcnt_t blkcnt_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define BLKCNT_C(c) __BLKCNT_C(c)
|
||||||
|
#define BLKCNT_MIN __BLKCNT_MIN
|
||||||
|
#define BLKCNT_MAX __BLKCNT_MAX
|
||||||
|
#define PRIdBLKCNT __PRIdBLKCNT
|
||||||
|
#define PRIiBLKCNT __PRIiBLKCNT
|
||||||
|
#define PRIoBLKCNT __PRIoBLKCNT
|
||||||
|
#define PRIuBLKCNT __PRIuBLKCNT
|
||||||
|
#define PRIxBLKCNT __PRIxBLKCNT
|
||||||
|
#define PRIXBLKCNT __PRIXBLKCNT
|
||||||
|
#define SCNdBLKCNT __SCNdBLKCNT
|
||||||
|
#define SCNiBLKCNT __SCNiBLKCNT
|
||||||
|
#define SCNoBLKCNT __SCNoBLKCNT
|
||||||
|
#define SCNuBLKCNT __SCNuBLKCNT
|
||||||
|
#define SCNxBLKCNT __SCNxBLKCNT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __blksize_t_defined
|
#ifndef __blksize_t_defined
|
||||||
#define __blksize_t_defined
|
#define __blksize_t_defined
|
||||||
typedef __blksize_t blksize_t;
|
typedef __blksize_t blksize_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define BLKSIZE_C(c) __BLKSIZE_C(c)
|
||||||
|
#define BLKSIZE_MIN __BLKSIZE_MIN
|
||||||
|
#define BLKSIZE_MAX __BLKSIZE_MAX
|
||||||
|
#define PRIdBLKSIZE __PRIdBLKSIZE
|
||||||
|
#define PRIiBLKSIZE __PRIiBLKSIZE
|
||||||
|
#define PRIoBLKSIZE __PRIoBLKSIZE
|
||||||
|
#define PRIuBLKSIZE __PRIuBLKSIZE
|
||||||
|
#define PRIxBLKSIZE __PRIxBLKSIZE
|
||||||
|
#define PRIXBLKSIZE __PRIXBLKSIZE
|
||||||
|
#define SCNdBLKSIZE __SCNdBLKSIZE
|
||||||
|
#define SCNiBLKSIZE __SCNiBLKSIZE
|
||||||
|
#define SCNoBLKSIZE __SCNoBLKSIZE
|
||||||
|
#define SCNuBLKSIZE __SCNuBLKSIZE
|
||||||
|
#define SCNxBLKSIZE __SCNxBLKSIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __clock_t_defined
|
#ifndef __clock_t_defined
|
||||||
#define __clock_t_defined
|
#define __clock_t_defined
|
||||||
typedef __clock_t clock_t;
|
typedef __clock_t clock_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define CLOCK_C(c) __CLOCK_C(c)
|
||||||
|
#define CLOCK_MIN __CLOCK_MIN
|
||||||
|
#define CLOCK_MAX __CLOCK_MAX
|
||||||
|
#define PRIdCLOCK __PRIdCLOCK
|
||||||
|
#define PRIiCLOCK __PRIiCLOCK
|
||||||
|
#define PRIoCLOCK __PRIoCLOCK
|
||||||
|
#define PRIuCLOCK __PRIuCLOCK
|
||||||
|
#define PRIxCLOCK __PRIxCLOCK
|
||||||
|
#define PRIXCLOCK __PRIXCLOCK
|
||||||
|
#define SCNdCLOCK __SCNdCLOCK
|
||||||
|
#define SCNiCLOCK __SCNiCLOCK
|
||||||
|
#define SCNoCLOCK __SCNoCLOCK
|
||||||
|
#define SCNuCLOCK __SCNuCLOCK
|
||||||
|
#define SCNxCLOCK __SCNxCLOCK
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __clockid_t_defined
|
#ifndef __clockid_t_defined
|
||||||
#define __clockid_t_defined
|
#define __clockid_t_defined
|
||||||
typedef __clockid_t clockid_t;
|
typedef __clockid_t clockid_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define CLOCKID_C(c) __CLOCKID_C(c)
|
||||||
|
#define CLOCKID_MIN __CLOCKID_MIN
|
||||||
|
#define CLOCKID_MAX __CLOCKID_MAX
|
||||||
|
#define PRIdCLOCKID __PRIdCLOCKID
|
||||||
|
#define PRIiCLOCKID __PRIiCLOCKID
|
||||||
|
#define PRIoCLOCKID __PRIoCLOCKID
|
||||||
|
#define PRIuCLOCKID __PRIuCLOCKID
|
||||||
|
#define PRIxCLOCKID __PRIxCLOCKID
|
||||||
|
#define PRIXCLOCKID __PRIXCLOCKID
|
||||||
|
#define SCNdCLOCKID __SCNdCLOCKID
|
||||||
|
#define SCNiCLOCKID __SCNiCLOCKID
|
||||||
|
#define SCNoCLOCKID __SCNoCLOCKID
|
||||||
|
#define SCNuCLOCKID __SCNuCLOCKID
|
||||||
|
#define SCNxCLOCKID __SCNxCLOCKID
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __dev_t_defined
|
#ifndef __dev_t_defined
|
||||||
#define __dev_t_defined
|
#define __dev_t_defined
|
||||||
typedef __dev_t dev_t;
|
typedef __dev_t dev_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define DEV_C(c) __DEV_C(c)
|
||||||
|
#define DEV_MIN __DEV_MIN
|
||||||
|
#define DEV_MAX __DEV_MAX
|
||||||
|
#define PRIdDEV __PRIdDEV
|
||||||
|
#define PRIiDEV __PRIiDEV
|
||||||
|
#define PRIoDEV __PRIoDEV
|
||||||
|
#define PRIuDEV __PRIuDEV
|
||||||
|
#define PRIxDEV __PRIxDEV
|
||||||
|
#define PRIXDEV __PRIXDEV
|
||||||
|
#define SCNdDEV __SCNdDEV
|
||||||
|
#define SCNiDEV __SCNiDEV
|
||||||
|
#define SCNoDEV __SCNoDEV
|
||||||
|
#define SCNuDEV __SCNuDEV
|
||||||
|
#define SCNxDEV __SCNxDEV
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __fsblkcnt_t_defined
|
#ifndef __fsblkcnt_t_defined
|
||||||
#define __fsblkcnt_t_defined
|
#define __fsblkcnt_t_defined
|
||||||
typedef __fsblkcnt_t fsblkcnt_t;
|
typedef __fsblkcnt_t fsblkcnt_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define FSBLKCNT_C(c) __FSBLKCNT_C(c)
|
||||||
|
#define FSBLKCNT_MIN __FSBLKCNT_MIN
|
||||||
|
#define FSBLKCNT_MAX __FSBLKCNT_MAX
|
||||||
|
#define PRIdFSBLKCNT __PRIdFSBLKCNT
|
||||||
|
#define PRIiFSBLKCNT __PRIiFSBLKCNT
|
||||||
|
#define PRIoFSBLKCNT __PRIoFSBLKCNT
|
||||||
|
#define PRIuFSBLKCNT __PRIuFSBLKCNT
|
||||||
|
#define PRIxFSBLKCNT __PRIxFSBLKCNT
|
||||||
|
#define PRIXFSBLKCNT __PRIXFSBLKCNT
|
||||||
|
#define SCNdFSBLKCNT __SCNdFSBLKCNT
|
||||||
|
#define SCNiFSBLKCNT __SCNiFSBLKCNT
|
||||||
|
#define SCNoFSBLKCNT __SCNoFSBLKCNT
|
||||||
|
#define SCNuFSBLKCNT __SCNuFSBLKCNT
|
||||||
|
#define SCNxFSBLKCNT __SCNxFSBLKCNT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __fsfilcnt_t_defined
|
#ifndef __fsfilcnt_t_defined
|
||||||
#define __fsfilcnt_t_defined
|
#define __fsfilcnt_t_defined
|
||||||
typedef __fsfilcnt_t fsfilcnt_t;
|
typedef __fsfilcnt_t fsfilcnt_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define FSFILCNT_C(c) __FSFILCNT_C(c)
|
||||||
|
#define FSFILCNT_MIN __FSFILCNT_MIN
|
||||||
|
#define FSFILCNT_MAX __FSFILCNT_MAX
|
||||||
|
#define PRIdFSFILCNT __PRIdFSFILCNT
|
||||||
|
#define PRIiFSFILCNT __PRIiFSFILCNT
|
||||||
|
#define PRIoFSFILCNT __PRIoFSFILCNT
|
||||||
|
#define PRIuFSFILCNT __PRIuFSFILCNT
|
||||||
|
#define PRIxFSFILCNT __PRIxFSFILCNT
|
||||||
|
#define PRIXFSFILCNT __PRIXFSFILCNT
|
||||||
|
#define SCNdFSFILCNT __SCNdFSFILCNT
|
||||||
|
#define SCNiFSFILCNT __SCNiFSFILCNT
|
||||||
|
#define SCNoFSFILCNT __SCNoFSFILCNT
|
||||||
|
#define SCNuFSFILCNT __SCNuFSFILCNT
|
||||||
|
#define SCNxFSFILCNT __SCNxFSFILCNT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __gid_t_defined
|
#ifndef __gid_t_defined
|
||||||
#define __gid_t_defined
|
#define __gid_t_defined
|
||||||
typedef __gid_t gid_t;
|
typedef __gid_t gid_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define GID_C(c) __GID_C(c)
|
||||||
|
#define GID_MIN __GID_MIN
|
||||||
|
#define GID_MAX __GID_MAX
|
||||||
|
#define PRIdGID __PRIdGID
|
||||||
|
#define PRIiGID __PRIiGID
|
||||||
|
#define PRIoGID __PRIoGID
|
||||||
|
#define PRIuGID __PRIuGID
|
||||||
|
#define PRIxGID __PRIxGID
|
||||||
|
#define PRIXGID __PRIXGID
|
||||||
|
#define SCNdGID __SCNdGID
|
||||||
|
#define SCNiGID __SCNiGID
|
||||||
|
#define SCNoGID __SCNoGID
|
||||||
|
#define SCNuGID __SCNuGID
|
||||||
|
#define SCNxGID __SCNxGID
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __id_t_defined
|
#ifndef __id_t_defined
|
||||||
#define __id_t_defined
|
#define __id_t_defined
|
||||||
typedef __id_t id_t;
|
typedef __id_t id_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define ID_C(c) __ID_C(c)
|
||||||
|
#define ID_MIN __ID_MIN
|
||||||
|
#define ID_MAX __ID_MAX
|
||||||
|
#define PRIdID __PRIdID
|
||||||
|
#define PRIiID __PRIiID
|
||||||
|
#define PRIoID __PRIoID
|
||||||
|
#define PRIuID __PRIuID
|
||||||
|
#define PRIxID __PRIxID
|
||||||
|
#define PRIXID __PRIXID
|
||||||
|
#define SCNdID __SCNdID
|
||||||
|
#define SCNiID __SCNiID
|
||||||
|
#define SCNoID __SCNoID
|
||||||
|
#define SCNuID __SCNuID
|
||||||
|
#define SCNxID __SCNxID
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __ino_t_defined
|
#ifndef __ino_t_defined
|
||||||
#define __ino_t_defined
|
#define __ino_t_defined
|
||||||
typedef __ino_t ino_t;
|
typedef __ino_t ino_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define INO_C(c) __INO_C(c)
|
||||||
|
#define INO_MIN __INO_MIN
|
||||||
|
#define INO_MAX __INO_MAX
|
||||||
|
#define PRIdINO __PRIdINO
|
||||||
|
#define PRIiINO __PRIiINO
|
||||||
|
#define PRIoINO __PRIoINO
|
||||||
|
#define PRIuINO __PRIuINO
|
||||||
|
#define PRIxINO __PRIxINO
|
||||||
|
#define PRIXINO __PRIXINO
|
||||||
|
#define SCNdINO __SCNdINO
|
||||||
|
#define SCNiINO __SCNiINO
|
||||||
|
#define SCNoINO __SCNoINO
|
||||||
|
#define SCNuINO __SCNuINO
|
||||||
|
#define SCNxINO __SCNxINO
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TODO: key_t */
|
/* TODO: key_t */
|
||||||
|
|
||||||
|
@ -90,51 +250,194 @@ typedef __ino_t ino_t;
|
||||||
#define __mode_t_defined
|
#define __mode_t_defined
|
||||||
typedef __mode_t mode_t;
|
typedef __mode_t mode_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define MODE_C(c) __MODE_C(c)
|
||||||
|
#define MODE_MIN __MODE_MIN
|
||||||
|
#define MODE_MAX __MODE_MAX
|
||||||
|
#define PRIdMODE __PRIdMODE
|
||||||
|
#define PRIiMODE __PRIiMODE
|
||||||
|
#define PRIoMODE __PRIoMODE
|
||||||
|
#define PRIuMODE __PRIuMODE
|
||||||
|
#define PRIxMODE __PRIxMODE
|
||||||
|
#define PRIXMODE __PRIXMODE
|
||||||
|
#define SCNdMODE __SCNdMODE
|
||||||
|
#define SCNiMODE __SCNiMODE
|
||||||
|
#define SCNoMODE __SCNoMODE
|
||||||
|
#define SCNuMODE __SCNuMODE
|
||||||
|
#define SCNxMODE __SCNxMODE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __nlink_t_defined
|
#ifndef __nlink_t_defined
|
||||||
#define __nlink_t_defined
|
#define __nlink_t_defined
|
||||||
typedef __nlink_t nlink_t;
|
typedef __nlink_t nlink_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define NLINK_C(c) __NLINK_C(c)
|
||||||
|
#define NLINK_MIN __NLINK_MIN
|
||||||
|
#define NLINK_MAX __NLINK_MAX
|
||||||
|
#define PRIdNLINK __PRIdNLINK
|
||||||
|
#define PRIiNLINK __PRIiNLINK
|
||||||
|
#define PRIoNLINK __PRIoNLINK
|
||||||
|
#define PRIuNLINK __PRIuNLINK
|
||||||
|
#define PRIxNLINK __PRIxNLINK
|
||||||
|
#define PRIXNLINK __PRIXNLINK
|
||||||
|
#define SCNdNLINK __SCNdNLINK
|
||||||
|
#define SCNiNLINK __SCNiNLINK
|
||||||
|
#define SCNoNLINK __SCNoNLINK
|
||||||
|
#define SCNuNLINK __SCNuNLINK
|
||||||
|
#define SCNxNLINK __SCNxNLINK
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __off_t_defined
|
#ifndef __off_t_defined
|
||||||
#define __off_t_defined
|
#define __off_t_defined
|
||||||
typedef __off_t off_t;
|
typedef __off_t off_t;
|
||||||
#endif
|
#endif
|
||||||
#if defined(__is_sortix_kernel) || defined(__is_sortix_libc)
|
#if __USE_SORTIX
|
||||||
|
#define OFF_C(c) __OFF_C(c)
|
||||||
#define OFF_MIN __OFF_MIN
|
#define OFF_MIN __OFF_MIN
|
||||||
#define OFF_MAX __OFF_MAX
|
#define OFF_MAX __OFF_MAX
|
||||||
|
#define PRIdOFF __PRIdOFF
|
||||||
|
#define PRIiOFF __PRIiOFF
|
||||||
|
#define PRIoOFF __PRIoOFF
|
||||||
|
#define PRIuOFF __PRIuOFF
|
||||||
|
#define PRIxOFF __PRIxOFF
|
||||||
|
#define PRIXOFF __PRIXOFF
|
||||||
|
#define SCNdOFF __SCNdOFF
|
||||||
|
#define SCNiOFF __SCNiOFF
|
||||||
|
#define SCNoOFF __SCNoOFF
|
||||||
|
#define SCNuOFF __SCNuOFF
|
||||||
|
#define SCNxOFF __SCNxOFF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __pid_t_defined
|
#ifndef __pid_t_defined
|
||||||
#define __pid_t_defined
|
#define __pid_t_defined
|
||||||
typedef __pid_t pid_t;
|
typedef __pid_t pid_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define PID_C(c) __PID_C(c)
|
||||||
|
#define PID_MIN __PID_MIN
|
||||||
|
#define PID_MAX __PID_MAX
|
||||||
|
#define PRIdPID __PRIdPID
|
||||||
|
#define PRIiPID __PRIiPID
|
||||||
|
#define PRIoPID __PRIoPID
|
||||||
|
#define PRIuPID __PRIuPID
|
||||||
|
#define PRIxPID __PRIxPID
|
||||||
|
#define PRIXPID __PRIXPID
|
||||||
|
#define SCNdPID __SCNdPID
|
||||||
|
#define SCNiPID __SCNiPID
|
||||||
|
#define SCNoPID __SCNoPID
|
||||||
|
#define SCNuPID __SCNuPID
|
||||||
|
#define SCNxPID __SCNxPID
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __size_t_defined
|
#ifndef __size_t_defined
|
||||||
#define __size_t_defined
|
#define __size_t_defined
|
||||||
#define __need_size_t
|
#define __need_size_t
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define SOCKLEN_C(c) __SOCKLEN_C(c)
|
||||||
|
#define SOCKLEN_MIN __SOCKLEN_MIN
|
||||||
|
#define SOCKLEN_MAX __SOCKLEN_MAX
|
||||||
|
#define PRIdSOCKLEN __PRIdSOCKLEN
|
||||||
|
#define PRIiSOCKLEN __PRIiSOCKLEN
|
||||||
|
#define PRIoSOCKLEN __PRIoSOCKLEN
|
||||||
|
#define PRIuSOCKLEN __PRIuSOCKLEN
|
||||||
|
#define PRIxSOCKLEN __PRIxSOCKLEN
|
||||||
|
#define PRIXSOCKLEN __PRIXSOCKLEN
|
||||||
|
#define SCNdSOCKLEN __SCNdSOCKLEN
|
||||||
|
#define SCNiSOCKLEN __SCNiSOCKLEN
|
||||||
|
#define SCNoSOCKLEN __SCNoSOCKLEN
|
||||||
|
#define SCNuSOCKLEN __SCNuSOCKLEN
|
||||||
|
#define SCNxSOCKLEN __SCNxSOCKLEN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __ssize_t_defined
|
#ifndef __ssize_t_defined
|
||||||
#define __ssize_t_defined
|
#define __ssize_t_defined
|
||||||
typedef __ssize_t ssize_t;
|
typedef __ssize_t ssize_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define SSIZE_C(c) __SSIZE_C(c)
|
||||||
|
#define SSIZE_MIN __SSIZE_MIN
|
||||||
|
#if !defined(SSIZE_MAX) /* Also in <limits.h> */
|
||||||
|
#define SSIZE_MAX __SSIZE_MAX
|
||||||
|
#endif
|
||||||
|
#define PRIdSSIZE __PRIdSSIZE
|
||||||
|
#define PRIiSSIZE __PRIiSSIZE
|
||||||
|
#define PRIoSSIZE __PRIoSSIZE
|
||||||
|
#define PRIuSSIZE __PRIuSSIZE
|
||||||
|
#define PRIxSSIZE __PRIxSSIZE
|
||||||
|
#define PRIXSSIZE __PRIXSSIZE
|
||||||
|
#define SCNdSSIZE __SCNdSSIZE
|
||||||
|
#define SCNiSSIZE __SCNiSSIZE
|
||||||
|
#define SCNoSSIZE __SCNoSSIZE
|
||||||
|
#define SCNuSSIZE __SCNuSSIZE
|
||||||
|
#define SCNxSSIZE __SCNxSSIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __suseconds_t_defined
|
#ifndef __suseconds_t_defined
|
||||||
#define __suseconds_t_defined
|
#define __suseconds_t_defined
|
||||||
typedef __suseconds_t suseconds_t;
|
typedef __suseconds_t suseconds_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define SUSECONDS_C(c) __SUSECONDS_C(c)
|
||||||
|
#define SUSECONDS_MIN __SUSECONDS_MIN
|
||||||
|
#define SUSECONDS_MAX __SUSECONDS_MAX
|
||||||
|
#define PRIdSUSECONDS __PRIdSUSECONDS
|
||||||
|
#define PRIiSUSECONDS __PRIiSUSECONDS
|
||||||
|
#define PRIoSUSECONDS __PRIoSUSECONDS
|
||||||
|
#define PRIuSUSECONDS __PRIuSUSECONDS
|
||||||
|
#define PRIxSUSECONDS __PRIxSUSECONDS
|
||||||
|
#define PRIXSUSECONDS __PRIXSUSECONDS
|
||||||
|
#define SCNdSUSECONDS __SCNdSUSECONDS
|
||||||
|
#define SCNiSUSECONDS __SCNiSUSECONDS
|
||||||
|
#define SCNoSUSECONDS __SCNoSUSECONDS
|
||||||
|
#define SCNuSUSECONDS __SCNuSUSECONDS
|
||||||
|
#define SCNxSUSECONDS __SCNxSUSECONDS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __time_t_defined
|
#ifndef __time_t_defined
|
||||||
#define __time_t_defined
|
#define __time_t_defined
|
||||||
typedef __time_t time_t;
|
typedef __time_t time_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define TIME_C(c) __TIME_C(c)
|
||||||
|
#define TIME_MIN __TIME_MIN
|
||||||
|
#define TIME_MAX __TIME_MAX
|
||||||
|
#define PRIdTIME __PRIdTIME
|
||||||
|
#define PRIiTIME __PRIiTIME
|
||||||
|
#define PRIoTIME __PRIoTIME
|
||||||
|
#define PRIuTIME __PRIuTIME
|
||||||
|
#define PRIxTIME __PRIxTIME
|
||||||
|
#define PRIXTIME __PRIXTIME
|
||||||
|
#define SCNdTIME __SCNdTIME
|
||||||
|
#define SCNiTIME __SCNiTIME
|
||||||
|
#define SCNoTIME __SCNoTIME
|
||||||
|
#define SCNuTIME __SCNuTIME
|
||||||
|
#define SCNxTIME __SCNxTIME
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __timer_t_defined
|
#ifndef __timer_t_defined
|
||||||
#define __timer_t_defined
|
#define __timer_t_defined
|
||||||
typedef __timer_t timer_t;
|
typedef __timer_t timer_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
|
#define TIMER_C(c) __TIMER_C(c)
|
||||||
|
#define TIMER_MIN __TIMER_MIN
|
||||||
|
/* TODO: TIMER_MAX here conflicts with POSIX TIMER_MAX in <limits.h>. */
|
||||||
|
#define TIMER_MAX __TIMER_MAX
|
||||||
|
#define PRIdTIMER __PRIdTIMER
|
||||||
|
#define PRIiTIMER __PRIiTIMER
|
||||||
|
#define PRIoTIMER __PRIoTIMER
|
||||||
|
#define PRIuTIMER __PRIuTIMER
|
||||||
|
#define PRIxTIMER __PRIxTIMER
|
||||||
|
#define PRIXTIMER __PRIXTIMER
|
||||||
|
#define SCNdTIMER __SCNdTIMER
|
||||||
|
#define SCNiTIMER __SCNiTIMER
|
||||||
|
#define SCNoTIMER __SCNoTIMER
|
||||||
|
#define SCNuTIMER __SCNuTIMER
|
||||||
|
#define SCNxTIMER __SCNxTIMER
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TODO: trace*_t */
|
/* TODO: trace*_t */
|
||||||
|
|
||||||
|
@ -142,10 +445,21 @@ typedef __timer_t timer_t;
|
||||||
#define __uid_t_defined
|
#define __uid_t_defined
|
||||||
typedef __uid_t uid_t;
|
typedef __uid_t uid_t;
|
||||||
#endif
|
#endif
|
||||||
|
#if __USE_SORTIX
|
||||||
#ifndef __useconds_t_defined
|
#define UID_C(c) __UID_C(c)
|
||||||
#define __useconds_t_defined
|
#define UID_MIN __UID_MIN
|
||||||
typedef __useconds_t useconds_t;
|
#define UID_MAX __UID_MAX
|
||||||
|
#define PRIdUID __PRIdUID
|
||||||
|
#define PRIiUID __PRIiUID
|
||||||
|
#define PRIoUID __PRIoUID
|
||||||
|
#define PRIuUID __PRIuUID
|
||||||
|
#define PRIxUID __PRIxUID
|
||||||
|
#define PRIXUID __PRIXUID
|
||||||
|
#define SCNdUID __SCNdUID
|
||||||
|
#define SCNiUID __SCNiUID
|
||||||
|
#define SCNoUID __SCNoUID
|
||||||
|
#define SCNuUID __SCNuUID
|
||||||
|
#define SCNxUID __SCNxUID
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __STDC_HOSTED__
|
#if __STDC_HOSTED__
|
||||||
|
|
|
@ -389,11 +389,6 @@ typedef __off_t off_t;
|
||||||
typedef __pid_t pid_t;
|
typedef __pid_t pid_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __useconds_t_defined
|
|
||||||
#define __useconds_t_defined
|
|
||||||
typedef __useconds_t useconds_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* TODO: intptr_t is not declared because <stdint.h> doesn't allow other headers
|
/* TODO: intptr_t is not declared because <stdint.h> doesn't allow other headers
|
||||||
to define some, but not all, of the fixed width types. Additionally,
|
to define some, but not all, of the fixed width types. Additionally,
|
||||||
intptr_t was only added for the sake of sbrk(), but that was removed in
|
intptr_t was only added for the sake of sbrk(), but that was removed in
|
||||||
|
@ -558,6 +553,7 @@ char* get_current_dir_name(void);
|
||||||
int getdomainname(char*, size_t);
|
int getdomainname(char*, size_t);
|
||||||
int pipe2(int [2], int);
|
int pipe2(int [2], int);
|
||||||
void* sbrk(__intptr_t increment);
|
void* sbrk(__intptr_t increment);
|
||||||
|
typedef unsigned int useconds_t;
|
||||||
int usleep(useconds_t useconds);
|
int usleep(useconds_t useconds);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,11 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,10 @@
|
||||||
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue