[PATCH 1/1] riscv: Get cache information through sysconf

Florian Weimer fweimer@redhat.com
Thu Oct 29 08:52:54 GMT 2020


* Zong Li:

> Like my previous mail, I'd like to make sure that I actually pick up
> all suggestions before I send the next version. This modification adds
> a local getauxval2_einval function for internal use to handle the
> error setting. Thanks for everyone's review.
>
> +static bool
> +getauxval2_einval (unsigned long int type, unsigned long int *result)
> +{
> +  int save_errno = errno;
> +
> +  __set_errno (0);
> +
> +  if (!__getauxval2 (type, result))
> +    {
> +      __set_errno (EINVAL);
> +      return false;
> +    }
> +
> +  __set_errno (save_errno);
> +
> +  return true;
> +}

If you use __getauxval2, you don't have to save and restore errno.
__set_errno (EINVAL) on error is enough.

getauxval2_einval should probably be declared inline.

The rest looks like what I would expect.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Libc-alpha mailing list