I’m trying to write a kernel module which uses sched_setaffinity(). It’s declared in linux/sched.h but implemented in core.c (afaik), now the problem is it seems my system does not have core.c anywhere so the linking fails (sched_setaffinity undefined). I’ve been trying to google around but made no progress.. I have the linux-kernel-source package installed, is there something like kernel-devel (as in redhat distros) I should be aware of? What would be a fix for this? I also tried downloading a full kernel source and copy those missing files to the kernel source dir in /usr/src/, but didn’t work out well..
Thanks!
I’m using a lubuntu system, kernel is of version 3.5.0-21-generic
Try installing the package
linux-headers-generic. This installs the kernel headers and creates the symlink /lib/modules/version/build that many kernel modules (and kernel module building tutorials) expect to be there.