[lkml]   [2005]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
I am trying to find the pid of the process with out using the
getpid() using the following program.

int main()
struct thread_info * threadInfo = current_thread_info();
struct task_struct *taskInfo = threadInfo->task;
printf("Pid Is %d\n",taskInfo->pid);

And when i try to compile using
gcc -Wall pid.c

Then I am getting so many errors like

pid.c:9: warning: implicit declaration of function `current_thread_info'
pid.c:9: warning: initialization makes pointer from integer without a cast
pid.c:10: error: dereferencing pointer to incomplete type
pid.c:11: error: dereferencing pointer to incomplete type

Will you please help me.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-27 09:29    [W:0.033 / U:1.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site