summaryrefslogtreecommitdiff
path: root/PACE/pace/config/constants.h
blob: 885fc104987e861c534d36f4639966a1625945d6 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/* $Id$

 * ============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    constants.h
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================ */

#ifndef PACE_CONFIG_CONSTANTS_H
#define PACE_CONFIG_CONSTANTS_H

#define PACE_ONE_SECOND_IN_MSECS 1000L
#define PACE_ONE_SECOND_IN_USECS 1000000L
#define PACE_ONE_SECOND_IN_NSECS 1000000000L

/* ============================================================================
 * Posix minimum values
 * ============================================================================ */

/* The number of I/O operations that can be specified in a list I/O call. */
# if defined (_POSIX_AIO_LISTIO_MAX)
# define PACE_POSIX_AIO_LISTIO_MAX _POSIX_AIO_LISTIO_MAX
# endif

/* The number of outstanding asynchronous I/O operations. */
# if defined (_POSIX_AIO_MAX)
# define PACE_POSIX_AIO_MAX _POSIX_AIO_MAX
# endif

/* The length of the arguments for one of the exec functions, in bytes,
 * excluding environment data. */
# if defined (_POSIX_ARG_MAX)
# define PACE_POSIX_ARG_MAX _POSIX_ARG_MAX
# endif

/* The number of simultaneous processes per real user ID. */
# if defined (_POSIX_CHILD_MAX)
# define PACE_POSIX_CHILD_MAX _POSIX_CHILD_MAX
# endif

/* The number of timer expiration overruns. */
# if defined (_POSIX_DELAYTIMER_MAX)
# define PACE_POSIX_DELAYTIMER_MAX _POSIX_DELAYTIMER_MAX
# endif

/* The value of a file's link count. */
# if defined (_POSIX_LINK_MAX)
# define PACE_POSIX_LINK_MAX _POSIX_LINK_MAX
# endif

/* The size of the storage required for a login name, in bytes,
 * including the terminating NULL. */
# if defined (_POSIX_LOGIN_NAME_MAX)
# define PACE_POSIX_LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
# endif

/* The number of bytes in a terminal canonical input queue. */
# if defined (_POSIX_MAX_CANON)
# define PACE_POSIX_MAX_CANON _POSIX_MAX_CANON
# endif

/* The number of bytes for which space will be available in a
 * terminal input queue. */
# if defined (_POSIX_MAX_INPUT)
# define PACE_POSIX_MAX_INPUT _POSIX_MAX_INPUT
# endif

/* The number of message queues that can be open for a single
 * process. */
# if defined (_POSIX_MQ_OPEN_MAX)
# define PACE_POSIX_MQ_OPEN_MAX _POSIX_MQ_OPEN_MAX
# endif

/* The maximum number of message priorities supported by the
 * implementation. */
# if defined (_POSIX_MQ_PRIO_MAX)
# define PACE_POSIX_MQ_PRIO_MAX _POSIX_MQ_PRIO_MAX
# endif

/* The number of bytes in a filename. */
# if defined (_POSIX_NAME_MAX)
# define PACE_POSIX_NAME_MAX _POSIX_NAME_MAX
# endif

/* The number of simultaneous supplementary group IDs per process. */
# if defined (_POSIX_NGROUPS_MAX)
# define PACE_POSIX_NGROUPS_MAX _POSIX_NGROUPS_MAX
# endif

/* The number of files that one process can have open at one time. */
# if defined (_POSIX_OPEN_MAX)
# define PACE_POSIX_OPEN_MAX _POSIX_OPEN_MAX
# endif

/* The number of bytes in a pathname. */
# if defined (_POSIX_PATH_MAX)
# define PACE_POSIX_PATH_MAX _POSIX_PATH_MAX
# endif

/* The number of bytes that can be written atomically when writing
 * to a pipe. */
# if defined (_POSIX_PIPE_BUF)
# define PACE_POSIX_PIPE_BUF _POSIX_PIPE_BUF
# endif

/* The number of realtime signal numbers reserved for application use. */
# if defined (_POSIX_RTSIG_MAX)
# define PACE_POSIX_RTSIG_MAX _POSIX_RTSIG_MAX
# endif

/* The number of semaphores that a process may have. */
# if defined (_POSIX_SEM_NSEMS_MAX)
# define PACE_POSIX_SEM_NSEMS_MAX _POSIX_SEM_NSEMS_MAX
# endif

/* The maximum value a semaphore may have. */
# if defined (_POSIX_SEM_VALUE_MAX)
# define PACE_POSIX_SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX
# endif

/* The number of queued signals that a process may send and have pending
 * at the receiver(s) at any time. */
# if defined (_POSIX_SIGQUEUE_MAX)
# define PACE_POSIX_SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX
# endif

/* The value that can be stored in an object of type ssize_t. */
# if defined (_POSIX_SSIZE_MAX)
# define PACE_POSIX_SSIZE_MAX _POSIX_SSIZE_MAX
# endif

/* The number of streams that one process can have open at one time. */
# if defined (_POSIX_STREAM_MAX)
# define PACE_POSIX_STREAM_MAX _POSIX_STREAM_MAX
# endif

/* The number of attempts made to destroy the thread-specific data
 * values of a thread on thread exit. */
# if defined (_POSIX_THREAD_DESTRUCTOR_ITERATIONS)
# define PACE_POSIX_THREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTORITERATIONS
# endif

/* The number of data keys per process. */
# if defined (_POSIX_THREAD_KEYS_MAX)
# define PACE_POSIX_THREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX
# endif

/* The number of threads per process. */
# if defined (_POSIX_THREAD_THREADS_MAX)
# define PACE_POSIX_THREAD_THREADS_MAX _POSIX_THREAD_THREADS_MAX
# endif

/* The size of the storage required for a terminal device name, in bytes,
 * including the terminating NULL. */
# if defined (_POSIX_TTY_NAME_MAX)
# define PACE_POSIX_TTY_NAME_MAX _POSIX_TTY_NAME_MAX
# endif

/* The per-process number of times. */
# if defined (_POSIX_TIMER_MAX)
# define PACE_POSIX_TIMER_MAX _POSIX_TIMER_MAX
# endif

/* The maximum number of bytes supported for the name of a time zone
 * (not of the TZ variable). */
# if defined (_POSIX_TZNAME_MAX)
# define PACE_POSIX_TZNAME_MAX _POSIX_TZNAME_MAX
# endif


/* ============================================================================
 * Temporary MACROS. Correct them later.
 * ============================================================================ */

#include "pace/sys/types.h"

/* Tracing */
# define PACE_DEBUG(X)
# define PACE_LM_DEBUG PACE_stderr
# define PACE_BEGIN_DUMP
# define PACE_END_DUMP

/* Identification for PACE.h */
# define PACE_RCSID(X,Y,Z)

/* Hooks */
/* Dummy values */
# define PACE_ALLOC_HOOK_DECLARE int declare_hook
# define PACE_ALLOC_HOOK_DEFINE(X)

/* Signals / ioctl / fcntl - dummy values */
# define PACE_SIGURG 1
# define PACE_NONBLOCK 2
# define PACE_CLOEXEC 3

/* Flags */
/* Will not be a macro, dummy values */
# define PACE_set_flags(X,Y) 1
# define PACE_clr_flags(X,Y) 1

/* Log Error */
# define PACE_ERROR(X)

/* Host Entries */
# if defined (PACE_HAS_STRUCT_NETDB_DATA)
typedef char PACE_HOSTENT_DATA[sizeof(struct hostent_data)];
typedef char PACE_SERVENT_DATA[sizeof(struct servent_data)];
typedef char PACE_PROTOENT_DATA[sizeof(struct protoent_data)];
# else
# if !defined PACE_HOSTENT_DATA_SIZE
# define PACE_HOSTENT_DATA_SIZE (4*1024)
# endif /* PACE_HOSTENT_DATA_SIZE */
# if !defined PACE_SERVENT_DATA_SIZE
# define PACE_SERVENT_DATA_SIZE (4*1024)
# endif /*PACE_SERVENT_DATA_SIZE */
# if !defined PACE_PROTOENT_DATA_SIZE
# define PACE_PROTOENT_DATA_SIZE (2*1024)
# endif /*PACE_PROTOENT_DATA_SIZE */
typedef char PACE_HOSTENT_DATA[PACE_HOSTENT_DATA_SIZE];
typedef char PACE_SERVENT_DATA[PACE_SERVENT_DATA_SIZE];
typedef char PACE_PROTOENT_DATA[PACE_PROTOENT_DATA_SIZE];
# endif /* PACE_HAS_STRUCT_NETDB_DATA */

/* PACE_HAS_SIN_LEN */

/* PACE_FREE */
/* adjust later to use macros to decide how to free */
# define PACE_FREE(X,Y) \
X Y

# define AF_ANY -1

/* PACE CATCHALL */
/* FIONREAD is used in PACE_SOCK_IO::recvv */
/* PACE_HAS_ALLOCA is used in PACE_SOCK_IO::recvv */

#endif /* PACE_CONFIG_CONSTANTS_H */