---
name: "pthread_mutexattr_setkind_np"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pthread_mutexattr_getkind_np"
---

# pthread\_mutexattr\_setkind\_np(3)

mutex attribute operations (legacy)

Part of [pthread\_mutexattr\_getkind\_np(3)](/pthread_mutexattr_getkind_np/3.md).

## NAME

**pthread\_mutexattr\_getkind\_np**, **pthread\_mutexattr\_setkind\_np** – mutex attribute operations (legacy)

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## SYNOPSIS

**#include \<pthread\_np.h\>**

*int*\

**pthread\_mutexattr\_getkind\_np**(*pthread\_mutexattr\_t attr*);

*int*\

**pthread\_mutexattr\_setkind\_np**(*pthread\_mutexattr\_t \*attr*, *int kind*);

## DESCRIPTION

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

It is recommended to use the [pthread\_mutexattr\_gettype(3)](/pthread_mutexattr_gettype/3.md) and [pthread\_mutexattr\_settype(3)](/pthread_mutexattr_settype/3.md) 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.

## SEE ALSO

[pthread\_mutex\_destroy(3)](/pthread_mutex_destroy/3.md), [pthread\_mutex\_init(3)](/pthread_mutex_init/3.md), [pthread\_mutexattr\_gettype(3)](/pthread_mutexattr_gettype/3.md), [pthread\_mutexattr\_settype(3)](/pthread_mutexattr_settype/3.md), [pthread\_np(3)](/pthread_np/3.md)
