Re: process 0 ("swapper")

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

 



On Sat, 2013-02-16 at 18:48 +0200, Kevin Wilson wrote:
> Hi,
> 
> > we see this code in proc_pid_lookup:
> >
> >         tgid = name_to_int(dentry);
> >         if (tgid == ~0U)
> >                 goto out;
It is the error case when name can't be converted to integer i.e.
name is wrong.
> >
> > In other words, if you ask for pid 0, it bails and doesn't return anything.
> 
> Are you sure that this is what it cjecks?
> 
>  ~0U is not 0 but -1;
right
> 
> for example, try:
> 	printf("%d\n",~0U );
> 	printf("%x\n",~0U );	
> 	printf("%x\n",-1 );
> and you get:
> -1
> ffffffff
> ffffffff
> rgs
> Kevin
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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