219f416eabf3c5c14f7f1aab0ec0dcf3a2d2be22
4 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; only
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
30 __attribute__((weak
)) __thread
volatile struct rseq __rseq_abi
= {
34 static int sys_rseq(volatile struct rseq
*rseq_abi
, int flags
)
36 return syscall(__NR_rseq
, rseq_abi
, flags
);
39 static void signal_off_save(sigset_t
*oldset
)
45 ret
= pthread_sigmask(SIG_BLOCK
, &set
, oldset
);
50 static void signal_restore(sigset_t oldset
)
54 ret
= pthread_sigmask(SIG_SETMASK
, &oldset
, NULL
);
59 int rseq_register_current_thread(void)
63 rc
= sys_rseq(&__rseq_abi
, 0);
65 fprintf(stderr
, "Error: sys_rseq(...) failed(%d): %s\n",
66 errno
, strerror(errno
));
69 assert(rseq_current_cpu() >= 0);
73 int rseq_unregister_current_thread(void)
77 rc
= sys_rseq(NULL
, 0);
79 fprintf(stderr
, "Error: sys_rseq(...) failed(%d): %s\n",
80 errno
, strerror(errno
));
This page took 0.033882 seconds and 4 git commands to generate.