Re: Can mm_struct of a process be null?

2013-11-17 Thread Chetan Nanda
Yes, current->mm points to user space context for the current process. Now for a kernel threads there is no user space context and for them current->mm would be NULL. Thanks, Chetan Nanda On Fri, Nov 15, 2013 at 9:54 PM, Paul Davies C wrote: > Hi, > I happen to find this code snippet in th

Re: Can mm_struct of a process be null?

2013-11-15 Thread Daniel Baluta
On Fri, Nov 15, 2013 at 6:24 PM, Paul Davies C wrote: > Hi, > I happen to find this code snippet in the kernel source : > > struct mm_struct *mm=current->mm; > > /* some other code */ > > if(mm){ /*<==Why is this here? */ > /*read the contents by locking*/ > } > > The i

Can mm_struct of a process be null?

2013-11-15 Thread Paul Davies C
Hi, I happen to find this code snippet in the kernel source : **/*struct mm_struct *mm=current->mm**;** ** /* some other code */ **if(mm){ /*<==Why is **this here? */** **/*read the contents by locking*/** **} */The/if /checks whether the mm_struct of the current process