1

In my kernel module I'd like to create multiple FDs, and pass them later to the user-space via ioctl.

The user-space code will use these FDs to wait for an event using poll() or select().

If I were creating such FDs in the user-space, I'd call eventfd(), but how do that in the kernel-space?

Igor R.
  • 14,716
  • 2
  • 49
  • 83

1 Answers1

0

According to system call's expansion macro (#define SYSCALL_DEFINEx) in syscalls.h, maybe you can call sys_eventfd or sys_eventfd2 in the kernel-space.

X Zhang
  • 197
  • 1
  • 6
  • It seems that neither of these functions is exported from the kernel. When building, I get `WARNING: "sys_eventfd" [/my_path/my_module.ko] undefined!` – Igor R. Dec 17 '14 at 14:39
  • From what I can gather, doing syscalls from kernelspace is deprecated. I'm not sure what is supposed to replace it (see http://stackoverflow.com/questions/15841327/can-we-call-system-call-in-kernel-space) – John Dec 19 '14 at 20:43