src/os/unix/ngx_setaffinity.h - nginx source code

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Nginx, Inc.
  3. */

  4. #ifndef _NGX_SETAFFINITY_H_INCLUDED_
  5. #define _NGX_SETAFFINITY_H_INCLUDED_


  6. #if (NGX_HAVE_SCHED_SETAFFINITY || NGX_HAVE_CPUSET_SETAFFINITY)

  7. #define NGX_HAVE_CPU_AFFINITY 1

  8. #if (NGX_HAVE_SCHED_SETAFFINITY)

  9. typedef cpu_set_t  ngx_cpuset_t;

  10. #elif (NGX_HAVE_CPUSET_SETAFFINITY)

  11. #include <sys/cpuset.h>

  12. typedef cpuset_t  ngx_cpuset_t;

  13. #endif

  14. void ngx_setaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log);

  15. #else

  16. #define ngx_setaffinity(cpu_affinity, log)

  17. typedef uint64_t  ngx_cpuset_t;

  18. #endif


  19. #endif /* _NGX_SETAFFINITY_H_INCLUDED_ */