下面是程序片段
#include "/usr/src/linux-2.4.20/include/linux/sched.h"
char buffer[999];
struct wait_queue_head_t *buffer_s = NULL;
struct wait_queue_head_t *buffer_g = NULL;
static int read_A(struct file *file, char *buf, size_t count, loff_t *p)
{
while(buffer_flg == 0) sleep_on(&buffer_g);
while(,,,)
put_user(buffer, buf+i);
buffer_flg = 0;
wake_up(&buffer_g);
return x;
}
编译时总是
warning: passing arg 1 of `sleep_on' from incompatible pointer type
warning: passing arg 1 of `__wake_up' from incompatible pointer type
十分郁闷:原型就是这个定义的,
struct wait_queue_head_t *
怎么会警告?
(如强制执行会出现内存方面的错误!)
望给予指导!
谢谢! |