summaryrefslogtreecommitdiff
path: root/examples/loadables/getconf.h
blob: ed4bbb944fdc841cc2566f63a0a7b1439514b168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* getconf.h -- replacement definitions for ones the system doesn't provide
   and don't appear in <typemax.h> */

#ifndef _GETCONF_H
#define _GETCONF_H

/* Some systems do not define these; use POSIX.2 minimum recommended values. */
#ifndef _POSIX2_COLL_WEIGHTS_MAX
#  define _POSIX2_COLL_WEIGHTS_MAX 2
#endif

/* If we're on a posix system, but the system doesn't define the necessary
   constants, use posix.1 minimum values. */
#if defined (_POSIX_VERSION)

#ifndef _POSIX_ARG_MAX
#  define _POSIX_ARG_MAX	4096
#endif
#ifndef _POSIX_CHILD_MAX
#  define _POSIX_CHILD_MAX	6
#endif
#ifndef _POSIX_LINK_MAX
#  define _POSIX_LINK_MAX	8
#endif
#ifndef _POSIX_MAX_CANON
#  define _POSIX_MAX_CANON	255
#endif
#ifndef _POSIX_MAX_INPUT
#  define _POSIX_MAX_INPUT	255
#endif
#ifndef _POSIX_NAME_MAX
#  define _POSIX_NAME_MAX	14
#endif
#ifndef _POSIX_NGROUPS_MAX
#  define _POSIX_NGROUPS_MAX	0
#endif
#ifndef _POSIX_OPEN_MAX
#  define _POSIX_OPEN_MAX	16
#endif
#ifndef _POSIX_PATH_MAX
#  define _POSIX_PATH_MAX	255
#endif
#ifndef _POSIX_PIPE_BUF
#  define _POSIX_PIPE_BUF	512
#endif
#ifndef _POSIX_SSIZE_MAX
#  define _POSIX_SSIZE_MAX	32767
#endif
#ifndef _POSIX_STREAM_MAX
#  define _POSIX_STREAM_MAX	8
#endif
#ifndef _POSIX_TZNAME_MAX
#  define _POSIX_TZNAME_MAX	3
#endif

#ifndef _POSIX2_BC_BASE_MAX
#  define _POSIX2_BC_BASE_MAX     99
#endif
#ifndef _POSIX2_BC_DIM_MAX
#  define _POSIX2_BC_DIM_MAX      2048
#endif
#ifndef _POSIX2_BC_SCALE_MAX
#  define _POSIX2_BC_SCALE_MAX    99
#endif
#ifndef _POSIX2_BC_STRING_MAX
#  define _POSIX2_BC_STRING_MAX   1000
#endif
#ifndef _POSIX2_EQUIV_CLASS_MAX
#  define _POSIX2_EQUIV_CLASS_MAX 2
#endif
#ifndef _POSIX2_EXPR_NEST_MAX
#  define _POSIX2_EXPR_NEST_MAX   32
#endif
#ifndef _POSIX2_LINE_MAX
#  define _POSIX2_LINE_MAX        2048
#endif
#ifndef _POSIX2_RE_DUP_MAX
#  define _POSIX2_RE_DUP_MAX      255
#endif

#endif /* _POSIX_VERSION */

/* ANSI/ISO C, POSIX.1-200x, XPG 4.2, and C language type limits.
   Defined only if the system include files and <typemax.h> don't. */

#ifndef CHAR_MAX
#  define CHAR_MAX	127
#endif
#ifndef CHAR_MIN
#  define CHAR_MIN	-128
#endif
#ifndef SCHAR_MAX
#  define SCHAR_MAX	127
#endif
#ifndef SCHAR_MIN
#  define SCHAR_MIN	-128
#endif

#ifndef INT_BIT
#  define INT_BIT	(sizeof (int) * CHAR_BIT)
#endif

#ifndef LONG_BIT
#  define LONG_BIT	(sizeof (long int) * CHAR_BIT)
#endif

#ifndef WORD_BIT
#  define WORD_BIT	(sizeof (int) * CHAR_BIT)
#endif

#if !defined (PRIdMAX)
#  if HAVE_LONG_LONG
#    define PRIdMAX     "lld"
#  else
#    define PRIdMAX     "ld"
#  endif
#endif

#endif /* _GETCONF_H */