xref: /haiku/headers/posix/limits.h (revision dbe86e463874f0bac3f3de4c4e294dbf3e9f43d0)
1 /*
2  * Copyright 2001-2020 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _LIBC_LIMITS_H_
6 #define _LIBC_LIMITS_H_
7 	/* Note: The header guard is checked in gcc's limits.h. */
8 
9 
10 #include <config/types.h>
11 
12 #include <float.h>		/* for DBL_DIG, FLT_DIG, etc */
13 
14 #include __HAIKU_ARCH_HEADER(limits.h)
15 
16 
17 #define LONGLONG_MIN    (-9223372036854775807LL - 1)  /* these are Be specific */
18 #define LONGLONG_MAX    (9223372036854775807LL)
19 #define ULONGLONG_MAX   (0xffffffffffffffffULL)
20 
21 #define	ULLONG_MAX		ULONGLONG_MAX
22 #define	LLONG_MAX		LONGLONG_MAX
23 #define	LLONG_MIN		LONGLONG_MIN
24 
25 #define MB_LEN_MAX		16
26 
27 #define OFF_MAX			LLONG_MAX
28 #define OFF_MIN			LLONG_MIN
29 
30 #define ARG_MAX			 		(128 * 1024)
31 #define ATEXIT_MAX			 	(32)
32 #define CHILD_MAX				(1024)
33 #define IOV_MAX					(1024)
34 #define FILESIZEBITS			(64)
35 #define HOST_NAME_MAX			(255)
36 #define LINE_MAX				(2048)
37 #define LINK_MAX				(1)
38 #define LOGIN_NAME_MAX			(32)
39 #define MAX_CANON		   		(255)
40 #define MAX_INPUT				(255)
41 #define NAME_MAX				(256)
42 #define NGROUPS_MAX		 		(32)
43 #define OPEN_MAX				(128)
44 #define PATH_MAX				(1024)
45 #define PIPE_BUF				(4 * 1024)
46 #define PIPE_MAX				(512)
47 #define PTHREAD_KEYS_MAX		(256)
48 #define PTHREAD_STACK_MIN		(2 * PAGESIZE)
49 #define PTHREAD_DESTRUCTOR_ITERATIONS	(4)
50 #define SSIZE_MAX		  		__HAIKU_SADDR_MAX
51 #define TTY_NAME_MAX			(256)
52 #define TZNAME_MAX		  		(32)
53 #define	SYMLINK_MAX				(1024)
54 #define	SYMLOOP_MAX				(16)
55 
56 #define _POSIX_ARG_MAX	  		(128 * 1024)
57 #define _POSIX_CHILD_MAX		(1024)
58 #define _POSIX_HOST_NAME_MAX	(255)
59 #define _POSIX_LINK_MAX	 		(1)
60 #define _POSIX_LOGIN_NAME_MAX	(9)
61 #define _POSIX_MAX_CANON		(255)
62 #define _POSIX_MAX_INPUT		(255)
63 #define _POSIX_NAME_MAX	 		(255)
64 #define _POSIX_NGROUPS_MAX  	(8)
65 #define _POSIX_OPEN_MAX	 		(128)
66 #define _POSIX_PATH_MAX	 		(1024)
67 #define _POSIX_PIPE_BUF	 		(512)
68 #define _POSIX_SSIZE_MAX		__HAIKU_SADDR_MAX
69 #define _POSIX_STREAM_MAX   	(8)
70 #define _POSIX_TTY_NAME_MAX		(256)
71 #define _POSIX_TZNAME_MAX   	(3)
72 #define _POSIX_SEM_VALUE_MAX	INT_MAX
73 #define	_POSIX_SIGQUEUE_MAX		32
74 #define _POSIX_RTSIG_MAX		8
75 #define _POSIX_CLOCKRES_MIN		20000000
76 #define _POSIX_TIMER_MAX		32
77 #define _POSIX_DELAYTIMER_MAX	32
78 #define _POSIX_SEM_NSEMS_MAX	(256)
79 
80 #define _POSIX2_LINE_MAX		(2048)
81 
82 #define	BC_BASE_MAX				(99)
83 #define BC_DIM_MAX				(2048)
84 #define BC_SCALE_MAX			(99)
85 #define BC_STRING_MAX			(1000)
86 
87 
88 #define COLL_WEIGHTS_MAX		(10)
89 #define	EXPR_NEST_MAX			(32)
90 #define	LINE_MAX				(2048)
91 
92 #define MQ_OPEN_MAX				(0) /* MSG */
93 #define MQ_PRIO_MAX				(0) /* MSG */
94 
95 #define	RE_DUP_MAX				(0x7fff)
96 
97 #ifdef _XOPEN_SOURCE
98 /* The XSI name for PAGESIZE, with extra underscore included. Only define if
99  * _XOPEN_SOURCE was requested, otherwise it could conflict with the application.
100  */
101 #define PAGE_SIZE				PAGESIZE
102 /* XSI extension: Default process priority. This is used by the implementation
103  * of getpriority(), setpriority() and nice(). */
104 #define NZERO					20
105 #endif
106 
107 /* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
108  * collisions with any defines in this file.
109  */
110 #ifndef _GCC_LIMITS_H_
111 #	include_next <limits.h>
112 #endif
113 
114 #endif /* _LIBC_LIMITS_H_ */
115