Kernel Ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




	Recently I had some help from somebody on the openprojects irc 
server in channel #kernelnewbies.
	I was asking how ioctl works and what not, and was extremely 
confussed. My purpose of this letter is to ask some questions, but to also 
make sure my understanding of it is correct and not false.
So... I will start off my showing an example which I grabbed from the 
kernel source for the pci watchdog (wdt_pci.c). This is just one of the 
options the card supports.

case WDIOC_KEEPALIVE:
       wdtpci_ping();
       return 0;

So basicly wdtpci_ping() is the code for WDIOC_KEEPALIVE.
(What to do when WDIOC_KEEPALIVE is called).
(is my thinking on this correct?)

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.

	Could somebody please clear this up for me?


Thanks alot

-Dan Erickson-
-ColdOneKnight@rogers.com-



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux