diff options
author | Ruslan Ermilov <ru@nginx.com> | 2012-03-21 17:58:51 +0400 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2012-03-21 17:58:51 +0400 |
commit | fbd32d4d19cf7996e1d54b548744639b93f94459 (patch) | |
tree | d8ea2879887aa37e39587d2d377d8b18c88cdd55 /auto/os | |
parent | d4b1e5f58b999ad9c36d150ceb4493662f0188dc (diff) |
worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.
Diffstat (limited to 'auto/os')
-rw-r--r-- | auto/os/freebsd | 8 | ||||
-rw-r--r-- | auto/os/linux | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/auto/os/freebsd b/auto/os/freebsd index 88654ba60..6aa823f92 100644 --- a/auto/os/freebsd +++ b/auto/os/freebsd @@ -134,3 +134,11 @@ END exit 1 fi fi + + +# cpuset_setaffinity() + +if [ $version -ge 701000 ]; then + echo " + cpuset_setaffinity() found" + have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have +fi diff --git a/auto/os/linux b/auto/os/linux index dba11a4bc..c506d3dc3 100644 --- a/auto/os/linux +++ b/auto/os/linux @@ -128,8 +128,9 @@ ngx_feature_run=no ngx_feature_incs="#include <sched.h>" ngx_feature_path= ngx_feature_libs= -ngx_feature_test="long mask = 0; - sched_setaffinity(0, 32, (cpu_set_t *) &mask)" +ngx_feature_test="cpu_set_t mask; + CPU_ZERO(&mask); + sched_setaffinity(0, sizeof(cpu_set_t), &mask)" . auto/feature |