PTHREAD_RWLOCKATTR_INIT(3)
π PTHREAD_RWLOCKATTR_INIT(3) β like, the read/write lock attributes init page, bestie
okay so this is a page from the Library Functions Manual (yes, section 3, we're in libcall land π) and it's about giving your rwlock attributes object its first little breath of life. short page, but every word is iconic, so let's go.
β¨ NAME β¨
pthread_rwlockattr_init β initialize a read/write lock attributes object
like, you're literally breathing life into an attributes object. that's the whole job. main character energy fr fr π¦
π LIBRARY π
POSIX Threads Library (libpthread, -lpthread)
ngl if you forgot to link -lpthread you're gonna have a bad time, so don't do that to yourself π
πΈ SYNOPSIS πΈ
#include <pthread.h>
int
pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
one header, one function, one pointer. clean. we love to see it β¨
π DESCRIPTION π
The pthread_rwlockattr_init() function is used to initialize a read/write lock attributes object.
that's it. that's the whole vibe. you hand it an attributes object and it gets set up all nice and ready for you π«Ά
β RETURN VALUES β
If successful, the pthread_rwlockattr_init() function will return zero.
Otherwise an error number will be returned to indicate the error.
so like β zero means slay, anything else means go read the next section π and reminder: it returns the error number, it does not set errno. different system, bestie, keep up π
π ERRORS π
The pthread_rwlockattr_init() function will fail if:
[ENOMEM]β Insufficient memory exists to initialize the attributes object. like the system literally ran out of room to even start. tragic. π
π₯ SEE ALSO π₯
pthread_rwlock_init(3)pthread_rwlockattr_destroy(3)pthread_rwlockattr_getpshared(3)pthread_rwlockattr_setpshared(3)
the whole friend group honestly π«Ά go read them, they're all part of the same little rwlock-attributes storyline.
π STANDARDS π
The pthread_rwlockattr_init() function is expected to conform to Version 2 of the Single UNIX Specification (βSUSv2β).
certified standards-compliant behaviour, no cap β¨
π HISTORY π
The pthread_rwlockattr_init() function first appeared in FreeBSD 3.0.
an elder. a legend. we stan a function with lore π
and that's the page, bestie π written by the Debian crew, dated August 4, 1998 β yeah, 1998, this one's been serving since before we were born π go forth and initialize your attributes objects responsibly. mwah π¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Alex Nash
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms