pthread_mutexattr_setkind_np(3)

pthread_mutexattr_setkind_np3

Mutex attribute operations (legacy)

Part of pthread_mutexattr_getkind_np(3).

Usage

#include <pthread_np.h>

int

pthread_mutexattr_getkind_np(pthread_mutexattr_t attr);

int

pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);

Library

POSIX Threads Library (libpthread, -lpthread)

Overview

These functions are deprecated and non-portable implementation of the mutex type manipulation.

It is recommended to use the pthread_mutexattr_gettype(3) and pthread_mutexattr_settype(3) functions instead.

Return values

The pthread_mutexattr_getkind_np() function returns a positive value representing the “kind” of the mutex attribute attr if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

The pthread_mutexattr_setkind_np() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

Errors

The pthread_mutexattr_getkind_np() and pthread_mutexattr_setkind_np() functions will fail if:

[EINVAL]

The value specified by attr is invalid.

Releases

59 releases since FreeBSD 4.8-RELEASE; the text changed 36 times.

  1. 4.8–4.11
  2. 5.1–5.2.1
  3. 5.3–5.5
  4. 6.0–6.3
  5. 6.4
  6. 7.0
  7. 7.1
  8. 7.2
  9. 7.3
  10. 7.4
  11. 8.0
  12. 8.1
  13. 8.2
  14. 8.3
  15. 8.4
  16. 9.0
  17. 9.1
  18. 9.2
  19. 9.3
  20. 10.0
  21. 10.1
  22. 10.2
  23. 10.3
  24. 10.4
  25. 11.0
  26. 11.1
  27. 11.2
  28. 11.3
  29. 11.4
  30. 12.0
  31. 12.1
  32. 12.2
  33. 12.3
  34. 12.4
  35. 13.0
  36. 13.1–13.2
  37. 13.3–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.