xref: /haiku/headers/posix/limits.h (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
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 SSIZE_MAX		  		__HAIKU_SADDR_MAX
50 #define TTY_NAME_MAX			(256)
51 #define TZNAME_MAX		  		(32)
52 #define	SYMLINK_MAX				(1024)
53 #define	SYMLOOP_MAX				(16)
54 
55 #define _POSIX_ARG_MAX	  		(128 * 1024)
56 #define _POSIX_CHILD_MAX		(1024)
57 #define _POSIX_HOST_NAME_MAX	(255)
58 #define _POSIX_LINK_MAX	 		(1)
59 #define _POSIX_LOGIN_NAME_MAX	(9)
60 #define _POSIX_MAX_CANON		(255)
61 #define _POSIX_MAX_INPUT		(255)
62 #define _POSIX_NAME_MAX	 		(255)
63 #define _POSIX_NGROUPS_MAX  	(8)
64 #define _POSIX_OPEN_MAX	 		(128)
65 #define _POSIX_PATH_MAX	 		(1024)
66 #define _POSIX_PIPE_BUF	 		(512)
67 #define _POSIX_SSIZE_MAX		__HAIKU_SADDR_MAX
68 #define _POSIX_STREAM_MAX   	(8)
69 #define _POSIX_TTY_NAME_MAX		(256)
70 #define _POSIX_TZNAME_MAX   	(3)
71 #define _POSIX_SEM_VALUE_MAX	INT_MAX
72 #define	_POSIX_SIGQUEUE_MAX		32
73 #define _POSIX_RTSIG_MAX		8
74 #define _POSIX_CLOCKRES_MIN		20000000
75 #define _POSIX_TIMER_MAX		32
76 #define _POSIX_DELAYTIMER_MAX	32
77 #define _POSIX_SEM_NSEMS_MAX	(256)
78 
79 #define _POSIX2_LINE_MAX		(2048)
80 
81 #ifdef _XOPEN_SOURCE
82 /* The XSI name for PAGESIZE, with extra underscore included. Only define if
83  * _XOPEN_SOURCE was requested, otherwise it could conflict with the application.
84  */
85 #define PAGE_SIZE				PAGESIZE
86 /* XSI extension: Default process priority. This is used by the implementation
87  * of getpriority(), setpriority() and nice(). */
88 #define NZERO					20
89 #endif
90 
91 /* _GCC_LIMITS_H_ is defined by GCC's internal limits.h to avoid
92  * collisions with any defines in this file.
93  */
94 #ifndef _GCC_LIMITS_H_
95 #	include_next <limits.h>
96 #endif
97 
98 #endif /* _LIBC_LIMITS_H_ */
99