1KTHREAD_CREATE(9)                Driver Basics               KTHREAD_CREATE(9)
2
3
4

NAME

6       kthread_create - create a kthread.
7

SYNOPSIS

9       struct task_struct * kthread_create(int (*threadfn) (void *data),
10                                           void * data, const char namefmt[],
11                                           ...);
12

ARGUMENTS

14       threadfn
15           the function to run until signal_pending(current).
16
17       data
18           data ptr for threadfn.
19
20       namefmt[]
21           printf-style name for the thread.
22
23       ...
24           variable arguments
25

DESCRIPTION

27       This helper function creates and names a kernel thread. The thread will
28       be stopped: use wake_up_process to start it. See also kthread_run,
29       kthread_create_on_cpu.
30
31       When woken, the thread will run threadfn() with data as its argument.
32       threadfn() can either call do_exit directly if it is a standalone
33       thread for which noone will call kthread_stop, or return when
34       ´kthread_should_stop´ is true (which means kthread_stop has been
35       called). The return value should be zero or a negative error number; it
36       will be passed to kthread_stop.
37
38       Returns a task_struct or ERR_PTR(-ENOMEM).
39
41Kernel Hackers Manual 2.6.         June 2019                 KTHREAD_CREATE(9)
Impressum