File: 0007-Fix-rt-tests-build-with-glibc-2.41.patch

package info (click to toggle)
rt-tests 2.6-1.1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 904 kB
  • sloc: ansic: 12,999; python: 493; makefile: 225; sh: 154
file content (52 lines) | stat: -rw-r--r-- 1,410 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Wed, 29 Jan 2025 16:46:11 -0500
Subject: Fix rt-tests build with glibc-2.41

The sched_*attr APIs were added to glibc
https://sourceware.org/git/?p=glibc.git;a=commit;h=21571ca0d70302909cf72707b2a7736cf12190a0

This fixes the build conflict in rt-tests with glibc-2.4

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/include/rt-sched.h | 2 ++
 src/lib/rt-sched.c     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/include/rt-sched.h b/src/include/rt-sched.h
index 80171c7..dfd7f45 100644
--- a/src/include/rt-sched.h
+++ b/src/include/rt-sched.h
@@ -42,6 +42,7 @@
 #define __NR_sched_getattr		275
 #endif
 
+#if ! __GLIBC_PREREQ(2, 41)
 struct sched_attr {
 	uint32_t size;
 	uint32_t sched_policy;
@@ -67,5 +68,6 @@ int sched_getattr(pid_t pid,
 		  struct sched_attr *attr,
 		  unsigned int size,
 		  unsigned int flags);
+#endif
 
 #endif /* __RT_SCHED_H__ */
diff --git a/src/lib/rt-sched.c b/src/lib/rt-sched.c
index 8023bc7..2500abd 100644
--- a/src/lib/rt-sched.c
+++ b/src/lib/rt-sched.c
@@ -14,6 +14,7 @@
 
 #include "rt-sched.h"
 
+#if ! __GLIBC_PREREQ(2, 41)
 int sched_setattr(pid_t pid,
 		  const struct sched_attr *attr,
 		  unsigned int flags)
@@ -28,3 +29,4 @@ int sched_getattr(pid_t pid,
 {
 	return syscall(__NR_sched_getattr, pid, attr, size, flags);
 }
+#endif