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.
This commit is contained in:
Ian Lepore 2015-03-14 21:38:51 +00:00
parent 79565afed8
commit 8a0d2c613b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280005

View File

@ -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);