HomeFreeBSD

libsys: remove usage of pthread_once and _once_stub

Description

libsys: remove usage of pthread_once and _once_stub

that existed in auxv.c, use simple bool gate instead. This leaves a
small window if two threads try to call _elf_aux_info(3) simultaneously.
The situation is safe because auxv parsing is really idempotent. The
parsed data is the same, and we store atomic types (int/long/ptr) so
double-init does not matter.

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

Details

Provenance
kibAuthored on Feb 20 2024, 2:45 PM
Reviewer
brooks
Differential Revision
D43985: Make libsys self-contained
Parents
rGaf9758deff9a: libsys: internalize memcpy, memset, and strlcpy
Branches
Unknown
Tags
Unknown