#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/hex.h>
-#include <isc/lib.h>
#include <isc/log.h>
#include <isc/managers.h>
#include <isc/md.h>
argc--;
argv++;
- isc_lib_register();
result = dns_lib_init();
if (result != ISC_R_SUCCESS) {
fatal("dns_lib_init failed: %d", result);
#include <isc/buffer.h>
#include <isc/hash.h>
#include <isc/ht.h>
-#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/netaddr.h>
#include <isc/buffer.h>
#include <isc/hash.h>
#include <isc/ht.h>
-#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/netaddr.h>
#include <isc/commandline.h>
#include <isc/hash.h>
-#include <isc/lib.h>
#include <isc/mem.h>
#include <isc/util.h>
* to initialize libisc/libdns
*/
if (dctx->refvar != &isc_bind9) {
- isc_lib_register();
isc_log_setcontext(dctx->lctx);
dns_log_setcontext(dctx->lctx);
isc_hash_set_initializer(dctx->hashinit);
#include <isc/buffer.h>
#include <isc/hash.h>
#include <isc/ht.h>
-#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/netaddr.h>
#include <isc/base64.h>
#include <isc/buffer.h>
#include <isc/commandline.h>
-#include <isc/lib.h>
#include <isc/managers.h>
#include <isc/mem.h>
#include <isc/print.h>
altserveraddr = cp + 1;
}
- isc_lib_register();
result = dns_lib_init();
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "dns_lib_init failed: %u\n", result);
dns_zonemgr_t * zmgr;
isc_task_t * task;
isc_timermgr_t *timermgr;
- bool * refvar;
+ const bool * refvar;
};
#define DNS_DYNDBCTX_MAGIC ISC_MAGIC('D', 'd', 'b', 'c')
include/isc/iterated_hash.h \
include/isc/lang.h \
include/isc/lex.h \
- include/isc/lib.h \
include/isc/likely.h \
include/isc/list.h \
include/isc/log.h \
#include <isc/util.h>
/*%
- * For BIND9 internal applications built with threads, we use a single app
- * context and let multiple worker, I/O, timer threads do actual jobs.
+ * For BIND9 applications built with threads, we use a single app
+ * context and let multiple taskmgr and netmgr threads do actual jobs.
*/
static isc_thread_t blockedthread;
UNLOCK(&ctx->lock);
}
- /*
- * BIND9 internal tools using multiple contexts do not
- * rely on signal. */
- if (isc_bind9 && ctx != &isc_g_appctx) {
- return (ISC_R_SUCCESS);
- }
-
/*
* There is no danger if isc_app_shutdown() is called before we
* wait for signals. Signals are blocked, so any such signal will
* sigwait().
*/
while (!atomic_load_acquire(&ctx->want_shutdown)) {
- if (isc_bind9) {
+ if (ctx == &isc_g_appctx) {
sigset_t sset;
int sig;
/*
- * BIND9 internal; single context:
* Wait for SIGHUP, SIGINT, or SIGTERM.
*/
if (sigemptyset(&sset) != 0 ||
}
} else {
/*
- * External, or BIND9 using multiple contexts:
- * wait until woken up.
+ * Tools using multiple contexts don't
+ * rely on a signal, just wait until woken
+ * up.
*/
if (atomic_load_acquire(&ctx->want_shutdown)) {
break;
if (atomic_compare_exchange_strong_acq_rel(&ctx->shutdown_requested,
&(bool){ false }, true))
{
- if (isc_bind9 && ctx != &isc_g_appctx) {
- /* BIND9 internal, but using multiple contexts */
+ if (ctx != &isc_g_appctx) {
+ /* Tool using multiple contexts */
atomic_store_release(&ctx->want_shutdown, true);
- } else if (isc_bind9) {
- /* BIND9 internal, single context */
+ SIGNAL(&ctx->ready);
+ } else {
+ /* Normal single BIND9 context */
if (kill(getpid(), SIGTERM) < 0) {
char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf));
"kill: %s",
strbuf);
}
- } else {
- /* External, multiple contexts */
- atomic_store_release(&ctx->want_shutdown, true);
- SIGNAL(&ctx->ready);
}
}
}
* Don't send the reload signal if we're shutting down.
*/
if (!atomic_load_acquire(&ctx->shutdown_requested)) {
- if (isc_bind9 && ctx != &isc_g_appctx) {
- /* BIND9 internal, but using multiple contexts */
+ if (ctx != &isc_g_appctx) {
+ /* Tool using multiple contexts */
atomic_store_release(&ctx->want_reload, true);
- } else if (isc_bind9) {
- /* BIND9 internal, single context */
+ SIGNAL(&ctx->ready);
+ } else {
+ /* Normal single BIND9 context */
if (kill(getpid(), SIGHUP) < 0) {
char strbuf[ISC_STRERRORSIZE];
strerror_r(errno, strbuf, sizeof(strbuf));
"kill: %s",
strbuf);
}
- } else {
- /* External, multiple contexts */
- atomic_store_release(&ctx->want_reload, true);
- SIGNAL(&ctx->ready);
}
}
}
#include <isc/bind9.h>
-/*
- * This determines whether we are using the libisc/libdns libraries
- * in BIND9 or in some other application. It is initialized to true
- * and remains unchanged for BIND9 and related tools; export library
- * clients will run isc_lib_register(), which sets it to false,
- * overriding certain BIND9 behaviors.
- */
bool isc_bind9 = true;
* information regarding copyright ownership.
*/
-#ifndef ISC_BIND9_H
-#define ISC_BIND9_H 1
+#pragma once
#include <stdbool.h>
-/*
- * This determines whether we are using the libisc/libdns libraries
- * in BIND9 or in some other application. For BIND9 (named and related
- * tools) it must be set to true at runtime. Export library clients
- * will call isc_lib_register(), which will set it to false.
- */
extern bool isc_bind9;
-
-#endif /* ISC_BIND9_H */
+++ /dev/null
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * 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.
- */
-
-#ifndef ISC_LIB_H
-#define ISC_LIB_H 1
-
-/*! \file isc/lib.h */
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-void
-isc_lib_register(void);
-/*!<
- * \brief Register the ISC library implementations for some base services
- * such as memory or event management and handling socket or timer events.
- * An external application that wants to use the ISC library must call this
- * function very early in main().
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_LIB_H */
/*! \file */
#include <isc/bind9.h>
-#include <isc/lib.h>
#include <isc/mem.h>
#include <isc/os.h>
#include <isc/tls.h>
*** Functions
***/
-void
-isc_lib_register(void) {
- isc_bind9 = false;
-}
-
void
isc__initialize(void) ISC_CONSTRUCTOR;
void
#include <stddef.h>
#include <stdlib.h>
-#include <isc/lib.h>
#include <isc/once.h>
#include <isc/resultclass.h>
#include <isc/rwlock.h>
./lib/isc/include/isc/iterated_hash.h C 2008,2014,2016,2018,2019,2020,2021
./lib/isc/include/isc/lang.h C 1999,2000,2001,2004,2005,2006,2007,2016,2018,2019,2020,2021
./lib/isc/include/isc/lex.h C 1998,1999,2000,2001,2002,2004,2005,2007,2008,2015,2016,2017,2018,2019,2020,2021
-./lib/isc/include/isc/lib.h C 1999,2000,2001,2004,2005,2006,2007,2009,2016,2018,2019,2020,2021
./lib/isc/include/isc/likely.h C 2017,2018,2019,2020,2021
./lib/isc/include/isc/list.h C 1997,1998,1999,2000,2001,2002,2004,2006,2007,2011,2012,2013,2016,2018,2019,2020,2021
./lib/isc/include/isc/log.h C 1999,2000,2001,2002,2004,2005,2006,2007,2009,2014,2016,2017,2018,2019,2020,2021