Index: libcfa/prelude/defines.hfa.in
===================================================================
--- libcfa/prelude/defines.hfa.in	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/prelude/defines.hfa.in	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -171,4 +171,10 @@
 #undef CFA_HAVE_LINUX_IO_URING_H
 
+/* Defined if librseq support is present when compiling libcfathread. */
+#undef CFA_HAVE_LINUX_LIBRSEQ
+
+/* Defined if rseq support is present when compiling libcfathread. */
+#undef CFA_HAVE_LINUX_RSEQ_H
+
 /* Defined if openat2 support is present when compiling libcfathread. */
 #undef CFA_HAVE_OPENAT2
@@ -205,4 +211,7 @@
 #undef HAVE_LINUX_IO_URING_H
 
+/* Define to 1 if you have the <linux/rseq.h> header file. */
+#undef HAVE_LINUX_RSEQ_H
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
Index: libcfa/src/bits/signal.hfa
===================================================================
--- libcfa/src/bits/signal.hfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/bits/signal.hfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -20,7 +20,5 @@
 
 #include <errno.h>
-#define __USE_GNU
 #include <signal.h>
-#undef __USE_GNU
 #include <stdlib.h>
 #include <string.h>
Index: libcfa/src/concurrency/coroutine.cfa
===================================================================
--- libcfa/src/concurrency/coroutine.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/coroutine.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #include "coroutine.hfa"
Index: libcfa/src/concurrency/io.cfa
===================================================================
--- libcfa/src/concurrency/io.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/io.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #if defined(__CFA_DEBUG__)
@@ -23,5 +24,4 @@
 
 #if defined(CFA_HAVE_LINUX_IO_URING_H)
-	#define _GNU_SOURCE         /* See feature_test_macros(7) */
 	#include <errno.h>
 	#include <signal.h>
Index: libcfa/src/concurrency/io/setup.cfa
===================================================================
--- libcfa/src/concurrency/io/setup.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/io/setup.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,5 +15,5 @@
 
 #define __cforall_thread__
-#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#define _GNU_SOURCE
 
 #if defined(__CFA_DEBUG__)
Index: libcfa/src/concurrency/kernel.cfa
===================================================================
--- libcfa/src/concurrency/kernel.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/kernel.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,6 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
+
 // #define __CFA_DEBUG_PRINT_RUNTIME_CORE__
 
Index: libcfa/src/concurrency/kernel/startup.cfa
===================================================================
--- libcfa/src/concurrency/kernel/startup.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/kernel/startup.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 // C Includes
@@ -336,4 +337,8 @@
 	register_tls( proc );
 
+	#if defined(CFA_HAVE_LINUX_LIBRSEQ)
+		rseq_register_current_thread();
+	#endif
+
 	// SKULLDUGGERY: We want to create a context for the processor coroutine
 	// which is needed for the 2-step context switch. However, there is no reason
Index: libcfa/src/concurrency/locks.cfa
===================================================================
--- libcfa/src/concurrency/locks.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/locks.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -16,4 +16,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #include "locks.hfa"
Index: libcfa/src/concurrency/monitor.cfa
===================================================================
--- libcfa/src/concurrency/monitor.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/monitor.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #include "monitor.hfa"
Index: libcfa/src/concurrency/mutex.cfa
===================================================================
--- libcfa/src/concurrency/mutex.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/mutex.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -17,4 +17,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #include "mutex.hfa"
Index: libcfa/src/concurrency/preemption.cfa
===================================================================
--- libcfa/src/concurrency/preemption.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/preemption.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,6 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
+
 // #define __CFA_DEBUG_PRINT_PREEMPTION__
 
Index: libcfa/src/concurrency/ready_queue.cfa
===================================================================
--- libcfa/src/concurrency/ready_queue.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/ready_queue.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,6 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
+
 // #define __CFA_DEBUG_PRINT_READY_QUEUE__
 
@@ -24,5 +26,4 @@
 #include "kernel_private.hfa"
 
-#define _GNU_SOURCE
 #include "stdlib.hfa"
 #include "math.hfa"
Index: libcfa/src/concurrency/thread.cfa
===================================================================
--- libcfa/src/concurrency/thread.cfa	(revision 45fde9f4fa966516f7ec2ec41a39a93b864e08d2)
+++ libcfa/src/concurrency/thread.cfa	(revision 43784ac7ca1579ca19d7dc8bc4e1423986fd4d97)
@@ -15,4 +15,5 @@
 
 #define __cforall_thread__
+#define _GNU_SOURCE
 
 #include "thread.hfa"
