Daniel Phillips <[EMAIL PROTECTED]> writes:
> ...or:
>
> if (IS_ERR(buffer = blockread(inode->map, block)))
> return PTR_ERR(buffer);
>
> Anybody have an opinion on whether IS_ERR works just as well in user
> space as in kernel?
It would work if kernel reserved that range as kernel space like linux.
Well, if we want to make sure it, I think we can reserve the address
range for it.
e.g. maybe
error_base = mmap(,MAX_ERRNO + 1,PROT_NONE,,,);
ERR_PTR(err)
assert(err < 0);
return error_base + -err;
PTR_ERR(ptr)
return -(long)(ptr - error_base);
IS_ERR(ptr)
return (error_base < ptr && ptr <= error_base + MAX_ERRNO);
--
OGAWA Hirofumi <[EMAIL PROTECTED]>
_______________________________________________
Tux3 mailing list
[email protected]
http://tux3.org/cgi-bin/mailman/listinfo/tux3