Back to index

glibc  2.9
pthread_attr_destroy.c File Reference
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "pthreadP.h"
#include <shlib-compat.h>

Go to the source code of this file.


int __pthread_attr_destroy (pthread_attr_t *attr)

Function Documentation

Definition at line 28 of file pthread_attr_destroy.c.

  struct pthread_attr *iattr;

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

#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1)
  /* In old struct pthread_attr, neither next nor cpuset are
     present.  */
  if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0)
    /* The affinity CPU set might be allocated dynamically.  */
    free (iattr->cpuset);

  return 0;