Deleted Added
full compact
opensolaris_kstat.c (302408) opensolaris_kstat.c (321529)
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c 267992 2014-06-28 03:56:17Z hselasky $");
28__FBSDID("$FreeBSD: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c 321529 2017-07-26 16:14:05Z mav $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/sysctl.h>
35#include <sys/kstat.h>
36

--- 87 unchanged lines hidden (view full) ---

124
125void
126kstat_delete(kstat_t *ksp)
127{
128
129 sysctl_ctx_free(&ksp->ks_sysctl_ctx);
130 free(ksp, M_KSTAT);
131}
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34#include <sys/sysctl.h>
35#include <sys/kstat.h>
36

--- 87 unchanged lines hidden (view full) ---

124
125void
126kstat_delete(kstat_t *ksp)
127{
128
129 sysctl_ctx_free(&ksp->ks_sysctl_ctx);
130 free(ksp, M_KSTAT);
131}
132
133void
134kstat_set_string(char *dst, const char *src)
135{
136
137 bzero(dst, KSTAT_STRLEN);
138 (void) strncpy(dst, src, KSTAT_STRLEN - 1);
139}
140
141void
142kstat_named_init(kstat_named_t *knp, const char *name, uchar_t data_type)
143{
144
145 kstat_set_string(knp->name, name);
146 knp->data_type = data_type;
147}