Back to index

glibc  2.9
pthread_getaffinity.c File Reference
#include <errno.h>
#include <limits.h>
#include <pthreadP.h>
#include <string.h>
#include <sysdep.h>
#include <sys/param.h>
#include <sys/types.h>
#include <shlib-compat.h>

Go to the source code of this file.


int __pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset)

Function Documentation

int __pthread_getaffinity_new ( pthread_t  th,
size_t  cpusetsize,
cpu_set_t *  cpuset 

Definition at line 31 of file pthread_getaffinity.c.

  const struct pthread *pd = (const struct pthread *) th;

  int res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, pd->tid,
                           MIN (INT_MAX, cpusetsize), cpuset);
  if (INTERNAL_SYSCALL_ERROR_P (res, err))
    return INTERNAL_SYSCALL_ERRNO (res, err);

  /* Clean the rest of the memory the kernel didn't do.  */
  memset ((char *) cpuset + res, '\0', cpusetsize - res);

  return 0;

Here is the call graph for this function: