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

Zong Li zong.li@sifive.com
Thu Oct 29 17:07:38 GMT 2020


On Thu, Oct 29, 2020 at 4:53 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * 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.

Okay, remove it in the next version.

>
> 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