From fbd32d4d19cf7996e1d54b548744639b93f94459 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 21 Mar 2012 13:58:51 +0000 Subject: worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support. --- src/os/unix/ngx_setaffinity.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/os/unix/ngx_setaffinity.h (limited to 'src/os/unix/ngx_setaffinity.h') diff --git a/src/os/unix/ngx_setaffinity.h b/src/os/unix/ngx_setaffinity.h new file mode 100644 index 000000000..33f5835de --- /dev/null +++ b/src/os/unix/ngx_setaffinity.h @@ -0,0 +1,23 @@ + +/* + * Copyright (C) Nginx, Inc. + */ + +#ifndef _NGX_SETAFFINITY_H_INCLUDED_ +#define _NGX_SETAFFINITY_H_INCLUDED_ + + +#if (NGX_HAVE_SCHED_SETAFFINITY || NGX_HAVE_CPUSET_SETAFFINITY) + +#define NGX_HAVE_CPU_AFFINITY 1 + +void ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log); + +#else + +#define ngx_setaffinity(cpu_affinity, log) + +#endif + + +#endif /* _NGX_SETAFFINITY_H_INCLUDED_ */ -- cgit v1.2.3