Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux/device/class.h: No such file or directory #1

Open
Zabrane opened this issue Oct 17, 2022 · 5 comments
Open

linux/device/class.h: No such file or directory #1

Zabrane opened this issue Oct 17, 2022 · 5 comments

Comments

@Zabrane
Copy link

Zabrane commented Oct 17, 2022

I'm unable to compile the kernel module on my Ubuntu 20.04 LTS.

$ make
make -C /lib/modules/5.4.0-128-generic/build M=/home/zab/fanout modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-128-generic'
  CC [M]  /home/zab/fanout/fanout.o
/home/zab/fanout/fanout.c:28:12: fatal error: linux/device/class.h: No such file or directory
   28 | #  include <linux/device/class.h>
      |            ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:270: /home/zab/fanout/fanout.o] Error 1
make[1]: *** [Makefile:1762: /home/zab/fanout] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-128-generic'
make: *** [Makefile:8: all] Error 2

Advice please?

@bob-linuxtoys
Copy link
Owner

bob-linuxtoys commented Oct 17, 2022 via email

@Zabrane
Copy link
Author

Zabrane commented Oct 17, 2022

@bob-linuxtoys thanks a lot. Now it compiles but i still can't see the 08 nodes:

$ sudo modprobe fanout
$ sudo lsmod | grep fanout
fanout                 16384  0
$ ls /dev/fanout*
"/dev/fanout*": No such file or directory (os error 2)

@bob-linuxtoys
Copy link
Owner

bob-linuxtoys commented Oct 17, 2022 via email

@Zabrane
Copy link
Author

Zabrane commented Oct 17, 2022

Wow, real magic:

$ grep fanout /proc/devices
240 fanout
$ for i in `seq 0 7`; do mknod /dev/fanout$i c 240 $i; done

You could maybe update the doc for newcomers like myself ;-)

@Zabrane
Copy link
Author

Zabrane commented Oct 17, 2022

@bob-linuxtoys how fast this PubSub can be? I'm now really intrigued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants