1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
7  *
8  * See the COPYRIGHT file distributed with this work for additional
9  * information regarding copyright ownership.
10  */
11 
12 /*! \file */
13 
14 #include <isc/bind9.h>
15 #include <isc/mem.h>
16 #include <isc/os.h>
17 #include <isc/tls.h>
18 #include <isc/util.h>
19 
20 #include "config.h"
21 #include "mem_p.h"
22 #include "tls_p.h"
23 #include "trampoline_p.h"
24 
25 #ifndef ISC_CONSTRUCTOR
26 #error Either __attribute__((constructor|destructor))__ or DllMain support needed to compile BIND 9.
27 #endif
28 
29 /***
30  *** Functions
31  ***/
32 
33 void
34 isc__initialize(void) ISC_CONSTRUCTOR;
35 void
36 isc__shutdown(void) ISC_DESTRUCTOR;
37 
38 void
isc__initialize(void)39 isc__initialize(void) {
40 	isc__mem_initialize();
41 	isc__tls_initialize();
42 	isc__trampoline_initialize();
43 	(void)isc_os_ncpus();
44 }
45 
46 void
isc__shutdown(void)47 isc__shutdown(void) {
48 	isc__trampoline_shutdown();
49 	isc__tls_shutdown();
50 	isc__mem_shutdown();
51 }
52