如何在Linux内核中睡眠? [英] How to sleep in the Linux kernel?

查看:160
本文介绍了如何在Linux内核中睡眠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用msleep()函数在内核空间中休眠指定的时间吗?如果是这样,我需要包括哪些头文件? #include <linux/time.h>似乎不是正确的选择.为此目的也许有更好的功能吗?

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?

推荐答案

我需要包含<linux/delay.h>才能在内核空间中使用msleep.

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

这篇关于如何在Linux内核中睡眠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆