PTHREAD_RWLOCKATTR_GETPSHARED(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

✨ NAME ✨

okay bestie, welcome to the pthread_rwlockattr_getpshared(3) page from the Library Functions Manual πŸ’– this one is literally about getting the process shared attribute, and it's lowkey iconic.

pthread_rwlockattr_getpshared β€” get the process shared attribute. 🫢


πŸ“š LIBRARY πŸ“š

POSIX Threads Library (libpthread, -lpthread) β€” that's where this lives, bestie. ✨


🧚 SYNOPSIS 🧚

#include <pthread.h>

int
pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict attr,
    int *restrict pshared);

No cap, that's the exact include and signature β€” copy it character for character. πŸ’…


🌸 DESCRIPTION 🌸

So the pthread_rwlockattr_getpshared() function is used to get the process shared setting of a read/write lock attribute object. The setting is returned via pshared, and it may be one of two values:

  • PTHREAD_PROCESS_SHARED β€” Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. πŸ”₯
  • PTHREAD_PROCESS_PRIVATE β€” Only threads created within the same process as the thread that initialized the read/write lock can manipulate the lock. This is the default value. πŸ‘‘

πŸŽ€ RETURN VALUES πŸŽ€

If successful, the pthread_rwlockattr_getpshared() function will return zero. Otherwise an error number will be returned to indicate the error. periodt. πŸ’…


πŸ’€ ERRORS πŸ’€

The pthread_rwlockattr_getpshared() function may fail if:

  • [EINVAL] β€” The value specified by attr is invalid. 🚩

πŸ¦‹ SEE ALSO πŸ¦‹

go check these besties, iykyk 🫢✨


⭐ STANDARDS ⭐

The pthread_rwlockattr_getpshared() function is expected to conform to Version 2 of the Single UNIX Specification (β€œSUSv2”). 🌈


πŸ‘‘ HISTORY πŸ‘‘

The pthread_rwlockattr_getpshared() function first appeared in FreeBSD 3.0. vintage but still iconic, fr fr. πŸŽ€


source/version: Debian Β· date: August 17, 2018 Β· stamp: PTHREAD_RWLOCKATTR_GETPSHARED(3) β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from