Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What options do we have for communication between a user program and a Linux Kernel Module?

I am a new comer to Linux Kernel Module programming. From the material that I have read so far, I have found that there are 3 ways for a user program to request services or to communicate with a Linux Kernel Module

  1. a device file in /dev
  2. a file in /proc file system
  3. ioctl() call

Question: What other options do we have for communication between user program and linux kernel module?

like image 605
binW Avatar asked Jul 20 '10 13:07

binW


1 Answers

Your option 3) is really a sub-option of option 1) - ioctl() is one way of interacting with a device file (read() and write() being the usual ways).

Two other ways worth considering are:

  • The sysfs filesystem;
  • Netlink sockets.
like image 72
caf Avatar answered Sep 19 '22 17:09

caf