我正在用Linux编写一个系统调用,为此,我想使用 kthread_run 创建几个线程。然而,当我传递函数指针时,我得到:
kthread_run
error: passing argument 1 of ‘kthread_create_on_node’ from incompatible pointer type
相关代码如下:
//method to do nothing for 100 milliseconds int exist() mdelay(100); return 0; //function pointer to exist int (*exist_ptr)(void) = ∃ //create processes and delta queues for (i = PROC_NUM - 1; i >= 0; i--) char name[6] = {'d', 'e', 'l', 't', 'a', i2}; delta_entry de = { .task = kthread_run(exist_ptr, NULL, name); .list = linked_list;