From 771efb08f5bfaf22da0498ae91647fdecb3cc6bb Mon Sep 17 00:00:00 2001 From: dwmalone Date: Mon, 4 Jun 2007 18:25:08 +0000 Subject: Despite several examples in the kernel, the third argument of sysctl_handle_int is not sizeof the int type you want to export. The type must always be an int or an unsigned int. Remove the instances where a sizeof(variable) is passed to stop people accidently cut and pasting these examples. In a few places this was sysctl_handle_int was being used on 64 bit types, which would truncate the value to be exported. In these cases use sysctl_handle_quad to export them and change the format to Q so that sysctl(1) can still print them. --- sys/isa/atrtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/isa/atrtc.c') diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 3125bd1..62c5764 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -838,7 +838,7 @@ sysctl_machdep_i8254_freq(SYSCTL_HANDLER_ARGS) * is is too generic. Should use it everywhere. */ freq = timer_freq; - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) set_timer_freq(freq, hz); return (error); -- cgit v1.1