]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: add sched_getcpu()
authorDJ Delorie <dj@redhat.com>
Thu, 15 May 2025 20:38:11 +0000 (16:38 -0400)
committerDJ Delorie <dj@redhat.com>
Fri, 16 May 2025 17:16:08 +0000 (13:16 -0400)
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
manual/resource.texi

index a9b4b68e2f7fb302a17e3b4a85dd4dd65b499b45..39df1c4cb657f277e6586c9bb5e25739b80b4581 100644 (file)
@@ -1653,6 +1653,22 @@ The operating system does not support this function.
 This function is Linux-specific and is declared in @file{sched.h}.
 @end deftypefun
 
+@deftypefun int sched_getcpu (void)
+@standards{Linux, <sched.h>}
+
+Similar to @code{getcpu} but with a simpler interface.  On success,
+returns a nonnegative number identifying the CPU on which the current
+thread is running.  Returns @code{-1} on failure.  The following
+@code{errno} error condition is defined for this function:
+
+@table @code
+@item ENOSYS
+The operating system does not support this function.
+@end table
+
+This function is Linux-specific and is declared in @file{sched.h}.
+@end deftypefun
+
 Here's an example of how to use most of the above to limit the number
 of CPUs a process runs on, not including error handling or good logic
 on CPU choices: