- 论坛徽章:
- 0
|
int init_module()
{
netlink_exam_sock = netlink_kernel_create(NETLINK_GENERIC, 0,recv_handler,NULL);
if (!netlink_exam_sock)
{
printk("Fail to create netlink socket.\n");
return 1;
}
kernel_thread(process_message_thread, NULL, CLONE_KERNEL);
return 0;
}
void cleanup_module()
{
exit_flag = 1;
wake_up(netlink_exam_sock->sk_sleep);
wait_for_completion(&exit_completion);
sock_release(netlink_exam_sock->sk_socket);
}
insmod 模块后能运行,但我想卸除模块的时候,总是显示 Device or resource busy
请问我怎样才能撤销内核线程?哪位高人指点一下,谢谢了 |
|