ARES_THREADSAFETY(3)
π ARES_THREADSAFETY π
okay bestie, welcome to ares_threadsafety(3), aka the little function that tells you whether your c-ares build is β¨thread-safeβ¨ or not. it lives in the Library Functions Manual, and it's literally one question with two answers. iconic behaviour, honestly.
πΈ NAME πΈ
ares_threadsafety β ask c-ares if it was built with thread-safety, yes or no, no cap.
β¨ SYNOPSIS β¨
#include <ares.h>
ares_bool_t ares_threadsafety(void);
π¦ DESCRIPTION π¦
so the way that ares_threadsafety(3) works is: it returns whether the library was built with thread safety enabled or not. that's it. that's the whole vibe check. π
as of c-ares 1.23.0, this simply means that every public function which references an ares_channel_t object will lock the channel on entry and release the lock on exit of the function. so like, nobody's fighting over the channel while someone else is using it. this will prevent concurrent thread access to the channel, thus ensuring no corruption can occur. no corruption bestie, we love that for us. π«Ά
as of c-ares 1.26.0, this also indicates if ARES_OPT_EVENT_THREAD can be passed to ares_init_options(3). so it's lowkey doing double duty now. main character energy fr fr. π
π RETURN VALUES π
ares_threadsafety(3) can return any of the following values:
ARES_TRUEβ Built with thread safety. slay, you're safe πARES_FALSEβ Built without thread safety. not me finding out the hard way π
π AVAILABILITY π
this function was first introduced in c-ares version 1.23.0. so if you're on something older, sorry babe, she's not there yet. π
β SEE ALSO β
ares_init(3)ares_init_options(3)ares_destroy(3)ares_dup(3)ares_library_init(3)ares_set_servers(3)
okay that's the whole page, you ate that. π β¨
signing off with love from the c-ares squad β this one's dated 26 November 2023, and yeah, it's the ARES_THREADSAFETY(3) page, periodt. π¦ππ
π¦ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 Β· MIT
- arch rolling: c-ares 1.34.9-1 Β· MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 Β· MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 Β· MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 Β· MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 Β· MIT
- π the page's license: MIT
- Copyright 2023 by the c-ares project and its contributors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms