glibc/sysdeps/unix/sysv/linux/bits
H.J. Lu a092ca9453 Add getcpu
Add

  #include <sched.h>

  int getcpu (unsigned int *cpu, unsigned int *node);

to return currently used CPU and NUMA node.

Tested on x86-64, x32 and i686 as well as with build-many-glibcs.py.

	* NEWS: Mention getcpu.
	* include/sched.h (__getcpu): New libc_hidden_proto.
	* manual/resource.texi: Document getcpu.
	* sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add getcpu.
	* sysdeps/unix/sysv/linux/Versions (GLIBC_2.29): Add getcpu.
	* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Add getcpu.
	* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/bits/sched.h (getcpu): New prototype.
	* sysdeps/unix/sysv/linux/getcpu.c: New file.
	* sysdeps/unix/sysv/linux/tst-skeleton-affinity.c (test_size):
	Also check getcpu.
2018-12-07 09:17:50 -08:00
..
types signal: Use correct type for si_band in siginfo_t [BZ #23562] 2018-10-19 18:06:32 +02:00
a.out.h Update. 2003-07-25 09:06:04 +00:00
dirent.h Define _DIRENT_MATCHES_DIRENT64 regardless 2018-03-05 18:10:04 -03:00
epoll.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
errno.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
eventfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fcntl-linux.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
fcntl.h Update. 2000-09-01 07:14:30 +00:00
in.h Add IPV6_FREEBIND from Linux 4.15. 2018-02-06 00:41:34 +00:00
initspin.h Update. 2000-10-15 06:50:42 +00:00
inotify.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ioctl-types.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ioctls.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ipc.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
local_lim.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mman-linux.h Move MREMAP_* to bits/mman-shared.h. 2018-10-01 20:30:57 +00:00
mman-map-flags-generic.h Share MAP_* flags between more architectures. 2018-09-26 12:33:14 +00:00
mman-shared.h Move MREMAP_* to bits/mman-shared.h. 2018-10-01 20:30:57 +00:00
mman.h Share MAP_* flags between more architectures. 2018-09-26 12:33:14 +00:00
mqueue.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
msq-pad.h Y2038: provide size of default time_t for target architecture 2018-10-24 11:37:09 +02:00
msq.h Use single bits/msq.h for all architectures. 2018-10-11 12:07:27 +00:00
param.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
poll.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
posix_opt.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
procfs-extra.h Unify more sys/procfs.h headers. 2018-09-25 16:49:25 +00:00
procfs-id.h Unify more sys/procfs.h headers. 2018-09-25 16:49:25 +00:00
procfs-prregset.h Complete sys/procfs.h unification. 2018-09-25 16:50:30 +00:00
procfs.h Unify some sys/procfs.h headers. 2018-09-25 16:48:15 +00:00
ptrace-shared.h Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h. 2018-04-24 12:11:35 +00:00
resource.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sched.h Add getcpu 2018-12-07 09:17:50 -08:00
sem-pad.h Y2038: provide size of default time_t for target architecture 2018-10-24 11:37:09 +02:00
sem.h Use single bits/sem.h for all architectures. 2018-10-15 19:28:04 +00:00
shm-pad.h Y2038: provide size of default time_t for target architecture 2018-10-24 11:37:09 +02:00
shm.h Use single bits/shm.h for all architectures. 2018-10-17 11:56:28 +00:00
shmlba.h Move SHMLBA to its own header. 2018-10-17 11:55:10 +00:00
sigaction.h hurd: Fix includability of <hurd/signal.h> in all standards 2018-03-05 22:50:29 +01:00
sigcontext.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sigevent-consts.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
siginfo-arch.h Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
siginfo-consts-arch.h Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
siginfo-consts.h Update siginfo constants from Linux kernel (bug 21286). 2018-09-17 12:41:14 +00:00
signalfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
signum.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sigstack.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
socket_type.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
socket.h Add PF_XDP, AF_XDP and SOL_XDP from Linux 4.18 to bits/socket.h. 2018-08-21 17:22:53 +00:00
ss_flags.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
stat.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
statfs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
statvfs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sys_errlist.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sysctl.h Add sysctl.mk and bits/sysctl.h 2012-05-22 13:46:29 -07:00
termios.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
time.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
timerfd.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
timex.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uio_lim.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uio-ext.h Update RWF_SUPPORTED for Linux kernel 4.16 [BZ #22947] 2018-04-03 12:19:29 -07:00
utsname.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
waitflags.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00