Only set 'rseq_size' on first thread registration
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 26 Jul 2024 19:50:54 +0000 (19:50 +0000)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Jul 2024 19:23:22 +0000 (15:23 -0400)
commitc67d198627c2c2b68e38b1d75c11ed2e066872c9
treecb9d77ae263c04418f6747e32aab6462ba1cfeae
parentb94c7cf9f978aee329de105dc4706b8d3e05a4cc
Only set 'rseq_size' on first thread registration

To mimic the libc behavior, don't set the feature size in 'rseq_size'
until at least one thread has successfully registered. This allows using
'rseq_size' in fast-paths to test for both registration status and
available features. The caveat is that on libc either all threads are
registered or none are, while with bare librseq it is the responsability
of the user to register all threads using rseq.

Change-Id: Idc491153de55f9ac38bd1fcad425aee9549fc910
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/rseq.c
tests/basic_test.c
tests/unregistered_test.c
This page took 0.023058 seconds and 4 git commands to generate.