RE: return negative number for unsigned long function in kernel

2007-03-07 Thread Chen, Dongliang
o:[EMAIL PROTECTED] Sent: Tuesday, March 06, 2007 7:39 PM To: Chen, Dongliang Cc: linux-kernel@vger.kernel.org Subject: Re: return negative number for unsigned long function in kernel H. Peter Anvin wrote: >If you want to test for errorness, you could use the macro >IS_ERR_VALUE(). Unfortuna

return negative number for unsigned long function in kernel

2007-03-06 Thread Chen, Dongliang
There are lots of functions in the Linux kernel that are declared as unsigned long, but the return value is negative integer while error occurred. An example of these functions is do_mmap_pgoff in mm/mmap.c, which is defined as: unsigned long do_mmap_pgoff() In this function, it returns -ENOD