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] Add getcpu


* H. J. Lu:

> +extern int __getcpu (unsigned *, unsigned *) __THROW;

“unsigned int”; perhaps  use __typeof__ (getcpu)?

> diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
> index 34f27a7d9b..ea5d51a80d 100644
> --- a/sysdeps/unix/sysv/linux/bits/sched.h
> +++ b/sysdeps/unix/sysv/linux/bits/sched.h
> @@ -86,6 +86,9 @@ extern int unshare (int __flags) __THROW;
>  /* Get index of currently used CPU.  */
>  extern int sched_getcpu (void) __THROW;
>  
> +/* Get currently used CPU and NUMA node.  */
> +extern int getcpu (unsigned int *, unsigned int *) __THROW;

Can either pointer be NULL?

> +__getcpu (unsigned *cpu, unsigned *node)

“unsigned int”.

> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-affinity-getcpu.c
> @@ -0,0 +1,292 @@
> +/* Test case for CPU affinity functions with getcpu.
> +   Copyright (C) 2018 Free Software Foundation, Inc.

I think this is a copy of another test, right?

Maybe we should move bits of it to support/?

We have a parallel discussion about a new requirement that all new
functions must have documentation in the manual.  I don't know what will
come out of that.

Thanks,
Florian


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