]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/getcpu.2
Start of man-pages-5.03: renaming .Announce and .lsm files
[thirdparty/man-pages.git] / man2 / getcpu.2
index 84e35e88b430eab728acce84a1d72801dccc30af..fc36b43b50e1bfbced7f29ec0b94aa371ef78687 100644 (file)
@@ -9,19 +9,16 @@
 .\"
 .\" 2008, mtk, various edits
 .\"
-.TH GETCPU 2 2013-04-03 "Linux" "Linux Programmer's Manual"
+.TH GETCPU 2 2019-03-06 "Linux" "Linux Programmer's Manual"
 .SH NAME
 getcpu \- determine CPU and NUMA node on which the calling thread is running
 .SH SYNOPSIS
 .nf
 .B #include <linux/getcpu.h>
-.sp
+.PP
 .BI "int getcpu(unsigned *" cpu ", unsigned *" node \
 ", struct getcpu_cache *" tcache );
 .fi
-
-.IR Note :
-There is no glibc wrapper for this system call; see NOTES.
 .SH DESCRIPTION
 The
 .BR getcpu ()
@@ -39,11 +36,11 @@ When either
 or
 .I node
 is NULL nothing is written to the respective pointer.
-
+.PP
 The third argument to this system call is nowadays unused,
 and should be specified as NULL
 unless portability to Linux 2.6.23 or earlier is required (see NOTES).
-
+.PP
 The information placed in
 .I cpu
 is guaranteed to be current only at the time of the call:
@@ -69,23 +66,23 @@ is set appropriately.
 Arguments point outside the calling process's address space.
 .SH VERSIONS
 .BR getcpu ()
-was added in kernel 2.6.19 for x86_64 and i386.
+was added in kernel 2.6.19 for x86-64 and i386.
+Library support was added in glibc 2.29
+(Earlier glibc versions did not provide a wrapper for this system call,
+necessitating the use of
+.BR syscall (2).)
 .SH CONFORMING TO
 .BR getcpu ()
 is Linux-specific.
 .SH NOTES
 Linux makes a best effort to make this call as fast as possible.
+(On some architectures, this is done via an implementation in the
+.BR vdso (7).)
 The intention of
 .BR getcpu ()
 is to allow programs to make optimizations with per-CPU data
 or for NUMA optimization.
-
-Glibc does not provide a wrapper for this system call; call it using
-.BR syscall (2);
-or use
-.BR sched_getcpu (3)
-instead.
-
+.PP
 The
 .I tcache
 argument is unused since Linux 2.6.24.
@@ -141,4 +138,5 @@ migrating threads between CPUs, and so the argument is now ignored.
 .BR sched_setaffinity (2),
 .BR set_mempolicy (2),
 .BR sched_getcpu (3),
-.BR cpuset (7)
+.BR cpuset (7),
+.BR vdso (7)