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
30       When woken, the thread will run threadfn() with data as its argument.
31       threadfn() can either call do_exit directly if it is a standalone
32       thread for which noone will call kthread_stop, or return when
33       'kthread_should_stop' is true (which means kthread_stop has been
34       called). The return value should be zero or a negative error number; it
35       will be passed to kthread_stop.
36
37       Returns a task_struct or ERR_PTR(-ENOMEM).
38
40Kernel Hackers Manual 2.6.       November 2011               KTHREAD_CREATE(9)
Impressum