Re: return negative number for unsigned long function in kernel

2007-03-07 Thread H. Peter Anvin
Chen, Dongliang wrote: Peter & Andreas, Thank you very much for your help. I understood that the kernel error numbers are limited. The largest error number for i386 (kernel 2.6) is 131 so far. Assume that the virtual address returned from do_mmap_pgoff will never exceed (unsigned long)(-1000

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

Re: return negative number for unsigned long function in kernel

2007-03-06 Thread H. Peter Anvin
Chen, Dongliang wrote: 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 f

Re: return negative number for unsigned long function in kernel

2007-03-06 Thread Andreas Schwab
"Chen, Dongliang" <[EMAIL PROTECTED]> writes: > 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 lo