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