diff --git a/bin/named/server.c b/bin/named/server.c index 943bdf1cb8..737df4b45d 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/bin/tools/named-nzd2nzf.c b/bin/tools/named-nzd2nzf.c index d18b4cce73..82b9c61294 100644 --- a/bin/tools/named-nzd2nzf.c +++ b/bin/tools/named-nzd2nzf.c @@ -11,13 +11,10 @@ * information regarding copyright ownership. */ -#include #include #include - #include - -/* Included just to get DNS_LMDB_FLAGS definition */ +#include #include int diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h index 3f95ec73fd..a4243ca06e 100644 --- a/lib/dns/include/dns/view.h +++ b/lib/dns/include/dns/view.h @@ -248,17 +248,6 @@ struct dns_view { #define DNS_VIEWATTR_ADBSHUTDOWN 0x02 #define DNS_VIEWATTR_REQSHUTDOWN 0x04 -#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOLOCK) -#ifndef __OpenBSD__ -#define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS) -#else /* __OpenBSD__ */ -/* - * OpenBSD does not have a unified buffer cache, which requires both reads and - * writes to be performed using mmap(). - */ -#define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS | MDB_WRITEMAP) -#endif /* __OpenBSD__ */ - void dns_view_create(isc_mem_t *mctx, isc_loopmgr_t *loopmgr, dns_dispatchmgr_t *dispmgr, dns_rdataclass_t rdclass, diff --git a/lib/dns/view.c b/lib/dns/view.c index ac70a18f98..f5b72debef 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -15,7 +15,6 @@ #include #include -#include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/isc/Makefile.am b/lib/isc/Makefile.am index 261160a662..26f809e1b1 100644 --- a/lib/isc/Makefile.am +++ b/lib/isc/Makefile.am @@ -45,6 +45,7 @@ libisc_la_HEADERS = \ include/isc/lex.h \ include/isc/lib.h \ include/isc/list.h \ + include/isc/lmdb.h \ include/isc/log.h \ include/isc/loop.h \ include/isc/magic.h \ diff --git a/lib/isc/cfgmgr.c b/lib/isc/cfgmgr.c index fcb77f17af..af55f5e59f 100644 --- a/lib/isc/cfgmgr.c +++ b/lib/isc/cfgmgr.c @@ -11,17 +11,17 @@ * information regarding copyright ownership. */ -#include #include #include #include +#include #include +#include #include #include #include #include -#include /* * See MDB_MAXKEYSIZE documentation, but not accessible as defined in diff --git a/lib/isc/include/isc/lmdb.h b/lib/isc/include/isc/lmdb.h new file mode 100644 index 0000000000..391303c24f --- /dev/null +++ b/lib/isc/include/isc/lmdb.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#pragma once + +#include + +#define DNS_LMDB_COMMON_FLAGS (MDB_NOSUBDIR | MDB_NOLOCK) +#ifndef __OpenBSD__ +#define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS) +#else /* __OpenBSD__ */ +/* + * OpenBSD does not have a unified buffer cache, which requires both reads and + * writes to be performed using mmap(). + */ +#define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS | MDB_WRITEMAP) +#endif /* __OpenBSD__ */