Search code examples
clinuxlinux-kernelsleep

How to sleep in the Linux kernel?


Can I use the msleep() function to sleep for a specified amount of time in kernel space? If so, which header files do I need to include? #include <linux/time.h> doesn't seem to be the right one. Is there perhaps a better function for this purpose?


Solution

  • I needed to include <linux/delay.h> to use msleep in kernel space.