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:
parent
eb63aed246
commit
9ee17054b2
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user