How to get a kernel thread ID? -



How to get a kernel thread ID? -

when create kernel thread using kthread_run(), how can tid of thread, there pthread_self() or gettid() in kernel space?

in kernel-space, don't need inquire thread in userspace calling gettid() -- have access task_struct of task:

struct task_struct* tsk = kthread_run(...); pid_t tid = tsk->pid; // thread id of newly created task (if successful)

linux-kernel

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -