[Tux3] Bug? Atom refcounting redux

OGAWA Hirofumi hirofumi at mail.parknet.co.jp
Tue Dec 2 01:44:08 PST 2008

Daniel Phillips <phillips at phunq.net> 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,,,);

        	assert(err < 0);
                return error_base + -err;

        	return -(long)(ptr - error_base);

        	return (error_base < ptr && ptr <= error_base + MAX_ERRNO);
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>

Tux3 mailing list
Tux3 at tux3.org

More information about the Tux3 mailing list