aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/rseq-internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h
index 3993431..00be15c 100644
--- a/sysdeps/unix/sysv/linux/rseq-internal.h
+++ b/sysdeps/unix/sysv/linux/rseq-internal.h
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <sys/rseq.h>
#include <ldsodefs.h>
+#include <thread_pointer.h>
/* Minimum size of the rseq area allocation required by the syscall. The
actually used rseq feature size may be less (20 bytes initially). */
@@ -59,6 +60,13 @@ extern ptrdiff_t _rseq_offset attribute_hidden;
rtld_hidden_proto (__rseq_size)
rtld_hidden_proto (__rseq_offset)
+/* Returns a pointer to the current thread rseq area. */
+static inline struct rseq_area *
+RSEQ_SELF (void)
+{
+ return (struct rseq_area *) ((char *) __thread_pointer () + __rseq_offset);
+}
+
#ifdef RSEQ_SIG
static inline bool
rseq_register_current_thread (struct pthread *self, bool do_rseq)