File tree Expand file tree Collapse file tree 5 files changed +82
-0
lines changed Expand file tree Collapse file tree 5 files changed +82
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ libspl_la_SOURCES = \
2121 %D%/getexecname.c \
2222 %D%/kmem.c \
2323 %D%/kstat.c \
24+ %D%/libspl.c \
2425 %D%/list.c \
2526 %D%/mkdirp.c \
2627 %D%/mutex.c \
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ libspl_HEADERS = \
44 %D%/atomic.h \
55 %D%/libgen.h \
66 %D%/libshare.h \
7+ %D%/libspl.h \
78 %D%/statcommon.h \
89 %D%/stdlib.h \
910 %D%/string.h \
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: CDDL-1.0
2+ /*
3+ * CDDL HEADER START
4+ *
5+ * The contents of this file are subject to the terms of the
6+ * Common Development and Distribution License (the "License").
7+ * You may not use this file except in compliance with the License.
8+ *
9+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10+ * or https://opensource.org/licenses/CDDL-1.0.
11+ * See the License for the specific language governing permissions
12+ * and limitations under the License.
13+ *
14+ * When distributing Covered Code, include this CDDL HEADER in each
15+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16+ * If applicable, add the following below this CDDL HEADER, with the
17+ * fields enclosed by brackets "[]" replaced with your own identifying
18+ * information: Portions Copyright [yyyy] [name of copyright owner]
19+ *
20+ * CDDL HEADER END
21+ */
22+ /*
23+ * Copyright (c) 2025, Rob Norris <[email protected] > 24+ */
25+
26+ #ifndef _LIBSPL_H
27+ #define _LIBSPL_H extern __attribute__((visibility("default")))
28+
29+ #ifdef __cplusplus
30+ extern "C" {
31+ #endif
32+
33+ _LIBSPL_H void libspl_init (void );
34+ _LIBSPL_H void libspl_fini (void );
35+
36+ #ifdef __cplusplus
37+ };
38+ #endif
39+
40+ #endif /* _LIBSPL_H */
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: CDDL-1.0
2+ /*
3+ * CDDL HEADER START
4+ *
5+ * The contents of this file are subject to the terms of the
6+ * Common Development and Distribution License (the "License").
7+ * You may not use this file except in compliance with the License.
8+ *
9+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10+ * or https://opensource.org/licenses/CDDL-1.0.
11+ * See the License for the specific language governing permissions
12+ * and limitations under the License.
13+ *
14+ * When distributing Covered Code, include this CDDL HEADER in each
15+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16+ * If applicable, add the following below this CDDL HEADER, with the
17+ * fields enclosed by brackets "[]" replaced with your own identifying
18+ * information: Portions Copyright [yyyy] [name of copyright owner]
19+ *
20+ * CDDL HEADER END
21+ */
22+ /*
23+ * Copyright (c) 2025, Rob Norris <[email protected] > 24+ */
25+
26+ #include <libspl.h>
27+
28+ void
29+ libspl_init (void )
30+ {
31+ }
32+
33+ void
34+ libspl_fini (void )
35+ {
36+ }
Original file line number Diff line number Diff line change @@ -505,6 +505,8 @@ kernel_init(int mode)
505505{
506506 extern uint_t rrw_tsd_key ;
507507
508+ libspl_init ();
509+
508510 umem_nofail_callback (umem_out_of_memory );
509511
510512 physmem = sysconf (_SC_PHYS_PAGES );
@@ -543,6 +545,8 @@ kernel_fini(void)
543545 system_taskq_fini ();
544546
545547 random_fini ();
548+
549+ libspl_fini ();
546550}
547551
548552int
You can’t perform that action at this time.
0 commit comments