Re: "task_struct current" problems

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

 



4 struct task_struct;
5 
6 static inline struct task_struct * get_current(void)
7 {
8     struct task_struct *current;
9     __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
10     return current;
11  }
12 
13 #define current get_current()

Look beyond the macro. 

<quote sender="Nir Tzachar">
> > current is globally defined as
> > a task_struct that point to current user.
> wrong.
> 
> both in 2.4 and 2.6, current is defined like this:
> #define current get_current() ,
> which return the address by means of the the kernel stack.
> 
> ========================================================================
> nir.
> 

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