From 9ee17054b2a8dbb03d86909439eda96cbdd839bf Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 14 Mar 2015 21:38:51 +0000 Subject: [PATCH] Define a convenience macro, SYSCTL_OUT_STR() for handling strings the standard way (including the nulterm byte in the data returned to userland). This augments the existing sysctl_handle_string() in that this can be used with const strings without ugly inappropriate casting. --- sys/sys/sysctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index f3173c287078..988dbae94087 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -186,6 +186,7 @@ struct sysctl_oid { #define SYSCTL_IN(r, p, l) (r->newfunc)(r, p, l) #define SYSCTL_OUT(r, p, l) (r->oldfunc)(r, p, l) +#define SYSCTL_OUT_STR(r, p) (r->oldfunc)(r, p, strlen(p) + 1) int sysctl_handle_int(SYSCTL_HANDLER_ARGS); int sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS);