LINUX操作系统下版本不同的一些问题
find_task未定义,提示find_task_by_vpid" undefined
图片: 可能在make编译过程中仅仅是警告没有报错,但在后面的装载会出现错误
图片:
由于内核版本的不同,系统函数find_task_by_vpid()
可能使用不了,使用函数指针来解决这个问题。查了一下pid_task
的定义,发现它的参数类型与find_task_by_vpid
不一样,需要使用find_vpid
来转换一下。改成pid_task(find_vpid(pid), PIDTYPE_PID)
。输出正常。
图片:
error:dereferencing pointer to incomplet the type 'struct task_struct'
error:implicit declaration of function 'raw