Back to index

glibc  2.9
Functions
pthread_attr_setscope.c File Reference
#include <assert.h>
#include <errno.h>
#include "pthreadP.h"

Go to the source code of this file.

Functions

int __pthread_attr_setscope (pthread_attr_t *attr, int scope)

Function Documentation

int __pthread_attr_setscope ( pthread_attr_t attr,
int  scope 
)

Definition at line 26 of file pthread_attr_setscope.c.

{
  struct pthread_attr *iattr;

  assert (sizeof (*attr) >= sizeof (struct pthread_attr));
  iattr = (struct pthread_attr *) attr;

  /* Catch invalid values.  */
  switch (scope)
    {
    case PTHREAD_SCOPE_SYSTEM:
      iattr->flags &= ~ATTR_FLAG_SCOPEPROCESS;
      break;

    case PTHREAD_SCOPE_PROCESS:
      return ENOTSUP;

    default:
      return EINVAL;
    }

  return 0;
}