Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#include <syscall.h>
#include <assert.h>
#include <signal.h>
+#include <limits.h>
#include <rseq/rseq.h>
sigset_t oldset;
signal_off_save(&oldset);
+ if (__lib_rseq_abi.refcount == INT_MAX) {
+ ret = -1;
+ goto end;
+ }
if (__lib_rseq_abi.refcount++)
goto end;
rc = sys_rseq(&__rseq_abi, sizeof(struct rseq), 0, RSEQ_SIG);
sigset_t oldset;
signal_off_save(&oldset);
+ if (!__lib_rseq_abi.refcount) {
+ ret = -1;
+ goto end;
+ }
if (--__lib_rseq_abi.refcount)
goto end;
rc = sys_rseq(&__rseq_abi, sizeof(struct rseq),