Re: current task and pid assignment to a pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/9/06, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
Hi all
I tried a simple snippet like
...
struct task_struct *p;
p = current;
printk(KERN_DEBUG "%u", p->pid);
...

Its gave me an error compiling the module with message "error:
dereferencing pointer to incomplete type" , but i can use current->pid
and it compiles fine. Why is then using p giving me an error?

Since, current is an inline function returning struct task_struct *,
it should work fine.

For your error message it seems that sched.h and/or asm/current.h is
not included?

Did you include <asm/current.h> and <sched.h>?  :)

regards
Manish Regmi

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux