Date: Thu, 26 Feb 2004 13:31:59 +0000 From: Bruce M Simpson <bms@spc.org> To: Ivan Voras <ivoras@fer.hr> Cc: hackers@freebsd.org Subject: Re: Accessing sysctls from kernel Message-ID: <20040226133159.GA17994@saboteur.dek.spc.org> In-Reply-To: <403DF050.80208@fer.hr> References: <403DF050.80208@fer.hr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Feb 26, 2004 at 02:10:40PM +0100, Ivan Voras wrote:
> In sys/sys/sysctl.h I see function kernel_sysctlbyname() that looks (to
> me) to be intended for accessing sysctl values from kernel, but for it's
> first parameter it requires a struct thread *td.
>
> What should I pass to it? (I'm calling it from inside a screensaver module)
You could try lying about which thread you are, when you aren't in
a userland thread:
Cscope tag: kernel_sysctlbyname
# line filename / context / line
1 728 /sys/dev/vinum/vinumio.c <<vinum_scandisk>>
error = kernel_sysctlbyname(&thread0, "kern.disks", NULL,
2 741 /sys/dev/vinum/vinumio.c <<vinum_scandisk>>
kernel_sysctlbyname(&thread0, "kern.disks", devicename,
3 305 /sys/i386/i386/elan-mmcr.c <<init_AMD_Elan_sc520>>
i = kernel_sysctlbyname(&thread0, "machdep.i8254_freq",
BMS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040226133159.GA17994>
