1
0
Fork 0
forked from nuttx/nuttx-update

Fix some of the SIZE_MAX definitions updated in a recent commit

This commit is contained in:
Gregory Nutt 2014-01-08 08:25:46 -06:00
parent 2060d75ba2
commit 8e1b493786
3 changed files with 24 additions and 18 deletions

View file

@ -123,11 +123,22 @@
#define _POSIX_OPEN_MAX CONFIG_NFILE_DESCRIPTORS
#define _POSIX_PATH_MAX CONFIG_PATH_MAX
#define _POSIX_PIPE_BUF 512
#define _POSIX_SSIZE_MAX INT_MAX
#define _POSIX_STREAM_MAX CONFIG_NFILE_STREAMS
#define _POSIX_TZNAME_MAX 3
/* Requred for sigqueue */
#ifdef CONFIG_SMALL_MEMORY
#define _POSIX_SSIZE_MAX 32767 /* See sys/types.h */
#define _POSIX_SSIZE_MIN -32768
#else /* CONFIG_SMALL_MEMORY */
#define _POSIX_SSIZE_MAX 2147483647 /* See sys/types.h */
#define _POSIX_SSIZE_MIN -2147483648
#endif /* CONFIG_SMALL_MEMORY */
/* Required for sigqueue */
#define _POSIX_RTSIG_MAX 31
#define _POSIX_SIGQUEUE_MAX 32
@ -184,6 +195,7 @@
#define PATH_MAX _POSIX_PATH_MAX
#define PIPE_BUF _POSIX_PIPE_BUF
#define SSIZE_MAX _POSIX_SSIZE_MAX
#define SSIZE_MIN _POSIX_SSIZE_MIN
#define STREAM_MAX _POSIX_STREAM_MAX
#define TZNAME_MAX _POSIX_TZNAME_MAX

View file

@ -185,10 +185,16 @@
#endif
#ifdef CONFIG_SMALL_MEMORY
# define SIZE_MAX 0xffff
#else
# define SIZE_MAX 0xffffffff
#endif
#define SIZE_MAX UINT16_MAX /* See sys/types.h */
#define RSIZE_MAX UINT16_MAX
#else /* CONFIG_SMALL_MEMORY */
#define SIZE_MAX UINT32_MAX /* See sys/types.h */
#define RSIZE_MAX UINT32_MAX
#endif /* CONFIG_SMALL_MEMORY */
#if 0
# define WCHAR_MIN

View file

@ -133,26 +133,14 @@ typedef unsigned int mode_t;
#ifdef CONFIG_SMALL_MEMORY
#define SIZE_MAX UINT16_MAX
typedef uint16_t size_t;
#define SSIZE_MAX INT16_MAX
#define SSIZE_MIN INT16_MIN
typedef int16_t ssize_t;
#define RSIZE_MAX UINT16_MAX
typedef uint16_t rsize_t;
#else /* CONFIG_SMALL_MEMORY */
#define SIZE_MAX UINT32_MAX
typedef uint32_t size_t;
#define SSIZE_MAX INT32_MAX
#define SSIZE_MIN INT32_MIN
typedef int32_t ssize_t;
#define RSIZE_MAX UINT32_MAX
typedef uint32_t rsize_t;
#endif /* CONFIG_SMALL_MEMORY */