This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Add cache info for powerpc64


On 06/09/2017 06:12 AM, Tulio Magno Quites Machado Filho wrote:
Richard Henderson <rth@twiddle.net> writes:

The actual cache info was added for 4.11, but have a guess at the
L1 linesizes using info provided by older kernels.

	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysconf.c: New file.

There is already a patch reviewed and approved here:
https://patchwork.sourceware.org/patch/20202/


+static long
+auxv2sysconf (unsigned long type)
+{
+  long rc;
+  rc = getauxval (type);
+  if (rc == 0)
+  {
+    __set_errno (EINVAL);
+    rc = -1;
+  }
+  return rc;

Setting EINVAL is wrong. That would imply that the _SC_* name supplied by the caller is invalid somehow.

The return value should be 0 when the cache parameter is unknown, and -1 only when it is known that the cache level does not exist.

You should be using __getauxval to match the hidden_proto...


But this patch is blocked because it depends on another patch that's waiting
for review:
https://patchwork.sourceware.org/patch/20582/


... defined here.  But this second patch does look right.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]