[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Kernel Ioctl
On Mon, 1 Apr 2002, Dan Erickson wrote:
> I asked the person I was talking to on #kernelnewbies what sends the
> command? ie) the unsigned int cmd in ioctl.
> And he said a userspace program sends the command. Is this true?
> What I mean, is that something needs to say "I want to keep the computer
> alive". So I will call WDIOC_KEEPALIVE to do this for me. And it was
> highly confussing me as to what actualy sends the WDIOC_KEEPALIVE to the
> driver.
Open the watchdog character device (e.g. /dev/watchdog) and then pass the
file descriptor to ioctl(2), you can then manipulate the device
using ioctl with the requested ioctl (e.g. WDIOC_KEEPALIVE) as the second
paramter. So yes it is a userland program which you'd use. Try writing a
watchdog program/daemon and you'll understand how it works.
Cheers,
Zwane
--
http://function.linuxpower.ca
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/