PTHREAD_RWLOCKATTR_SETPSHARED(3)

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

✨ NAME ✨

okay bestie, welcome to the PTHREAD_RWLOCKATTR_SETPSHARED(3) page from the Library Functions Manual β€” this one is literally all about setting the process shared attribute. That's the name, and it ate. πŸ’…

πŸ“š LIBRARY πŸ“š

POSIX Threads Library (libpthread, -lpthread) β€” yes, link it and slay. 🧡✨

πŸ› οΈ SYNOPSIS πŸ› οΈ

#include <pthread.h>

int
pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared);

πŸ’– DESCRIPTION πŸ’–

So pthread_rwlockattr_setpshared() sets the process shared attribute of attr to the value that pshared references. The pshared argument may be one of two values, and choosing one is giving main character energy:

  • PTHREAD_PROCESS_SHARED β€” Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. Shared is shared, bestie.
  • 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, ngl.

🫢 RETURN VALUES 🫢

If successful, the pthread_rwlockattr_setpshared() function will return zero. Otherwise an error number will be returned to indicate the error. No cap. ✨

πŸ’€ ERRORS πŸ’€

The pthread_rwlockattr_setpshared() function will fail if:

  • [EINVAL] β€” the value specified by attr or pshared is invalid.

πŸ‘€ SEE ALSO πŸ‘€

🌈 STANDARDS 🌈

The pthread_rwlockattr_setpshared() function is expected to conform to Version 2 of the Single UNIX Specification (β€œSUSv2”). Iconic behavior, fr fr. πŸ‘‘

πŸ¦‹ HISTORY πŸ¦‹

The pthread_rwlockattr_setpshared() function first appeared in FreeBSD 3.0. Support for process-shared read/write locks appeared in FreeBSD 11.0. Look at her grow. πŸ˜­πŸ’–


mwah πŸ’‹ β€” this page is from Debian, dated May 31, 2016, and it's the PTHREAD_RWLOCKATTR_SETPSHARED(3) page. periodt. πŸŽ€

πŸ“¦ where this page comes from