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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -