glibc/SOURCES/glibc-RHEL-61558-4.patch

46 lines
1.4 KiB
Diff

From 579f8668816b35f8302e89e5255aff60b81938df Mon Sep 17 00:00:00 2001
From: DJ Delorie <dj@redhat.com>
Date: Thu, 15 May 2025 16:38:11 -0400
Subject: [PATCH] manual: add sched_getcpu()
Content-type: text/plain; charset=UTF-8
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
---
manual/resource.texi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
Conflicts
manual/resource.texi
rebased for line numbers
diff --git a/manual/resource.texi b/manual/resource.texi
index a9b4b68e2f..39df1c4cb6 100644
--- a/manual/resource.texi
+++ b/manual/resource.texi
@@ -1654,6 +1654,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:
--
2.43.5