limits.h: define PAGE_SIZE only if XSI is requested
limits.h is part of the C standard, but POSIX and XSI extend it with various defines. We should not add these unless the application requests support for them. In this case, PAGE_SIZE should only be defined if XSI support is requested by defining _XOPEN_SOURCE. Note that PAGESIZE (plain POSIX for the same thing) and B_PAGE_SIZE are alternatives that remain available.
This commit is contained in:
@@ -38,12 +38,11 @@
|
|||||||
#define NAME_MAX (256)
|
#define NAME_MAX (256)
|
||||||
#define NGROUPS_MAX (32)
|
#define NGROUPS_MAX (32)
|
||||||
#define OPEN_MAX (128)
|
#define OPEN_MAX (128)
|
||||||
#define PAGE_SIZE (4096)
|
|
||||||
#define PAGESIZE (4096)
|
#define PAGESIZE (4096)
|
||||||
#define PATH_MAX (1024)
|
#define PATH_MAX (1024)
|
||||||
#define PIPE_MAX (512)
|
#define PIPE_MAX (512)
|
||||||
#define PTHREAD_KEYS_MAX 256
|
#define PTHREAD_KEYS_MAX 256
|
||||||
#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
|
#define PTHREAD_STACK_MIN (2 * PAGESIZE)
|
||||||
#define SSIZE_MAX __HAIKU_SADDR_MAX
|
#define SSIZE_MAX __HAIKU_SADDR_MAX
|
||||||
#define TTY_NAME_MAX (256)
|
#define TTY_NAME_MAX (256)
|
||||||
#define TZNAME_MAX (32)
|
#define TZNAME_MAX (32)
|
||||||
@@ -76,6 +75,13 @@
|
|||||||
|
|
||||||
#define _POSIX2_LINE_MAX (2048)
|
#define _POSIX2_LINE_MAX (2048)
|
||||||
|
|
||||||
|
/* The XSI name for PAGESIZE, with extra underscore included. Only define if
|
||||||
|
* _XOPEN_SOURCE was requested, otherwise it could conflict with the application.
|
||||||
|
*/
|
||||||
|
#ifdef _XOPEN_SOURCE
|
||||||
|
#define PAGE_SIZE PAGESIZE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
|
/* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
|
||||||
* collisions with any defines in this file.
|
* collisions with any defines in this file.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user