Re: return negative number for unsigned long function in kernel

H. Peter Anvin
2007-03-07T16:31:08Z

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)(-1000L), which is in the address range one page below the maximum
> virtual address, then IS_ERR_VALUE() should work.
>

The error value boundary is defined in <linux/err.h>, currently 4095.

-hpa