linux驱动程序开发上面例子pipe.c不能在内核2.6.35加载的原因

caoyin-Lenovo:~/LDD/6$make

出现下列错误

> drivers/char/rtc.c:271: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
> drivers/char/rtc.c:271: error: (Each undeclared identifier is reported only once
> drivers/char/rtc.c:271: error: for each function it appears in.)
> drivers/char/rtc.c:273: error: 'SIGIO' undeclared (first use in this function)
> drivers/char/rtc.c:273: error: 'POLL_IN' undeclared (first use in this function)
> drivers/char/rtc.c: In function 'rtc_read':
> drivers/char/rtc.c:362: error: implicit declaration of function '__set_current_state'
> drivers/char/rtc.c:362: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
> drivers/char/rtc.c:376: error: implicit declaration of function 'signal_pending'
> drivers/char/rtc.c:380: error: implicit declaration of function 'schedule'
> drivers/char/rtc.c:393: error: 'TASK_RUNNING' undeclared (first use in this function)
> drivers/char/rtc.c: In function 'rtc_dropped_irq':
> drivers/char/rtc.c:1206: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
> drivers/char/rtc.c:1208: error: 'SIGIO' undeclared (first use in this function)
> drivers/char/rtc.c:1208: error: 'POLL_IN' undeclared (first use in this function)

> make[2]: *** [drivers/char/rtc.o] Error

这是因为2.6内核已经不支持以前的头文件,需要在pipe.c中加载头文件#include <linux/sched.h>


你可能感兴趣的:(linux,function,each,Signal,程序开发)