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, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
Hi...

> Hi all
> I tried a simple snippet like
> ...
> struct task_struct *p;
> p = current;
> printk(KERN_DEBUG "%u", p->pid);

Try to do like below:
struct task_struct *p = current

In other word, maybe you need to enforce type cast....
What is difference between p = current and struct task_struct *p = current.
Casting like what? how willl i cast in this case? any pointer?

> Second When i looked at the dmesg after insmod i found the pid
> 3846,fine to me but when i rmmod the module i found that the same
> entery has change to 3846<7> . Why didnt the KERN_DEBUG priority i.e
> <7> is printed earlier?
> How did you find out that "3846" has been changed to "3846<7>"? Without
looking at your complete code, maybe it is just printk that showed you
the message priority. What debug features  you had enabled ?
I know this because i have enabled timing infornations in the printks
while compiling the kernel. So i can figure it out if it is the same
printk output or not and i think it is the same.

regards

Mulyadi




--
play the game

--
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