Description: Fix FTBFS with newer glibc/kernel headers: rseq enum redefinition
 criu/include/linux/rseq.h unconditionally included <sys/rseq.h> while also
 defining enum rseq_flags, enum rseq_cs_flags_bit and enum rseq_cs_flags
 when CONFIG_HAS_NO_LIBC_RSEQ_DEFS is set. With newer glibc (2.43) and
 kernel UAPI headers that already provide those enums in sys/rseq.h, this
 caused conflicting enum redefinition build errors.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Origin: upstream, https://github.com/checkpoint-restore/criu
Last-Update: 2026-09-01

--- crac-criu-4.2.orig/criu/include/linux/rseq.h
+++ crac-criu-4.2/criu/include/linux/rseq.h
@@ -2,12 +2,6 @@
 #ifndef _UAPI_LINUX_RSEQ_H
 #define _UAPI_LINUX_RSEQ_H
 
-#ifdef __has_include
-#if __has_include("sys/rseq.h")
-#include <sys/rseq.h>
-#endif
-#endif
-
 #include "asm/thread_pointer.h"
 
 #include <linux/types.h>
@@ -44,6 +38,8 @@ enum rseq_cs_flags {
 	RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL = (1U << RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT),
 	RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE = (1U << RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT),
 };
+#else
+#include <sys/rseq.h>
 #endif /* CONFIG_HAS_NO_LIBC_RSEQ_DEFS */
 
 /*
