[Cbe-oss-dev] [PATCH] libspe2: Fix return value of spe_ps_area_get

Jeremy Kerr jk at ozlabs.org
Mon Apr 23 22:48:43 EST 2007


Kazunori-san,

> -	return (void*) -1;
> +
> +	if (ptr == (void*)-1) {
> +		errno = EACCES;
> +		return NULL;
> +	}
> +

I think MAP_FAILED would be better here, rather than explicitly using 
(void *)-1.

Alternatively, should the API say that MAP_FAILED is the correct error 
code?

Regards,


Jeremy



More information about the cbe-oss-dev mailing list