mirnshi:sysctl_string
This is an old revision of the document!
sysctl string
The way to 'sysctl' string in the kernel module program
The sysctl_proc function:
char sysctl_str[1024]; static int sysctl_str_ctrl(SYSCTL_HANDLER_ARGS) { int error; char *p; p = sysctl_str; error = sysctl_handle_string(oidp, p, sizeof(sysctl_str), req); if (!error && req->newptr) { // } error = SYSCTL_OUT(req, sysctl_str, sizeof(sysctl_str)); return error; }
SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(sysctl_root), OID_AUTO, "str", CTLTYPE_STRING|CTLFLAG_RW, 0, sizeof(sysctl_str), sysctl_str_ctrl, "A", "");
mirnshi/sysctl_string.1236333957.txt.gz · Last modified: 2009/03/06 10:05 by mirnshi
Discussion