pthread_mu...setkind_np(3)
π pthread_mu...setkind_np(3) π
okay bestie, so this page is straight out of the Library Functions Manual, and it's literally titled pthread_mu...setkind_np(3). yes the name is truncated, that's just how it is, we move. π«Ά
β¨ NAME β¨
pthread_mutexattr_setkind_np, pthread_mutexattr_getkind_np β deprecated mutex creation attributes π
like... they still exist, but they're giving retirement home energy. pls read on.
πΈ SYNOPSIS πΈ
#include <pthread.h>
int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr,
int *kind);
one sets, one gets. classic duo. dynamic duo. π
π¦ DESCRIPTION π¦
so here's the tea, and it's not the fun kind: these functions are deprecated. π«
instead, you want to use pthread_mutexattr_settype(3) and pthread_mutexattr_gettype(3). literally just go use those, they're the glow-up versions.
no cap, if you're writing new code and you reach for these, put your hand down.settypeandgettypeare right there bestie!! π
π RETURN VALUE π
pthread_mutexattr_getkind_np()β always returns0. always. it's an absolute icon of consistency, it does not miss. πpthread_mutexattr_setkind_np()β returns0when it succeeds, and a non-zero error code when it errors out. so0= slay, non-zero = uh oh. π
π₯ ERRORS π₯
when pthread_mutexattr_setkind_np() messes up, it hands you back this error code:
EINVALβkindis neitherPTHREAD_MUTEX_FAST_NPnorPTHREAD_MUTEX_RECURSIVE_NPnorPTHREAD_MUTEX_ERRORCHECK_NP. in other words: you gave it a vibe it does not recognise, and it is not about to fw that. π
π SEE ALSO π
π bye bestie π
this was brought to you by Linux man-pages 6.20, dated 2025-05-17, and the title card said pthread_mu...setkind_np(3) the whole time. now go call pthread_mutexattr_settype(3) instead, ily, mwah. πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms