Back to index

glibc  2.9
Functions
pthread_mutexattr_getpshared.c File Reference
#include <pthreadP.h>

Go to the source code of this file.

Functions

int pthread_mutexattr_getpshared (pthread_mutexattr_t *attr, int *pshared) const

Function Documentation

int pthread_mutexattr_getpshared ( pthread_mutexattr_t attr,
int pshared 
) const

Definition at line 24 of file pthread_mutexattr_getpshared.c.

{
  const struct pthread_mutexattr *iattr;

  iattr = (const struct pthread_mutexattr *) attr;

  *pshared = ((iattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_PSHARED) != 0
             ? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE);

  return 0;
}