]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/baconfig.h
Solaris 2.6 changes from Peter Schmitz
[bacula/bacula] / bacula / src / baconfig.h
1 /*
2  * General header file configurations that apply to
3  * all daemons.  System dependent stuff goes here.
4  *
5  *   Version $Id$
6  */
7 /*
8    Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2 of
13    the License, or (at your option) any later version.
14
15    This program is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public
21    License along with this program; if not, write to the Free
22    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23    MA 02111-1307, USA.
24
25  */
26
27
28 #ifndef _BACONFIG_H
29 #define _BACONFIG_H 1
30
31 /* Bacula common configuration defines */
32
33 #define TRUE  1
34 #define FALSE 0
35
36 #ifndef ETIME
37 #define ETIME ETIMEDOUT
38 #endif
39
40 #ifdef PROTOTYPES
41 # define __PROTO(p)     p
42 #else
43 # define __PROTO(p)     ()
44 #endif
45
46 #ifdef DEBUG
47 #define ASSERT(x) if (!(x)) { \
48    char *jcr = NULL; \
49    Emsg1(M_ERROR, 0, "Failed ASSERT: %s\n", #x); \
50    jcr[0] = 0; }
51 #else
52 #define ASSERT(x)
53 #endif
54
55 /* Allow printing of NULL pointers */
56 #define NPRT(x) (x)?(x):"*None*" 
57
58 #ifdef ENABLE_NLS
59 #include <libintl.h>
60 #define _(s) gettext((s))
61 #define N_(s) (s)
62 #else
63 #define _(s) (s)
64 #define N_(s) (s)
65 #define textdomain(x)
66 #endif
67
68
69 /* This should go away! ****FIXME***** */
70 #define MAXSTRING 500
71
72 /* Maximum length to edit time/date */
73 #define MAX_TIME_LENGTH 30
74
75 /* Maximum Name length including EOS */
76 #define MAX_NAME_LENGTH 128
77
78 /* All tape operations MUST be a multiple of this */
79 #define TAPE_BSIZE 1024
80 #if !defined(DEV_BSIZE) && defined(BSIZE)
81 #define DEV_BSIZE BSIZE
82 #endif
83
84 #ifndef DEV_BSIZE
85 #define DEV_BSIZE 512
86 #endif
87
88 /* Maximum number of bytes that you can push into a
89  * socket.
90  */
91 #define MAX_NETWORK_BUFFER_SIZE (32 * 1024)
92
93 /* Stream definitions.  Once defined these must NEVER
94  *   change as they go on the storage media.
95  */
96 #define STREAM_UNIX_ATTRIBUTES   1    /* Generic Unix attributes */
97 #define STREAM_FILE_DATA         2    /* Standard uncompressed data */
98 #define STREAM_MD5_SIGNATURE     3    /* MD5 signature for the file */
99 #define STREAM_GZIP_DATA         4    /* GZip compressed file data */
100 #define STREAM_WIN32_ATTRIBUTES  5    /* Windows attributes (superset of Unix) */
101 #define STREAM_SPARSE_DATA       6    /* Sparse data stream */
102 #define STREAM_SPARSE_GZIP_DATA  7
103 #define STREAM_PROGRAM_NAMES     8    /* program names for program data */
104 #define STREAM_PROGRAM_DATA      9    /* Data needing program */
105 #define STREAM_SHA1_SIGNATURE   10    /* SHA1 signature for the file */
106
107 /*
108  * Internal code for Signature types
109  */
110 #define NO_SIG   0
111 #define MD5_SIG  1
112 #define SHA1_SIG 2
113
114 /* Size of File Address stored in STREAM_SPARSE_DATA. Do NOT change! */
115 #define SPARSE_FADDR_SIZE (sizeof(uint64_t))
116
117
118 /* This is for dumb compilers/libraries like Solaris. Linux GCC
119  * does it correctly, so it might be worthwhile
120  * to remove the isascii(c) with ifdefs on such
121  * "smart" systems.
122  */
123 #define B_ISSPACE(c) (isascii((int)(c)) && isspace((int)(c)))
124 #define B_ISALPHA(c) (isascii((int)(c)) && isalpha((int)(c)))
125 #define B_ISUPPER(c) (isascii((int)(c)) && isupper((int)(c)))
126 #define B_ISDIGIT(c) (isascii((int)(c)) && isdigit((int)(c)))
127
128
129 typedef void (HANDLER)();
130 typedef int (INTHANDLER)();
131
132 #ifdef SETPGRP_VOID
133 # define SETPGRP_ARGS(x, y) /* No arguments */
134 #else
135 # define SETPGRP_ARGS(x, y) (x, y)
136 #endif
137
138 #ifndef S_ISLNK
139 #define S_ISLNK(m) (((m) & S_IFM) == S_IFLNK)
140 #endif
141
142 /* Added by KES to deal with Win32 systems */
143 #ifndef S_ISWIN32
144 #define S_ISWIN32 020000
145 #endif
146
147 #ifndef INADDR_NONE
148 #define INADDR_NONE ((unsigned long) -1)
149 #endif
150
151 #ifdef TIME_WITH_SYS_TIME
152 # include <sys/time.h>
153 # include <time.h>
154 #else
155 # ifdef HAVE_SYS_TIME_H
156 #  include <sys/time.h>
157 # else
158 #  include <time.h>
159 # endif
160 #endif
161
162 #ifndef O_BINARY
163 #define O_BINARY 0
164 #endif
165
166 #ifndef O_NOFOLLOW
167 #define O_NOFOLLOW 0
168 #endif
169
170 #ifndef MODE_RW
171 #define MODE_RW 0666
172 #endif
173
174 #ifdef DEBUG_MUTEX
175 extern void _p(char *file, int line, pthread_mutex_t *m);
176 extern void _v(char *file, int line, pthread_mutex_t *m);
177
178 #define P(x) _p(__FILE__, __LINE__, &(x))
179 #define V(x) _v(__FILE__, __LINE__, &(x))
180
181 #else
182
183 /* These probably should be subroutines */
184 #define P(x) \
185    do { int errstat; if ((errstat=pthread_mutex_lock(&(x)))) \
186       e_msg(__FILE__, __LINE__, M_ABORT, 0, "Mutex lock failure. ERR=%s\n",\
187            strerror(errstat)); \
188    } while(0)
189
190 #define V(x) \
191    do { int errstat; if ((errstat=pthread_mutex_unlock(&(x)))) \
192          e_msg(__FILE__, __LINE__, M_ABORT, 0, "Mutex unlock failure. ERR=%s\n",\
193            strerror(errstat)); \
194    } while(0)
195
196 #endif /* DEBUG_MUTEX */
197
198 /* These probably should be subroutines */
199 #define Pw(x) \
200    do { int errstat; if ((errstat=rwl_writelock(&(x)))) \
201       e_msg(__FILE__, __LINE__, M_ABORT, 0, "Write lock lock failure. ERR=%s\n",\
202            strerror(errstat)); \
203    } while(0)
204
205 #define Vw(x) \
206    do { int errstat; if ((errstat=rwl_writeunlock(&(x)))) \
207          e_msg(__FILE__, __LINE__, M_ABORT, 0, "Write lock unlock failure. ERR=%s\n",\
208            strerror(errstat)); \
209    } while(0)
210
211
212 /*
213  * The digit following Dmsg and Emsg indicates the number of substitutions in
214  * the message string. We need to do this kludge because non-GNU compilers
215  * do not handle varargs #defines.
216  */
217 /* Debug Messages that are printed */
218 #ifdef DEBUG
219 #define Dmsg0(lvl, msg)             d_msg(__FILE__, __LINE__, lvl, msg)
220 #define Dmsg1(lvl, msg, a1)         d_msg(__FILE__, __LINE__, lvl, msg, a1)
221 #define Dmsg2(lvl, msg, a1, a2)     d_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
222 #define Dmsg3(lvl, msg, a1, a2, a3) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
223 #define Dmsg4(lvl, msg, arg1, arg2, arg3, arg4) d_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
224 #define Dmsg5(lvl, msg, a1, a2, a3, a4, a5) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
225 #define Dmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
226 #define Dmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
227 #define Dmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
228 #define Dmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
229 #define Dmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
230 #define Dmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
231 #define Dmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
232 #define Dmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
233 #else
234 #define Dmsg0(lvl, msg)
235 #define Dmsg1(lvl, msg, a1)
236 #define Dmsg2(lvl, msg, a1, a2)
237 #define Dmsg3(lvl, msg, a1, a2, a3)
238 #define Dmsg4(lvl, msg, arg1, arg2, arg3, arg4)
239 #define Dmsg5(lvl, msg, a1, a2, a3, a4, a5)
240 #define Dmsg6(lvl, msg, a1, a2, a3, a4, a5, a6)
241 #define Dmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7)
242 #define Dmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
243 #define Dmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
244 #define Dmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
245 #define Dmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
246 #endif /* DEBUG */
247
248 #ifdef TRACE_FILE
249 #define Tmsg0(lvl, msg)             t_msg(__FILE__, __LINE__, lvl, msg)
250 #define Tmsg1(lvl, msg, a1)         t_msg(__FILE__, __LINE__, lvl, msg, a1)
251 #define Tmsg2(lvl, msg, a1, a2)     t_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
252 #define Tmsg3(lvl, msg, a1, a2, a3) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
253 #define Tmsg4(lvl, msg, arg1, arg2, arg3, arg4) t_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
254 #define Tmsg5(lvl, msg, a1, a2, a3, a4, a5) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
255 #define Tmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
256 #define Tmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
257 #define Tmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) t_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
258 #define Tmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
259 #define Tmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
260 #define Tmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
261 #define Tmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
262 #define Tmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) t_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
263 #else
264 #define Tmsg0(lvl, msg)
265 #define Tmsg1(lvl, msg, a1)
266 #define Tmsg2(lvl, msg, a1, a2)
267 #define Tmsg3(lvl, msg, a1, a2, a3)
268 #define Tmsg4(lvl, msg, arg1, arg2, arg3, arg4)
269 #define Tmsg5(lvl, msg, a1, a2, a3, a4, a5)
270 #define Tmsg6(lvl, msg, a1, a2, a3, a4, a5, a6)
271 #define Tmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7)
272 #define Tmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
273 #define Tmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
274 #define Tmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
275 #define Tmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
276 #endif /* TRACE_FILE */
277
278
279
280 /* Messages that are printed (uses d_msg) */
281 #define Pmsg0(lvl, msg)             d_msg(__FILE__, __LINE__, lvl, msg)
282 #define Pmsg1(lvl, msg, a1)         d_msg(__FILE__, __LINE__, lvl, msg, a1)
283 #define Pmsg2(lvl, msg, a1, a2)     d_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
284 #define Pmsg3(lvl, msg, a1, a2, a3) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
285 #define Pmsg4(lvl, msg, arg1, arg2, arg3, arg4) d_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
286 #define Pmsg5(lvl, msg, a1, a2, a3, a4, a5) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
287 #define Pmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
288 #define Pmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
289 #define Pmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
290 #define Pmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
291 #define Pmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
292 #define Pmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
293 #define Pmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
294 #define Pmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
295 #define Pmsg14(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)
296
297        
298 /* Daemon Error Messages that are delivered according to the message resource */
299 #define Emsg0(typ, lvl, msg)             e_msg(__FILE__, __LINE__, typ, lvl, msg)
300 #define Emsg1(typ, lvl, msg, a1)         e_msg(__FILE__, __LINE__, typ, lvl, msg, a1)
301 #define Emsg2(typ, lvl, msg, a1, a2)     e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2)
302 #define Emsg3(typ, lvl, msg, a1, a2, a3) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3)
303 #define Emsg4(typ, lvl, msg, a1, a2, a3, a4) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4)
304 #define Emsg5(typ, lvl, msg, a1, a2, a3, a4, a5) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4, a5)
305 #define Emsg6(typ, lvl, msg, a1, a2, a3, a4, a5, a6) e_msg(__FILE__, __LINE__, typ, lvl, msg, a1, a2, a3, a4, a5, a6)
306
307 /* Job Error Messages that are delivered according to the message resource */
308 #define Jmsg0(jcr, typ, lvl, msg)             j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg)
309 #define Jmsg1(jcr, typ, lvl, msg, a1)         j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1)
310 #define Jmsg2(jcr, typ, lvl, msg, a1, a2)     j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2)
311 #define Jmsg3(jcr, typ, lvl, msg, a1, a2, a3) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3)
312 #define Jmsg4(jcr, typ, lvl, msg, a1, a2, a3, a4) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4)
313 #define Jmsg5(jcr, typ, lvl, msg, a1, a2, a3, a4, a5) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5)
314 #define Jmsg6(jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6) j_msg(__FILE__, __LINE__, jcr, typ, lvl, msg, a1, a2, a3, a4, a5, a6)
315
316
317 /* Memory Messages that are edited into a Pool Memory buffer */
318 #define Mmsg0(buf, msg)             m_msg(__FILE__, __LINE__, buf, msg)
319 #define Mmsg1(buf, msg, a1)         m_msg(__FILE__, __LINE__, buf, msg, a1)
320 #define Mmsg2(buf, msg, a1, a2)     m_msg(__FILE__, __LINE__, buf, msg, a1, a2)
321 #define Mmsg3(buf, msg, a1, a2, a3) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3)
322 #define Mmsg4(buf, msg, a1, a2, a3, a4) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4)
323 #define Mmsg5(buf, msg, a1, a2, a3, a4, a5) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5)
324 #define Mmsg6(buf, msg, a1, a2, a3, a4, a5, a6) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5, a6)
325 #define Mmsg7(buf, msg, a1, a2, a3, a4, a5, a6, a7) m_msg(__FILE__, __LINE__, buf, msg, a1, a2, a3, a4, a5, a6)
326 #define Mmsg8(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6)
327 #define Mmsg11(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
328 #define Mmsg15(buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15) m_msg(__FILE__,__LINE__,buf,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)
329
330 /* Edit message into Pool Memory buffer -- no __FILE__ and __LINE__ */
331 int  Mmsg(char **msgbuf, char *fmt,...);
332
333
334 void d_msg(char *file, int line, int level, char *fmt,...);
335 void e_msg(char *file, int line, int type, int level, char *fmt,...);
336 void j_msg(char *file, int line, void *vjcr, int type, int level, char *fmt,...);
337 int  m_msg(char *file, int line, char **msgbuf, char *fmt,...);
338
339
340 /* Use our strdup with smartalloc */
341 #undef strdup
342 #define strdup(buf) bad_call_on_strdup_use_bstrdup(buf)
343
344 #ifdef DEBUG
345 #define bstrdup(str) strcpy((char *) b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
346 #else
347 #define bstrdup(str) strcpy((char *) bmalloc(strlen((str))+1),(str))
348 #endif
349
350 #ifdef DEBUG
351 #define bmalloc(size) b_malloc(__FILE__, __LINE__, (size))
352 #endif
353
354 #ifdef __alpha__
355 #define OSF 1
356 #endif
357
358 #ifdef HAVE_SUN_OS
359    /* 
360     * On Solaris 2.5, threads are not timesliced by default, so we need to
361     * explictly increase the conncurrency level.
362     */
363 #include <thread.h>
364 #define set_thread_concurrency(x)  thr_setconcurrency(x)
365 extern int thr_setconcurrency(int);
366 #define SunOS 1
367
368 #else
369
370 /* Not needed on most systems */
371 #define set_thread_concurrency(x)
372
373 #endif
374
375 #ifdef HAVE_IRIX_OS
376 #define socklen_t int
377 #endif
378
379 #ifdef HAVE_DARWIN_OS
380 #define socklen_t int
381 /* Apparently someone forgot to wrap getdomainname as a C function */
382 extern "C" int getdomainname(char *name, size_t len);
383
384 /* Darwin lib fnmatch() doesn't work, so use our own */
385 #undef HAVE_FNMATCH
386 #endif
387
388 #ifdef HAVE_CYGWIN
389 /* They don't really have it */
390 #undef HAVE_GETDOMAINNAME
391 #endif
392
393 #ifdef HAVE_AIX_OS
394 #define crid_t int
395 #define class_id_t unsigned int
396 #endif
397  
398
399 #define ALIGN_SIZE (sizeof(double))
400 #define BALIGN(x) (((x) + ALIGN_SIZE - 1) & ~(ALIGN_SIZE -1))
401
402
403 /* Added by KES to deal with Win32 systems */
404 #ifndef S_ISWIN32
405 #define S_ISWIN32 020000
406 #endif
407
408 /*
409  * Replace codes needed in both file routines and non-file routines
410  * Job replace codes -- in "replace"   
411  */
412 #define REPLACE_ALWAYS   'a'
413 #define REPLACE_IFNEWER  'w'
414 #define REPLACE_NEVER    'n'
415 #define REPLACE_IFOLDER  'o'
416
417 #ifdef __SVR4
418 #undef socklen_t
419 #define socklen_t int
420 #endif
421
422 #endif /* _BACONFIG_H */