xref: /titanic_50/usr/src/cmd/sendmail/include/sm/bdb.h (revision 74e20cfe817b82802b16fac8690dadcda76f54f5)
1 /*
2  * Copyright (c) 2002, 2003 Sendmail, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  *
10  *	$Id: bdb.h,v 1.1.2.4 2003/03/06 16:27:38 ca Exp $
11  */
12 
13 #pragma ident	"%Z%%M%	%I%	%E% SMI"
14 
15 #ifndef	SM_BDB_H
16 #define SM_BDB_H
17 
18 #if NEWDB
19 # include <db.h>
20 # ifndef DB_VERSION_MAJOR
21 #  define DB_VERSION_MAJOR 1
22 # endif /* ! DB_VERSION_MAJOR */
23 
24 # if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
25 
26 #  define DBTXN	NULL ,
27 
28 /*
29 **  Always turn on DB_FCNTL_LOCKING for DB 4.1.x since its
30 **  "workaround" for accepting an empty (locked) file depends on
31 **  this flag. Notice: this requires 4.1.24 + patch (which should be
32 **  part of 4.1.25).
33 */
34 
35 #  define SM_DB_FLAG_ADD(flag)	(flag) |= DB_FCNTL_LOCKING
36 
37 # else /* DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 */
38 
39 #  define DBTXN
40 #  if !HASFLOCK && defined(DB_FCNTL_LOCKING)
41 #   define SM_DB_FLAG_ADD(flag)	(flag) |= DB_FCNTL_LOCKING
42 #  else /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
43 #   define SM_DB_FLAG_ADD(flag)	((void) 0)
44 #  endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */
45 
46 # endif /* DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1 */
47 #endif /* NEWDB */
48 
49 #endif /* ! SM_BDB_H */
50